Using P2P Technologies for Providing Video Streaming (February 2011 Report)

14

Click here to load reader

description

Usability and performance issues when deploying video streaming on top of a Peer-to-Peer video streaming solution part of the P2P-Next project, dubbed NextShare.

Transcript of Using P2P Technologies for Providing Video Streaming (February 2011 Report)

Page 1: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

Using P2P Technologies for Providing VideoStreaming

Calin-Andrei BurloiuScientific Advisor: Nicolae T, apus,

Technical Advisor: Razvan DeaconescuAutomatic Control and Computers Faculty

University Politehnica of BucharestSplaiul Independent,ei nr. 313, Bucharest, Romania

[email protected], {razvan.deaconescu, nicolae.tapus}@cs.pub.ro

February 8, 2011

Abstract

The continuous advance of Peer-to-Peer systems during the last decade hassparked numerous extensions and scientific and research interests. Numerous over-lays, social networking facilities, moderation techniques, anonymity are just of fewof the topics that ignite the interest of various scientific entities.

A specialized topic is the introduction of video-streaming in Peer-to-Peer proto-cols, both video on demand (VoD) and live streaming. Streaming in Peer-to-Peerbandwidth promises to use potentially unused bandwidth, remove bottlenecks andimprove user experience. Projects such as P2P-Next address the issue of building asustainable next-generation content delivery system.

Our work deals with usability and performance issues when deploying videostreaming on top of a Peer-to-Peer video streaming solution part of the P2P-Nextproject, dubbed NextShare.

1 Introduction

1.1 Objectives and Motivation

P2P-Next is a consortium of industrial and academic players which aims to build by itsprojects the next generation Peer-to-Peer (P2P) content delivery platform [10]. It involves21 partners from 12 different countries like BBC, Technische Universiteit Delft, Pioneer,Technical Research Centre of Finland and also University Politehnica of Bucharest. P2P-Next takes as design principals the usage of open standards, open source developmentand future proof iterative integration.

The research and implementation of this project is motivated by the increasing needof multimedia content for Internet users. The television is no longer the main mediumfor audio and visual information content. New technologies built over the Internet forcomputers and mobile devices are increasingly advancing. The current Internet infras-tructure was not initially designed for simultaneous transmission of live events to millions

1

Page 2: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

of people and proposed technologies like multicasting do not seem to resolve the problem.That is why P2P-Next decided to develop a new multimedia infrastructure based on P2Ptechnologies like BitTorrent. As a result of the projects developed by the consortium,the users are going to share multimedia content and live streams more easily, in a morescalable infrastructure, by using web-based technologies, IP-TV, video-on-demand, socialnetworks and many more personalized tools.

The reference platform of content distribution developed by P2P-Next is named NextShare,which enables services for both PCs and digital set-top-boxes (STB), usable with TVs.Among the basic services and features are live video and on-demand video available onlinewith an interactive experience and with most of the content being free.

1.2 Activities

Through the Automatic Control and Computers Faculty, University Politehnica of Bucharest(UPB) provides a Living Lab for the P2P-Next, among others from Slovenia, Norway,UK and Finland. The purpose of it is to offer early access to the technologies developed bythe consortium and to receive feedback from users determined to test the infrastructure.

The UPB Living Lab from Romania provides high speed access to Peer-to-Peer technology-enabled content through 10 systems kindly provided by the NCIT cluster. The usersdetermined to test the NextShare infrastructure use as an interface to the Living Lab,the UPB Living Lab trial site [13], p2p-next.cs.pub.ro, where video content is offered fordistribution and occasionally live streams. Through the feedback form, the users are giv-ing valuable information about the problems and issues of the technology which is underdevelopment.

Being part of the Living Lab team we are testing the NextShare technologies andcomponents with various parameters and comparing them with other related technologiesin matters of performance, usability and reliability. An important activity in Living Labis analyzing users’ feedback in order to diagnose the issues of NextShare and to reportthem to the design and developing team from P2P-Next.

Processing video in order to give users the best quality-performance ratio is an activitywhich involves a lot of documentation and experimentation with video streaming, videocontainers, codecs and tools.

NextShare core technologies testing is made up on the P2P Testing Infrastructure [16],which runs peers, seeders and trackers on our cluster. The reports generated by the toolscontain performance information which can be used to improve NextShare.

1.3 Keywords

