Distribution Agnostic Video Server
Total Page:16
File Type:pdf, Size:1020Kb
Distribution Agnostic Video Server Waqas Daar Spring, 2010 Master of Science Thesis Stockholm, Sweden 2010 TRITA-ICT-EX-2010:92 KTH ROYAL INSTITUTE OF TECHNOLOGY Distribution Agnostic Video Server by Waqas Daar A thesis submitted in partial fulfillment for the degree of Master of Science in Internetworking in the Telecommunication System Laboratory (TSlab) School of Information and Communication Technology May 2010 Declaration of Authorship I, Waqas Daar, declare that this thesis titled, `Distribution Agnostic Video Server' and the work presented in it are my own. I confirm that: This work was done wholly or mainly while in candidature for a research degree at this University. Where any part of this thesis has previously been submitted for a degree or any other qualification at this University or any other institution, this has been clearly stated. Where I have consulted the published work of others, this is always clearly at- tributed. Where I have quoted from the work of others, the source is always given. With the exception of such quotations, this thesis is entirely my own work. I have acknowledged all main sources of help. Where the thesis is based on work done by myself jointly with others, I have made clear exactly what was done by others and what I have contributed myself. Signed: Date: i KTH ROYAL INSTITUTE OF TECHNOLOGY Abstract Telecommunication System Laboratory (TSlab) School of Information and Communication Technology Master of Science in Internetworking by Waqas Daar With the advances of network and communication technology, real time audio and video streaming services are becoming progressively popular over the Internet. In order to enable universal access of multimedia streaming content and thus the desired end-to-end QoS, it is very desirable to design a video server. A video server, that can dynamically coupled to different streaming engines and deployed in a test bed for conducting different streaming experiments. In this thesis we present the design of a video server that implement an "engine- agnostic" abstraction that will help to automate and repeat deterministic streaming experiments using different engines. Proposed video server is also deployed in a test bed for evaluating different performance measurement parameters like CPU load, memory utilization etc. The results of test bed also support our proposed idea and unfold many opportunities for the research community to perform different multimedia streaming experiments with proposed video server. KTH ROYAL INSTITUTE OF TECHNOLOGY Abstract Telecommunication System Laboratory (TSlab) School of Information and Communication Technology Master of Science in Internetworking by Waqas Daar Med f¨oskott n¨at-och kommunikationsteknik, realtid ljud och video streaming tj¨anster blir gradvis popul¨arap˚aInternet. F¨oratt att allm¨antillgng till multimedia str¨ommande inneh˚alloch d¨armed den ¨onskade end-to-end QoS ¨ardet mycket ¨onskvrtatt utforma en video server. En video server, som kan dynamiskt kopplat till di erent streaming motorer och s¨attsin i en provbnk f¨oratt utf¨oradi erent streaming experiment. I denna avhandling presenterar vi designen av en video server att genomf¨oraen "motor- agnostiker "abstraktion som bidrar till att automatisera och upprepa deterministiska streaming f¨ors¨okmed di erent motorer. F¨oreslagenvideo server ¨arocks˚alanseratsi en provb¨ankf¨orutv¨arderingdi erent parametrar resultatmtning som CPU belastning, minne jande etc. Resultatet av en provb¨ankst¨oderocks v˚araf¨oreslagnaid och f¨all m˚angam¨ojligheterf¨orforskningen att genomf¨ora di erent multimedia str¨omexperiment med f¨oreslagnavideo server. Acknowledgements This thesis work has been carried out in Department of Information Engineering and Computer Science in University of Trento, Italy. First of all I would like to thank ALLAH Subhanahu wa-ta'ala for his help and then I would like to record my gratitude to both of my supervisers Renato Lo Cigno and Luca Abeni for their supervision, advice, and guidance from the very early stage of this research as well as giving me extraordinary experiences through out the work. Above all and the most needed, they provided me unintimidated encouragement and support in various ways. I gratefully acknowledge Markus Hidell for his advice, and crucial contribution, which made him a backbone of this research and so to this thesis. His involvement with his originality has triggered and nourished my intellectual maturity that I will benefit from, for a long time to come. Markus, I am grateful in every possible way. Many thanks go in particular to Tariq Mahmood and Adil Yaqoob. I am much in- debted to Tariq Mahmood for his valuable advice in thesis writing and furthermore, using his precious times to read this thesis and gave his critical comments about it. Words fail me to express my appreciation to my family for their love, support, per- sistent confidence and most importantly prayers during my studies far away from them. Finally, It is pleasure to thank all my friends specially Ishrat Ali Awan, Asim Shahzad, Waqas Ghuman and Talha Bin Fida, who supported me during my studies and stay in Sweden. And as well as expressing my apology that I could not mention personally one by one. iv Contents Declaration of Authorshipi Abstract ii Acknowledgements iv List of Figures viii List of Tablesx Abbreviations xi 1 Introduction1 1.1 Motivation...................................1 1.2 Problem Statement...............................2 1.3 Thesis objective.................................2 1.4 Contributions..................................3 1.5 Thesis outline..................................3 2 Background4 2.1 Video Streaming................................4 2.2 Challenges of Video Streaming........................6 2.3 Streaming Protocols..............................7 2.3.1 Real time Streaming Protocol (RTSP)................8 2.3.2 Session Description Protocol..................... 10 2.3.3 Real Time Transport Protocol (RTP)................ 12 2.3.3.1 RTP Header......................... 13 2.3.3.2 RTP Profile......................... 14 2.3.3.3 Real Time Control Protocol (RTCP)........... 15 2.3.4 RTCP Services............................. 15 2.3.4.1 RTCP Packet Types..................... 16 2.3.5 Proprietary Streaming Protocol.................... 17 2.3.5.1 Microsoft Media Server................... 17 2.3.5.2 Shoutcast/Icecast Protocol (ICY)............. 17 v Contents vi 2.4 Multicast Streaming.............................. 18 2.5 Peer to Peer Streaming............................ 19 2.5.1 Structured approach.......................... 21 2.5.2 Unstructured approach........................ 22 3 Related Work 23 3.1 Commercial Streaming Servers........................ 27 3.1.1 Real Network's Helix Server and Proxy............... 27 3.1.2 Apple's and QuickTime's Darwin Streaming Servers........ 27 3.1.3 Flash Media Server........................... 28 3.1.4 Microsoft Windows Media Services (WMS)............. 29 3.2 Conclusion................................... 29 4 Distribution Agnostic Video Server (DAVS) Design 30 4.1 Design Approaches............................... 30 4.2 DAVS Design.................................. 31 4.3 Functionalities................................. 32 4.4 DAVS Architecture............................... 33 4.4.1 DAVS API............................... 34 4.4.2 Video server interface......................... 36 4.4.3 Streaming engines........................... 36 4.4.4 DAVS Database design........................ 37 4.5 DAVS Client Design.............................. 38 4.6 DAVS system overview............................. 42 4.7 Conclusion................................... 44 5 Implementation of Distribution Agnostic Video Server (DAVS) 45 5.1 Implementation Approaches.......................... 45 5.1.1 Shell Scripting............................. 46 5.1.2 FFmpeg................................. 47 5.2 API Implementation.............................. 47 5.2.1 Validation................................ 48 5.2.2 Importing................................ 49 5.2.3 Start................................... 51 5.2.4 Stop................................... 52 5.2.5 Deport.................................. 52 5.3 Video Server Interface............................. 53 5.4 Proposed packages of DAVS Client...................... 58 6 Testing of Distribution Agnostic Video Server (DAVS) 60 6.1 DAVS Perfomance Evaluation......................... 60 6.1.1 Metrics of DAVS capacity....................... 61 6.2 Experimental Procedure............................ 62 6.2.1 Experiment Description........................ 63 6.3 Experiment Results............................... 64 6.3.1 Behavior of CPU and Memory utilization.............. 65 6.3.2 Behavior of DAVS Network Interface................. 67 6.4 Advantages and disadvantages of DAVS................... 68 Contents vii 6.5 Conclusion................................... 69 7 Conclusion and Future Work 70 7.1 Conclusion................................... 70 7.2 Future Work.................................. 71 A DAVS Code 72 B DAVS Client 73 B.1 Class dependency Diagram.......................... 73 B.2 Snapshot of DAVS Client........................... 73 Bibliography 75 List of Figures 2.1 Downloading video [11]............................5 2.2 Streaming modes [11].............................6 2.3 RTSP Session[14]................................9 2.4 Sample SDP File................................ 12 2.5 Encapsulation of RTP Packet [15]....................... 13 2.6 RTP Header..................................