Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 P2P Digital TV Recorder Supervisor: Professor Michael R. Lyu Prepared by:Ho Tsz Wing, Andy Lau Wai Shun, Jack.

Similar presentations

Presentation on theme: "1 P2P Digital TV Recorder Supervisor: Professor Michael R. Lyu Prepared by:Ho Tsz Wing, Andy Lau Wai Shun, Jack."— Presentation transcript:

1 1 P2P Digital TV Recorder Supervisor: Professor Michael R. Lyu Prepared by:Ho Tsz Wing, Andy Lau Wai Shun, Jack

2 LYU0502 2 Content 1.Project background and objectives 2.Summary of Work in Semester 1 3.Improvements in Semester 2 a)Decentralized searching algorithm and buddy list b)Decentralized recording algorithm and bonus system c)Streaming and video format conversion 4.Difficulties and Solution 5.Further Improvements 6.Conclusion

3 LYU0502 3 Project background Watching TV is a major entertainment People often miss their favorite programs People need to schedule the recording of the programs

4 LYU0502 4 Project objectives Allow people to view back a previous TV program without doing scheduling themselves Let the users view the program on demand Increase the availability of the TV programs Achieve load balancing among the participating peers

5 LYU0502 5 Summary of Work in Sem1 Program Core 1.Download the video file from other peers 2.No Buddy List 3.All peers information is stored in a centralized server 4.A centralized scheduling algorithm 5.Peers unable to reject the recording task 6.Using a complex algorithm to achieve high availability P2P Digital TV Recorder Performance enhancement 1.Whole file replication 2.Erasure code replication Research Results 1.In most cases, erasure code replication performs better than whole file replication 2.When the peer availability attains a certain level, the performance of the whole file replication close to erasure code replication

6 LYU0502 6 Improvement Work in Sem2 Problem Performance of the server become the bottleneck of the system Cause Queries needed to handle increase dramatically with the increase of the number of peers Solution Use buddy list system Try to keep as less as information in the sever

7 LYU0502 7 Improvement Work in Sem2 Problem Peers cannot reject the recording tasks => Inflexible Cause A centralized server will assign the recording task to the online peer without considering their contribution to the system Solution A distributed scheduling algorithm Implement a bonus system The user is able to accept or reject the task

8 LYU0502 8 Improvement Work in Sem2 Problem Replication methods take too much time and CPU resource Cause As the original video in dvr-ms format is too large, no matter which replication we use, much time is consumed. Solution Implement a streaming server Real time encoding is fast enough

9 9 Improvement Work - 1 1.Decentralized searching algorithm and buddy list 2.Decentralized recording algorithm and bonus system

10 LYU0502 10 User Search Application Login/Logout Application Xml.asp Database Component of Server

11 LYU0502 11 Login / Logout / User Search DirectoryServer B E C D A Online Offline Online Login message Buddy Information

12 LYU0502 12 Task of Client Side Client Application Download StreamingRecording Download (Implemented) Basic function Send the video file to the requested peer Streaming Encoding to wmv Preview function Recording Scheduling among peers Bonus system

13 LYU0502 13 Download Topology – Napster (Sem1) Owner@ Client Lookup(TVB News) N6N6 N9N9 N7N7 Server N8N8 N3N3 N2N2 N1N1 Simple, but O( N ) states and a single point of failure Key=TVB News N4N4

14 LYU0502 14 Download Topology – Gnutella (Sem 2) N4N4 Owner@ Client N6N6 N9N9 N7N7 N8N8 N3N3 N2N2 N1N1 Robust, but in the worst case O( N ) messages per lookup Key=TVB News Lookup(TVB News)

15 LYU0502 15 P2P Digital TV Recorder Protocol Download & Streaming / Recording Message IP ID Type Program Title TTL / Hop Port / Channel

16 LYU0502 16 Performance Enhancement Forward the message to other peers All pass CheckIPField Check Message ID CheckTTL Check File Exist

17 LYU0502 17 Scheduling of Recording Task 1.Peers initialize the recording task when the program starts 2.Peers are able to determine recording or not if the bonus points of the peers attain a particular level 3.Peers forward the recording message to one of its buddies 1.Server will schedule the recording of all program in the morning 2.Send out the recording request to 2 peers randomly before the program starts 3.Peers who received the recording request cannot reject it. CentralizedDecentralized

18 LYU0502 18 Scheduling Policies

19 LYU0502 19 Scheduling Policies

20 LYU0502 20 Bonus System Free Rider unable to decide record or not Normal User able to decide record or not 1010+

21 21 Improvement Work - 2 Video-On-Demand (VoD) streaming

22 LYU0502 22 Why use VoD streaming? Download the user needs to wait for a long time errors may occur in the downloading process VoD streaming save the user a lot of time and storage space can be used as a preview function

23 LYU0502 23 Windows Media Encoder SDK DirectShow Library GraphEdit Tools used in developing the streaming application

24 LYU0502 24 DirectShow Library a media-streaming architecture for the Microsoft Windows® platform provides for high-quality capture and playback of multimedia streams Example uses: file players video editing applications file format converters etc.

25 LYU0502 25 DirectShow Filters and Filter Graphs DirectShow Filters receive multimedia streams as input and produce output A source filter introduces data into the graph. A transform filter takes an input stream, processes the data, and creates an output stream. Renderer filters receive data and present it to the user Filter Graphs A set of connected filters controlled by a high-level component called the Filter Graph Manager