Peer-to-peer or P2P is a distributed networking application architecture that partitionstasks between peers, which are participants with the same role in the application, beingequally privileged and equipotent [11].

BitTorrent is a peer-to-peer file sharing protocol used for distributing large amountsof data. In a BitTorrent system, a peer is typically a computer program that is activelyparticipating in sharing a file in the network. The context in which a BitTorrent contentdistribution session takes place is defined by a BitTorrent swarm which is the peer en-semble that participate in sharing a given file. A swarm consists of two types of peers:leechers and seeders. A seeder is a peer that has complete access to the distributed con-tent and is, thus, only uploading data. A leecher has incomplete access to distributed

2

Page 3: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

content and is both uploading and downloading. The BitTorrent negotiation protocoluses a form of tit-for-tat that forces peers to upload in order to download (though thishas been proven to be abused [17]) therefore ensuring fairness and rapid distribution. Aswarm is given birth by an initial seeder which is the peer sharing a file it has completeaccess to. The seeding/sharing process within a swarm is started through a metafile, a.torrent file, that defines swarm trackers and piece hashes to ensure content integrity.Typically, a peer uses a web server to download a .torrent file and then uses a BitTorrentclient to interpret it and take part into a swarm.

NextShare technologies use BitTorrent because of its efficiency that made it one ofthe most popular protocols for transferring large amounts of data. It is estimated that in2009 it was responsible with roughly 27% to 55% of all Internet traffic [15].

Classical BitTorrent protocol uses TCP for the communication between peers. µTorrentdeveloped a more appropriate protocol for this purpose over UDP, named µTP (MicroTransport Protocol), sometimes spelled uTP. Although the source code of its library waspublished, it is still a proprietary protocol, thus as a response, P2P-Next designed theswift protocol. In Section 5 more details are going to be given about this two protocols.

Typical terms for video handling like container, codec, frame rate, resolution andaspect ratio are going to be explained in Section 4. Also, details about the technologies,compression standards and libraries are going to be given in the same section.

2 Related Work

Video content is currently the dominating force in Internet traffic [15]. With BitTorrentand HTTP traffic dominating the Internet backbone, video traffic accounts for a largepart of that. Video streaming, the possibility of viewing video content while downloadingis the type of traffic with the largest increase, due to the advance of popular services suchas YouTube or Google Videos. Other services such as Vimeo allow streaming of highdefinition (HD) content.

Peer-to-Peer systems have begun incorporating streaming features since their incep-tion. Protocol updates such as Give-to-Get [?] have been specially designed to cope withthe particularities of both video streaming and Peer-to-Peer protocols. Multicast trees, se-quential reordering and other features have been deployed to allow Peer-to-Peer protocolsto incorporate video streaming.

Streaming may refer to other Video-on-Demand (VoD) or Live Streaming. Video-on-Demand refers to downloading and playing an existing video file. The entire file isstored on the host system. Clients will prioritize pieces that are closer to the currentposition but still request files that will be accessed later on. The existence of a Peer-to-Peer network for video streaming allows efficient use of existing bandwidth and increasesscalability. Live Streaming is distribution of live content, that is content generated inreal-time. The requirements for this kind of streaming are more stringent as it requiresrapid transmisition (low delay) of data that is generated in real-time and there is no“future” pieces that may be collected. Live streaming solutions have been incorporatedin the recent years. Magharei et. al [18] have provided a study of the advantages anddisadvantages of using meshes or multi-trees for live streaming.

This work is integrated in the EU FP7 P2P-Next project [10]. P2P-Next’s stated goalis building the next generation Peer-to-Peer content delivery platform. The core of theproject is the NextShare core, which is an updated and extended BitTorrent implementa-tion with incorporated streaming support. The actual implementations, running on top

3

Page 4: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

of the core are the NextShareTV implementation, deployed set-top boxes (STBs) andNextSharePC for general use on commodity hardware. NextShareTV is distributed asfirmware for specific STBs, while NextSharePC is usable as a stand-alone player or as abrowser plugin, also dubbed NextShare Plugin or SwarmPlugin. The NextShare techologyhas also been incorporated in several Wikipedia experiments [12].

One of the most well known streaming platform using P2P technology is Octoshape [9].Octoshape is used for delivery of HD content and has been used for several importantvideo events such as the US Election 2008 and the Eurovision Song Contest since 2006.Akamai Technologies, an imporant CDN (Content Delivery Network) has also developedinterest in using P2P technology for their clients [2].

