Your SlideShare is downloading. ×
  • Like
Term 2 Presentation
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Term 2 Presentation



  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. P2P Digital TV Recorder Supervisor: Professor Michael R. Lyu Prepared by: Ho Tsz Wing, Andy Lau Wai Shun, Jack
  • 2. Content
    • Project background and objectives
    • Summary of Work in Semester 1
    • Improvements in Semester 2
      • Decentralized searching algorithm and buddy list
      • Decentralized recording algorithm and bonus system
      • Streaming and video format conversion
    • Difficulties and Solution
    • Further Improvements
    • Conclusion
  • 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. 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. Summary of Work in Sem1 P2P Digital TV Recorder
    • Research Results
    • In most cases, erasure code replication performs better than whole file replication
    • When the peer availability attains a certain level, the performance of the whole file replication close to erasure code replication
    • Program Core
    • Download the video file from other peers
    • No Buddy List
    • All peers’ information is stored in a centralized server
    • A centralized scheduling algorithm
    • Peers unable to reject the recording task
    • Using a complex algorithm to achieve high availability
    • Performance enhancement
    • Whole file replication
    • Erasure code replication
  • 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. 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. 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. Improvement Work - 1
    • Decentralized searching algorithm and buddy list
    • Decentralized recording algorithm and bonus system
  • 10. Component of Server User Search Application Login/Logout Application Xml.asp Database
  • 11. Login / Logout / User Search Online Offline Offline Online Online Online Login message Buddy Information Directory Server B E C D A
  • 12. Task of Client Side Client Application Download Streaming Recording
    • 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. Download Topology – Napster (Sem1) Owner@ Client Lookup(“TVB News”) N 6 N 9 N 7 Server N 8 N 3 N 2 N 1 Simple, but O( N ) states and a single point of failure Key=“TVB News” N 4
  • 14. Download Topology – Gnutella (Sem 2) N 4 Owner@ Client N 6 N 9 N 7 N 8 N 3 N 2 N 1 Robust, but in the worst case O( N ) messages per lookup Key=“TVB News” Lookup(“TVB News”)
  • 15. P2P Digital TV Recorder Protocol Download & Streaming / Recording Message IP ID Type Program Title TTL / Hop Port / Channel
  • 16. Performance Enhancement Forward the message to other peers All pass Check IP Field Check Message ID Check TTL Check File Exist
  • 17. Scheduling of Recording Task
    • Peers initialize the recording task when the program starts
    • Peers are able to determine recording or not if the bonus points of the peers attain a particular level
    • Peers forward the recording message to one of its buddies
    • Server will schedule the recording of all program in the morning
    • Send out the recording request to 2 peers randomly before the program starts
    • Peers who received the recording request cannot reject it.
    Centralized Decentralized
  • 18. Scheduling Policies
  • 19. Scheduling Policies
  • 20. Bonus System Free Rider unable to decide record or not Normal User able to decide record or not 10 10+
  • 21. Improvement Work - 2 Video-On-Demand (VoD) streaming
  • 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. Tools used in developing the streaming application Windows Media Encoder SDK DirectShow Library GraphEdit
  • 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. 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. DirectShow Architecture
  • 27. Writing a DirectShow Application
    • The application
      • creates an instance of the Filter Graph Manager.
      • uses the Filter Graph Manager to build a filter graph.
      • uses the Filter Graph Manager to control the filter graph and stream data through the filters.
  • 28. Approaches in Graph Building AddFilter, Connect or ConnectDirect The application builds the entire graph Render The Filter Graph Manager builds part of the graph RenderFile The Filter Graph Manager builds the entire graph Method Used Approach
  • 29. Reasons for using DirectShow Library
    • Windows MCE records TV programs in dvr-ms format
    • Dvr-ms files are not efficient for storage (1hr TV program recorded in good quality requires about 1668MB)
    • Dvr-ms files cannot be streamed over the internet
    • DirectShow is used to convert dvr-ms file to wmv file that can be used for streaming
    • The file size of 1 hr wmv file is only 101MB if the bit rate is 225kbps
  • 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. GraphEdit
    • The filter graph built by our application
  • 32. Uses of DirectShow Library
    • Steps to convert dvr-ms file to wmv file using DirectShow Library:
      • start once Windows MCE has finished recording a particular TV program
      • create the filter graph and render the dvr-ms file
      • original dvr-ms file will be deleted in the case that the storage space is not sufficient for new recording
  • 33. Experiment Result 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 125 5,069 480 x 360 666 116 3,413 480 x 360 441 115 1,731 480 x 360 218 62 4,928 320 x 240 666 60 3,317 320 x 240 441 58 1,711 320 x 240 218 Conversion Time (s) File Size (KB) Video Size Bit Rate (Kbps)
  • 34. Experiment Result 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 327 5,194 800 x 600 666 209 5,170 640 x 480 666 125 5,069 480 x 360 666 62 4,928 320 x 240 666 Conversion Time (s) File Size (KB) Video Size Bit Rate (Kbps)
  • 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. Steps to create an encoding application
  • 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. Uses of Windows Media Encoder SDK
    • 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:8080
    • It then connects to the requesting peer and the peer will view the file at the specified address
  • 39. Streaming Architecture Streaming request Streaming request Connection established Directory Server B E C D A Streaming Host Streaming Host Streaming Host Streaming Host Streaming Host
  • 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. 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. 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
      • 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. 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. 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. Thank You !