26 LYU0502 26 DirectShow Architecture

27 LYU0502 27 Writing a DirectShow Application The application 1.creates an instance of the Filter Graph Manager. 2.uses the Filter Graph Manager to build a filter graph. 3.uses the Filter Graph Manager to control the filter graph and stream data through the filters.

28 LYU0502 28 Approaches in Graph Building ApproachMethod Used The Filter Graph Manager builds the entire graph RenderFile The Filter Graph Manager builds part of the graph Render The application builds the entire graphAddFilter, Connect or ConnectDirect

29 LYU0502 29 Reasons for using DirectShow Library 1.Windows MCE records TV programs in dvr- ms format 2.Dvr-ms files are not efficient for storage (1hr TV program recorded in good quality requires about 1668MB) 3.Dvr-ms files cannot be streamed over the internet 4.DirectShow is used to convert dvr-ms file to wmv file that can be used for streaming 5.The file size of 1 hr wmv file is only 101MB if the bit rate is 225kbps

30 LYU0502 30 Number of days of TV programmes that can be recorded with a given hard disk size 20.63 1.25 1.31 22.09

31 LYU0502 31 GraphEdit The filter graph built by our application

32 LYU0502 32 Uses of DirectShow Library Steps to convert dvr-ms file to wmv file using DirectShow Library: 1.start once Windows MCE has finished recording a particular TV program 2.create the filter graph and render the dvr-ms file 3.original dvr-ms file will be deleted in the case that the storage space is not sufficient for new recording

33 LYU0502 33 Experiment Result Bit Rate (Kbps) Video SizeFile Size (KB) Conversio n Time (s) 218320 x 2401,71158 441320 x 2403,31760 666320 x 2404,92862 218480 x 3601,731115 441480 x 3603,413116 666480 x 3605,069125 The dvr-ms file used in this experiment has a length of 60s, a file size of 27,399KB and is recorded in good quality

34 LYU0502 34 Experiment Result Bit Rate (Kbps) Video SizeFile Size (KB) Conversio n Time (s) 666320 x 2404,92862 666480 x 3605,069125 666640 x 4805,170209 666800 x 6005,194327 The dvr-ms file used in this experiment has a length of 60s, a file size of 27,399KB and is recorded in good quality

35 LYU0502 35 Windows Media Encoder SDK used to compress live or stored audio and video content into Windows Media files or streams create multimedia productions from devices attached to their computers

36 LYU0502 36 Steps to create an encoding application

37 LYU0502 37 Encoding with CBR and VBR Constant Bit Rate (CBR) Encoding bit rate and size of the content are known before encoding for content that varies in complexity, the encoding quality is not constant Variable Bit Rate (VBR) Encoding it compensates for changes in the complexity of the content bit rate and size of the content are not known before the encoding

38 LYU0502 38 Uses of Windows Media Encoder SDK 1.When the client receives a streaming request, it will create an encoder object, encode the appropriate file using CBR encoding and broadcast it at the address http://localhost:8080http://localhost:8080 2.It then connects to the requesting peer and the peer will view the file at the specified address

39 LYU0502 39 Streaming Architecture DirectoryServer B E C D A Streaming Host Streaming request Connection established

40 LYU0502 40 Difficulties and Solutions Difficulty Dvr-ms file (the default file format for the recorded TV in Windows MCE) cannot be streamed over the Internet Cause Windows Media Encoder 9 Series SDK does not support the encoding and broadcasting of dvr-ms file Solution We have to use DirectShow Library to convert the dvr-ms file to a format that is compatible with Windows Media Encoder 9 Series SDK (i.e. wmv file).

41 LYU0502 41 Difficulties and Solutions Difficulty The wmv file resulted from the conversion of dvr-ms file by DirectShow Library has sound only but no video. Cause The default transform filter chosen by the RenderFile method (InterVideo Video Decoder) cannot decode MPEG-2 stream to MPEG-1 stream Solution So we have chosen to use the GPL MPEG-1/2 Decoder in our filter graph to solve this problem

42 LYU0502 42 Further improvement It is possible to have real time streaming in the following ways: First, we can start the file conversion as soon as Windows MCE starts to record the TV program Next, we can use Windows Media Encoder SDK to encode the wmv file and broadcast it at http://localhost:8080 http://localhost:8080 Finally, the client can connect to the above address to get the video content instantly However, there is one drawback as doing recording and converting at the same time takes up a lot of CPU time

43 LYU0502 43 Further improvement It is also possible to use p2p technique to stream the file It can reduce the network bottleneck at the video server It can provide a fault tolerant Video-on-Demand streaming it raises technical, performance, quality, business, and legal issues

44 LYU0502 44 Conclusion We have implemented our application in a decentralized ways using a buddy list system to enhance the performance. We have introduced a distributed scheduling algorithm and a bonus system to enhance the availability of the TV programmes. We have also developed a streaming server to reduce the storage requirement and enabled the user to preview the TV programmes.

45 45

Download ppt "1 P2P Digital TV Recorder Supervisor: Professor Michael R. Lyu Prepared by:Ho Tsz Wing, Andy Lau Wai Shun, Jack."

Similar presentations

Ads by Google