Adobe has also improved its Flash technology with Peer-to-Peer support, in the form ofAdobe Cirrus or Adobe LiveCycle Collaboration Service [1]. With YouTube responsiblefor a large chunk of streaming traffic in the Internet and Flash player being the coretechnology it is expected that the P2P features of Flash will be deployed and usable inthe recent future.

3 Infrastructure

The current infrastructure is the actual Living Lab that is used as part of the WP8package in P2P-Next. It consists of commodity hardware systems running in the NCITCluster [8]. The hardware systems run seeders, trackers and store video and .torrent files.The Living Lab site allows interaction with users.

The UPB Living Lab [13] site consists of a CMS Made Simple installation that has beenupdated to accomodate the NextShare plugin, allowing users to render P2P technologyenabled video streams in a browser.

3.1 Hardware Infrastructure

We are using 10 commodity hardware systems in the NCIT cluster. These systems havebeen suitable for our needs, but we plan to make a switch to a KVM-based infrastructuredue to the flexibility it offers and the improved availability. Each system consists of thefollowing hardware components:

• SATA hard-disk, 300GB

• Intel Pentium 4 CPU 3.00GHz (dual-core)

• 2GB RAM

• two 1Gbit Ethernet interfaces

All connections are 1Gbit connections with Internet hosts as provided by the RoE-duNet infrastructure.

All systems are running the same operating system and basic application:

• Debian GNU/Linux 5.0 Lenny

• kernel: 2.6.26-2-openvz-amd64

• gcc 4.3.2

4

Page 5: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

• OpenSSH 5.1p1

Apart from updating video content, an important step we plan to undertake withrespect to the infrastructure is move it to a KVM-based environment on in the NCITcluster. The use of the current infrastructure for different experiments means we lack therunning continuity required for a presenting a service-like platform. The migration to aKVM-based infrastructure will ensure dedicated resilient systems and proper availability.

3.2 Software Infrastructure

The software infrastructure consists of the basic files and applications required for pro-viding content: publishing site, trackers, .torrent files and running clients (seeders).

The publishing site is the UPB Living Lab site allowing access to the NextShare pluginand video files.

A tracker is required for all video content to be served. Video content is embedded in.torrent files – metafiles used by the BitTorrent protocol. Seeders are usually NextShareimplementations running on top of the hardware infrastructure. As they need to berunning in background they are usually started with the help of the nohup command. Ascript that may be used for deploying .torrent files as seeders is the shown below:

#!/bin/bash

torrent_dir=/home/p2p/p2p-video-trial

pushd "$torrent_dir"

nohup btlaunchmany . >> btlaunchmany.log 2>&1 &

popd

4 Multimedia

4.1 Keywords

An audio-video container file is used to identify and interleave different multimedia datatypes, usually storing different audio, video and subtitle streams. One of the most popularcontainers is AVI (Audio Video Interleave), which was introduced by Microsoft and canmay carry audio/visual data in virtually any compression scheme. MP4 is MPEG-4 Part14, a multimedia container format standard, specified as a part of MPEG-4 and shouldnot be confused with MPEG-4. Ogg is a free, open standard container format maintainedby the Xiph.Org Foundation. The creators of the Ogg format state that it is unrestrictedby software patents and is designed to provide for efficient streaming and manipulationof high quality digital multimedia. In the Ogg multimedia framework, Theora providesa lossy video layer. The audio layer is most commonly provided by the music-orientedVorbis format but other options include the human speech compression codec Speex, thelossless audio compression codec FLAC, and OggPCM. The new HTML5 standard, whichis still published as a draft includes native video support, without any third-party plug-ins,for OGG and WebM containers. Google is sponsoring the WebM format which consistsof VP8 video and Vorbis audio streams.

To digitally represent audio signals, Pulse-code modulation (PCM) is used. Themagnitude of the analogue signal is sampled regularly at uniform intervals, with eachsample being quantized to the nearest value within a range of digital steps. A digitalaudio stream is characterized by sampling rate (sampling frequency), which is the

5

Page 6: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

number of times per second that samples are taken, and by bit depth, the number ofpossible digital values that each sample can take. A standard audio stream, used also foraudio CDs, has a sampling rate of 44.1 kHz with 16 bits per sample.

