隨著網路頻寬的成長,對於影音多媒體串流的需求也隨之增加,隨選視訊系統 (Video-on-Demand;VoD) 的發展被認為是目前網際網路應用的主流。由於影音多媒體串流的資料量大、頻寬需求高、持續時間長,所以有人提出固定耗用頻寬、無限制使用者且低等待時間的各種群播 (Multicast) 傳輸演算法。然而直到現在群播仍然無法普遍被應用,主要因素在於會增加路由器的控制負擔及計算複雜度。因此有人提出使用同儕網路 (Peer-to-Peer;P2P) 技術來利用網路上眾多使用者或同儕 (Peer) 協助傳輸影音多媒體串流,來減輕影音多媒體提供者網路能力與主機能力的負擔。 其中BitTorrent (BT) 為同儕網路目前最熱門且有效的分散式檔案傳輸技術之一,因此本論文使用BT技術來測試隨選視訊系統的可實現性。由於 BT 是針對傳輸一般檔案所設計,其片段選擇 (Piece Selection) 方法並不適用於傳輸影音多媒體串流,本論文則是利用原有 BT 的架構另外提出較適合的片斷選擇方法,使得檔案未下載完成前就可以即時播放,並且可以平順且連續收看完影片,減少跳格的機會產生。另外由於實作上不會更動到 BT 的協定,所以可以相容於現有的 BT 環境,即來源 Peer 使用的軟體也可以是一般的 BT 軟體。 With the growth of bandwidth, media streaming service becomes popular. As a result, Video on demand (VOD) is considered as the main network application for the time being. Some researchers have developed various multicast algorithms using fixed bandwidth, unlimited users, and low response time for media streaming which features huge data, high bandwidth and long transfer time. However, the multicast technique has not been widely employed until now due to the increased control overhead and computational complexity at router. In order to solve this problem, using Peer-to-Peer (P2P) technique to transfer media stream has been proposed to reduce the media provider load on network speed and server's ability. BitTorrent (BT) is the hottest and most effective one of P2P techniques. Hence this paper uses BT to implement VOD service. Due to the BT was designed for transferring general big file, its piece selection algorithm is not suitable for transferring media file. We propose a new piece selection algorithm and implement based on original BT protocol. In this way, we can smoothly and continuously view the video clip even though the media file is not downloaded completely. In addition, we use the same BT protocol to implement this software, there's no compatible issue on it.