Video streams are usually characterized by the frame rate, display resolution and bitsper pixel. The frame rate or frame frequency (frames per second abbreviated asfps) is the number of still pictures per second for video. Typical values for this char-acteristic are between 25 and 30 fps. The display resolution is the size of a videoimage, which is measured in pixels for digital video, or horizontal scan lines and verticallines of resolution for analog video. Pixel aspect ratio (often abbreviated PAR) is amathematical ratio that describes how the width of a pixel in a digital image compares tothe height of that pixel. The aspect ratio or display aspect ratio (often abbreviatedDAR) of an image is the ratio of the width of the image to its height, expressed as twonumbers separated by a colon. The number of distinct colors that can be represented bya pixel depends on the number of bits per pixel (bpp), also known as color depth.Typically there are used 24 bits per pixel with 8 bits for each color component (red, greenand blue), achieving more than 16 million colors. There is an extension of this color depthfor images with 32 bits per pixel, which adds 8 extra bits for the alpha channel, whichsets pixel’s opacity. PNG images use this feature.

Video can be interlaced or progressive. Interlacing was invented as a way to achievegood visual quality within the limitations of a narrow bandwidth. The horizontal scanlines of each interlaced frame are numbered consecutively and partitioned into two fields:the odd field (upper field) consisting of the odd-numbered lines and the even field (lowerfield) consisting of the even-numbered lines. NTSC, PAL and SECAM are interlacedformats. Abbreviated video resolution specifications often include an i to indicate inter-lacing. For example, PAL video format is often specified as 576i50, where 576 indicatesthe vertical line resolution, i indicates interlacing, and 50 indicates 50 fields (half-frames)per second. Progressive or noninterlaced scanning is a method for displaying, storingor transmitting moving images in which all the lines of each frame are drawn in sequence.For this kind of scanning, the video resolution may include a p, like 1080p, which meansthat there are 1080 pixels on the height scanned progressively.

Recently the television image quality was extended in order to take advantage of thetechnological progress. The old television quality standard, including PAL (for Europe)and NTSC (for America) are now known as Standard-Definition television (SD orSDTV). It is usually used when broadcasting at the same (or similar) resolution as analogsystems, with an aspect ratio of 4:3 and a resolution of 480i (NTSC) or 576i (PAL).The newer extended quality standard is known as High-definition television (HDor HDTV) and refers to video having resolution substantially higher than traditionaltelevision systems. HDTV is usually specified as 720p/720i (HD), with a resolution of1280x720, or as 1080p/1080i (Full HD), with 1920x1080. The aspect ratio is typically16:9 for TVs, but computer monitors usually use 16:10 (8:5).

A codec is a computer program, usually a library, or a device which can encodeor decode a digital data stream. There are lossless codecs which reduce the stream sizewithout discarding information and lossy codec, which alter the quality in order to achievea smaller size. MPEG-4 is a collection of methods defining compression of audio andvisual (AV) digital data, in a set of standards developed by ISO/IEC. MPEG-4 Part2 (Visual) includes lossy codecs such as DivX, Xvid, Quicktime 6, Nero Digital andit is compatible with H.263. H.264/MPEG-4 Part 10 or AVC (Advanced VideoCoding) is a more performant video lossy compression standard from MPEG-4. HTML5

6

Page 7: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

currently supports two open video lossy compression formats: Theora, developed by theXiph.Org Foundation and VP8, released by Google. For the audio layer, Vorbis is usedby HTML5, which is also developed by Xiph.Org Foundation. The most popular audiolossy codec used today is MP3 (MPEG-1 or MPEG-2 Audio Layer 3 ). AAC (AdvancedAudio Coding), released under MPEG-4 Part 14, was designed to be the succesor of theMP3 format, generally achieving better sound quality at similar bit rates.

An audio/video stream is also characterized by its bit rate, which is the number ofbits necessary for coding one unit of time (second) of a stream. Some codecs support avariable bit rate.

4.2 Audio-Video Conversion

All audio-video handling that we have made was realized under the Linux environment,using command line tools, that offer the opportunity of integrating them into scripts forautomation.

For UPB Living Lab we are using as input videos from technical presentations, courses,conferences and social events from our university. They were shot with a Full HD camera,specified as 1080i. Although the resolution is 1440x1080, which defines an aspect ratio of4:3, the real aspect ratio is actually 16:9 because this is the PAR (pixel aspect ratio). Theraw movie stream loaded from the camera is packed into a .mts multimedia container,which is based on the MPEG-2 Transport Stream container format. The audio stream hasan AC-3 (Audio Coding 3, Dolby Digital) format, which permits the coding of 6 surroundchannels, with a sampling rate of 48 kHz (higher than the CD one, which is 44,1 kHz).The video stream has an H.264/AVC format, with low compression and a frame rate of25 fps. The overall bit rate of the raw stream is 3982 kilobits per second, which is quitebig, thus it needs compression in order to distribute the content over the Internet. Also,some of the movies need to be cut into peaces and others need to be joined together.

An useful command line tool that retrieves information about an audio/video file ismediainfo, from MediaInfo project [7]. It prints to the console all the informationneeded about the container, the audio stream and the video stream, like bit rate, format,duration, display resolution, aspect ratio, scan type, frame rate, audio sampling rate andbit rate etc.

We have made most of the multimedia handling with FFmpeg [4], a free open sourceproject that produces libraries and programs for handling multimedia data. It uses two im-portant libraries, libavcodec, an audio/video codec library used by several other projectsand libavformat, an audio/video container multiplexer and demultiplexer library. Thecommand line program used for transcoding that offers an interface to all of this compo-nents is ffmpeg.

UPB Living Lab trial site plays the videos with P2P-Next’s plugin NextShare Plugin,which is going to be detailed in Section 5. Because it uses VLC Player for renderingmovies, a lot of audio/video formats can be used. We have mainly used as containerAVI, OGG, WebM and MP4. Video streams were coded using H.264/AVC, Theora andGoogle’s VP8. Audio is coded as MP3, with the exception of the files which used OGGand WebM as container, which included Vorbis format, in order to test the video files alsowith HTML5.

During the transcoding, we needed to alter the display resolution from 1440x1080 to800x600 for example. We also had to change the audio sampling rate from the professional48 kHz to the standard 44,1 kHz.

7

Page 8: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

The conversion to different kind of containers and audio/video formats is made byffmpeg with the aid of libraries. Video format H.264/AVC needs for coding the librarylibx264, Theora needs libtheora and VP8, libvpx. For audio coding libmp3lame is neededfor MP3 format and libvorbis, for Vorbis.

The following line is an example of transcoding a raw .mts file taken from the camerato an AVI audio/video file, including an MP3 audio stream and an H.264/AVC videostream:

ffmpeg -i in.mts -f avi -acodec libmp3lame -ab 256k -ar 44100 -ac 2

-vcodec libx264 -vpre normal -b 1400k -r 25 -threads 0 out.avi

Argument -i establishes the input in.mts file, while the last argument is the outputout.avi file. AVI container format is set with -f parameter, MP3 audio coder with -acodec,which selects libmp3lame library. The video coder is set with -vcodec, that set libx264library. The bit rates for audio and video are set respectively with -ab and -b. The audioneeds to be resampled from 48 kHz to 44,1 kHz, with -ar 44100 and the 6 surroundchannels need to be mapped to two stereo channels, -ac 2. The video frate rate is set to25 (remains the same) with -r 25.

We have written a series of scripts to automate the process of conversion, includingones which automatically transcodes all our video raw files to specific formats requiredfor testing.

5 Technologies

5.1 Keywords

P2P-Next’s NextShare platform implements its core functionality into NextShareCore,that is written in Python scripting language. Thus, a PC or STB needs a Pythoninterpreter.

As it was said in the introduction of this article, NextShare uses BitTorrent P2Ptechnology, which is integrated into NextShareCore.

Instead of using a TCP connection between peers, like in the classical BitTorrentimplementation, NextShare uses swift. Similar to swift is µTP or uTP, developed byµTorrent. They recently published the source code of its library, so that other BitTorrentclients could implement it. However the is still under their’s license, thus P2P-Next, whichuses free and open-source code, decided to create swift protocol. Both swift and µTP areimplemented over UDP transport protocol.

µTP is designed to provide reliable, ordered delivery while maintaining minimumextra delay, aiming to provide a better performance that the more general TCP protocol.It is actually a TCP-like implementation of LEDBAT (Low Extra Delay BackgroundTransport) [6], documented as a BitTorrent extension of BEP-29 [3]. The LEDBAT scopeis to standardize a congestion control mechanism that should saturate the bottleneck,maintain low delay, and yield to standard TCP. µTP is the primary transport for µTorrentP2P connections.

Swift, the multiparty transport protocol is also known as BitTorrent at the transportlayer. Like µTP, it does not use the ordered data stream abstraction, used in TCP. Apeer splits files into 1KB packets and sends them to the other peer, using Merkle hashtrees and binmaps.

8

Page 9: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

The video rendering in a PC browser using NextShare can be done with two types ofplugins. SwarmPlugin uses VLC Player libraries to render the video and SwarmPlayeruses HTML5 for that.

W3C (The World Wide Web Consortium) is working to a new HTML standard, knownas HTML5 [5], which extends the facilities of HTML4 and XHTML. One of its purposesis also to integrate native video support into HTML, without the need of RIA (RichInternet Application) plugins, such as Adobe Flash Player, Microsoft Silverlight or OracleJavaFX. The current HTML5 draft specification [5], does not specify the video formatsthe browsers should support, however the HTML5 Working Group consider it desirableto specify at least one video format which all browsers should support. Internet Explorerdoes not support HTML5 yet, but the other popular browsers, Mozilla Firefox, GoogleChrome and Opera support it. The current playable formats via HTML5 are Ogg Theora,with Theora video and Vorbis audio, and Google’s WebM which includes VP8 video andVorbis audio.

So the lack of support for HTML5 in Internet Explorer and the fact that HTML5 isstill a draft specification, determined P2P-Next to implement NextShare into browsersalso with VLC, not only with HTML5.

VLC media player [14], written by the VideoLAN project is a free and open sourcecross-platform multimedia player and framework. SwarmPlugin uses its libraries to rendervideo currently in Internet Explorer or Mozilla Firefox, but only under Windows. Thebig advantage is the fact that a lot of audio-video formats are supported. Basically, allformats supported by VLC media player are also supported in the SwarmPlugin.

On the other hand, SwarmPlayer uses HTML5 for rendering, so only Ogg Theoraand WebM are supported. SwarmPlayer was previously known as SwarmTransport. InFigure 1 the architecture of the SwarmTransport is presented. Components in yelloware implemented in Python, components in red are implemented in C or C++, andcomponents in green are implemented in JavaScript. The SwarmTransport consists oftwo major parts: the browser plugin itself, running in the browser’s address space, shownon the right in Figure 1, and the Next Share Agent (NSSA) running on Python, shownon the left in Figure 1.

5.2 Technologies Evaluation

The Living Lab site [13] links various video files that may be played back through theNextSharePlugin. Video files have a variable length from 3 to 30 minutes from socialevents and technical presentation in the local university. Some of them are in HD andothers, used for testing and evaluation have 800x600 resolution. During the last twomonths multiple events have been filmed and will be published through the local LivingLab portal. The site links the most recent version of the SwarmPlugin (Internet Explorerand Firefox) for user download.

We have taken a medium-sized user-centric experiment for evaluating the NextSharetechnology and user satisfaction described in Section 6. The Living Lab site was the centerof the experiment: it provided the interface for downloading the SwarmPlugin, linkingvideo files, publishing the feedback form and providing support through the forum.

As playback problems were encountered during the user-centric experiment we decidedto focus our efforts on analysing video playback when dealing with different files both in astandalone player and in the NextSharePlugin. Having direct access to the original .mtsfiles, we converted them to different formats (containers and codecs) and observe their

9

Page 10: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

Figure 1: Architecture of the SwarmTransport

behavior. As somewhat expected, there were issues with playback both in the VLC playerand the SwarmPlugin, as decribed in the Table 1. We used ffmpeg and related tools andtested H.264 and Theora codecs on AVI, MTS and OGG containers.

All tests described as lines in Table 1, have been made on video files transcoded fromthe same original .mts file, which has 46 minutes. A part of the transcoded files are cut,in order to have a smaller duration. We varied the bit rate using 1400 kbps, 1050 kbps,700 kbps and 350 kbps, the display resolution using 1440x1080 (Full HD) and 800x600(roughly SD quality). Some of the file were transcoded with 30 fps, instead of 25 fps.The last characteristic variated was the format. The videos marked as AVI, contain MP3audio and H.264/AVC video. Those with an Ogg container include Vorbis audio andTheora video and WebM, contain VP8 video and Vorbis audio. All file have a 256 kbpsfor the audio stream.

As it can be observed from table, both VLC media player and SwarmPlugin could notplay videos with 30 fps. For files with 25 fps the playback worked in VLC media playerboth in Windows and Linux, but with SwarmPlugin worked just for videos with a framerate below and including 700 kbps. Although this could be a good bit rate for standarddefinition videos, for full high definition it is not satisfiable.

At this point, our conclusion is that the SwarmPlugin has issues with the bitrate. Ascan be seen, a high enough bitrate means the video doesn’t work. Some of the time (non-deterministic) playback in VLC would also not work. There may be something wrongwith our video files but the plugin definitively has its problems.

We will do more testing to investigate whether the bitrate is solely responsible forthis issue and whether that is because of the NextShare plugin implementation, the VLCimplementation or the video file format (codec, container).

Due to our discovery of problems regarding bitrate variation influencing quality (orfunctionality) of video playback, we are considering the possibility of providing the enduser with multiple versions of the same video file: different resolution, different bitrate,

10

Page 11: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

Duration Bitrate Resolution Framerate Format Plugin VLC VLC(minutes) (kbps) (fps) (Win) (Win) (Lin)

3 350 800x600 25 AVI Yes Yes Yes3 350 800x600 25 OGG Yes Yes Yes3 700 800x600 25 AVI Yes Yes Yes3 700 1440x1080 25 AVI Yes Yes Yes3 1050 800x600 25 AVI No Yes Yes3 1050 1440x1080 25 AVI No Yes Yes3 1400 800x600 25 AVI No Yes Yes3 1400 800x600 25 OGG No Yes Yes3 1400 1440x1080 25 AVI No Yes Yes3 1400 1440x1080 25 OGG No Yes Yes3 3857 1440x1080 25 MTS N/A Yes Yes

46 1400 1440x1080 25 AVI No Yes Yes46 1400 1440x1080 25 OGG No Yes Yes5 1400 1440x1080 30 AVI No No No5 1400 1440x1080 30 OGG No Yes Yes5 1400 1440x1080 30 WebM doesn’t start Yes Yes5 3857 1440x1080 25 MTS No Yes Yes

Table 1: Video Files Testing

different codec, different container. That would imply some disparate statistics but mayprovide the user with better quality of experience when using a “less demanding” videofile.

6 User-centric Experiments

During December (30th of November to 20th of December) we have undertaken a medium-sized experiment for evaluating the NextShare technology and user satisfaction. TheLiving Lab site was the center of the experiment: it provided the interface for downloadthe NextShare plugin, linking video files, publishing the feedback form and providingsupport through the forum.

Users were mostly students at the University Politehnica of Bucharest.In order to collect information regarding the problems we enabled an FTP upload

form to allow users to provide us their log files.

6.1 Experimental Setup

The experiment used the infrastructure described in Section 3.The Living Lab site links various video files that may be played back through the

NextShare plugin. Video files are HD files with variable length (3 to 30 minutes) fromsocial events and technical presentation in the local university. During the last two monthsmultiple events have been filmed and will be published through the local Living Lab portal.The site links recent version of the NextShare plugin (Internet Explorer and Firefox) foruser download.

11

Page 12: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

Video files are HD content. They are encoded using H264 and use the AVI container.Each file is incorporated into a .torrent file and provided to users on the Living Labsite.

Users were also allowed to access a support forum where we could provide them withanswers and suggestions.

6.2 Experimental Results

A total number of 54 users completed the feedback form. The feedback consisted of thefollowing questions:

1. Did you have any problems during the installation?

2. Did you successfully install the SwarmPlugin?

3. In case of problems, what were the issues you encountered?

4. How would you classify the quality of the video playback?

5. How would you classify the plugin’s interface?

6. What was the average download speed?

7. What OS are you running?

8. What browser did you use for testing the SwarmPlugin?

9. What version of the browser are you running?

10. What are your computer hardware specifications?

11. What is your external IP network address?

12. What videos did you watch?

13. Do you have any comments, remarks or suggestions?

A brief of the results in the feedback:

• 13 users had problems installing the plugin and most of them were unable to properlystart the playback;

• video playback was deemed mediocre (a score of 2.4 out of 5); some may be due tothe problems in installing the plugin;

• the plugin interface

• most users used the Firefox version of the Plugin;

• users were using high bandwidth connections (> 512KB/s) or fairly good ones (>50KB/s, < 100KB/s);

• video freezing and the lack of a seek and volume bar were among the most significantremarks.

12

Page 13: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

The most important issues were problems during the installation and poor video play-back (freezing).

A similar experiment would need to provide proper video content (if the problem isfrom video files), a properly working version of the NextShare plugin and a seek bar onthe playback interface. As such, the most stringent issue deals with playback problemsin the NextShare player for a diversity of video files. Through the video testing we havediscovered that, past a certain bitrate threshold, video playback in the NextShare pluginis either flawed (freezes) or not functional.

7 Conclusion and Future Work

We have presented our work regarding video streaming and performance evaluation usingPeer-to-Peer technology. With major Internet content providers such as Akamai, Oc-toshare and Adobe Flash Player considering the use of Peer-to-Peer technology and aspart of the P2P-Next project.

We have investigated the diversity of characteristics of video files and the deploymentof video files in the UPB Living Lab site. The site uses P2P-Next’s NextShare technologyin the form of a browser plugin. During both test and live trials we have collectedinformation regarding technical aspects of the implementation and user experience. Wehave pulled out several issues which we are going to address in the next period.

Our current goals revolve around the generic objective of providing feedback andbug reports, measure user satisfaction and promote NextShare technology and theparticular objective and comparing classical P2P/BitTorrent distribution against P2P-based video streaming, such as provided by NextShare.

We aim to use status information such as peer download speed, peer upload speed,number of connections and extensive information (usually provided through verbose log-ging) such as protocol messages, protcol inner workings, piece picker algorithm (pieceselection) to compare and analyse classical (pure BitTorrent-based data distribution) tovideo streaming (through NextShare technology). We aim to distinguish among the var-ious patterns employed by each type of distribution, measuring variation/penalty in per-formance and identify weak and strong spots in each of the approaches.

There are two kinds of experiments we are considering:

1. public experiments: designed to run “in the wild”, using the Living Lab site andrequesting feedback from users;

2. lab experiments: designed to run in a closed environment at University Po-litehnica of Bucharest, with the ability to be fully under the control of the ex-perimenter.

References

[1] Adobe P2P. http://www.adobe.com/devnet/flashmediaserver/articles/p2p apps cir-rus lccs.html.

[2] Akamai. http://seekingalpha.com/article/127949-akamai-technologies-getting-serious-about-p2p.

[3] BEP-29. http://www.bittorrent.org/beps/bep 0029.html.

13

Page 14: Using P2P Technologies for Providing Video Streaming (February 2011 Report)

[4] FFmpeg. http://www.ffmpeg.org/.

[5] HTML5 Draft Specification. http://dev.w3.org/html5/spec/Overview.html.

[6] LEDBAT (Low Extra Delay Background Transport).http://datatracker.ietf.org/wg/ledbat/charter/.

[7] MediaInfo. http://mediainfo.sourceforge.net/.

[8] NCIT Cluster. http://cluster.ncit.pub.ro/.

[9] Octoshape. http://octoshape.com/.

[10] P2P-Next. http://www.p2p-next.org/.

[11] Peer-to-Peer. http://en.wikipedia.org/wiki/Peer-to-peer.

[12] Tribler on Wikipedia.

[13] UPB Living Lab Site. http://p2p-next.cs.pub.ro/.

[14] VLC media player. http://www.videolan.org/vlc/.

[15] ipoque Internet studies. http://www.ipoque.com/resources/internet-studies/internet-study-2008 2009, 2009.

[16] R. Deaconescu, G. Milescu, B. Aurelian, R. Rughinis, , and N. T, apus, . A Virtual-ized Infrastructure for Automated BitTorrent Performance Testing and Evaluation.Internation Journal on Advances in Systems and Measurements, 2(2&3):236–247,2009.

[17] T. Locher, P. Moor, S. Schmid, and R. Wattenhofer. Free Riding in BitTorrent isCheap. HotNets, 2006.

[18] N. Magharei and R. Rejaie. Mesh or multiple-tree: A comparative study of livep2p streaming approaches. In in INFOCOM 2007, Anchorage, Alaska,6-12, pages1424–1432, 2007.

14