streaming media

Download Streaming  Media

Post on 25-Jan-2016




3 download

Embed Size (px)


Streaming Media. Daniel Johnson. What is it?. What is it?. Playing a media file stored on a remote server on a local client. Examples. iTunes Shared Libraries Google Video, youTube, etc. How does it work?. How does it work?. True Streaming Progressive Streaming or Pseudo-streaming. - PowerPoint PPT Presentation


  • Daniel Johnson

  • Playing a media file stored on a remote server on a local client

  • iTunes Shared Libraries

    Google Video, youTube, etc.

  • True Streaming

    Progressive Streaming or Pseudo-streaming

  • BenefitsCounter piracyFiles stay on the serverNo need for DRMYou can start playing anywhere in the file

  • CostsExpensiveRequires a streaming serverPoor qualityDelayJitterLow resolution

  • ProtocolsRTP Real-time Transport ProtocolRTCP - Real-time Transport Control ProtocolRTSP Real-Time Streaming Protocol(All of the above come in a Secure variety)RDT Real Data Transport (proprietary Real Networks)DAAP Digital Audio Access Protocol (proprietary Apple Inc.)SCTP Stream Control Transport Protocol

  • Control is a bit of a misnomer:Doesnt actually control the streamUsed to gather data about the RTP streambytes sentpackets sentlost packetsJitterFeedbackRound trip delayData can be used by apps to control flow and achieve a better, more consistent stream

  • Similar to HTTP, but with modified/additional commands to facilitate streaming mediaBuilt to be Transport layer independent:TCPUDPSCTPRTP (most common)Header is similar to HTTP/1.1

  • Bits012-678-1617-23242526-310LIF1SIDIRSeq. #BBPSDASM Rule32Timestamp64Reliable Seq. #Data

  • Most widely used true streaming protocol because of the popularity of iTunesCreated by Apple as a proprietary protocol introduced with iTunes 4Reverse engineered and became open sourceApple reasserts ownership with v. 7Poorly documented

  • Referred to as multi-streamingBased on the PSTN message delivery conceptAllows multiple source and destination hostsKeeps much of the reliability of TCP, without the restrictions because its basic unit is a full message instead of a byte

  • Bits0 78 1516 2324 310Source portDestination port32Verification tag64Checksum96Chunk 1 typeChunk 1 flagsChunk 1 length128Chunk 1 dataChunk N typeChunk N flagsChunk N lengthChunk N data

  • BenefitsCheapBuilt on existing internet technologyUses standard web serverNo new protocol implementations requiredMuch better quality (potentially)

  • CostsFile must be downloaded to client HDD (easy to pirate)Cant (technically) navigate file

  • Uses HTTP (sometimes FTP) to send file to client HDDMost clients begin playing the file before the get all of itSpeeds up playbackIf theres a problem, playback stops completelySpeed is determined by total size of fileBetter quality requires waiting longer, and visa versa

  • True StreamingProgressive StreamingExpensive requires a special serverFastControllableProtected

    Cheap dont need anything newSlow(er)Must start from the beginningOpen

  • iTunes Shared Libraries

    Google Video, youTube, etc.

  • The right compression (codecs)

    The right resolution

  • Not all codecs work for streamingStreaming codecs should allowhigh compressionplayback of incomplete filesExample: MPEG-1

  • Originally video decoding was done with special hardware based on TV decodingRectangular pixelsCropped the sidesResult was an optimal resolution of 352x240Software decoders didnt bother with this

  • The Result

  • The other predominant influence on internet video was video conferencingGoals:conserve bandwidthStill look goodThe result was settling on 176x144Most software decoders dont worry about this either

  • The Result

  • Most software decoders ignore the format flag in the encodingA lot of encoders had either the TV format or the video conferencing format as their default resolution (this has mostly been corrected)Lots of videos made early on were stretched or squished

  • I do not like it on ABC, I do not like it on MTV. I would not, could not on CNN, I would not, could not on ESPN. It can't be 176x144, Bill G. Because then it isn't 4:3!*

    Use a 4:3 Aspect ratio for you web videos!

    True Streaming the client controls the play across the networkProgressive Streaming the client downloads the file, and plays it locally*RTP and RDT are data protocolsRTCP and RTSP are control protocols which usually dont transport dataDAAP is technically proprietary, and the newest version (7.0) is, but the older versions are also available in an open source variety.SCTP is the only Transport layer protocol, all the others are Application layer

    *P Padding (generally only used when encryption is involved)X is the header extended or not (does it have more than one CSRCsCC number of CSRCs that are includedM Marker depended on the profile specified by the App that is using it.PT Payload Type specifies what sort of data the packet is carrying (see for types of PTs)(the M and PT bits are mutable an app may say in its profile that it want more markers and less PTs)SSRC Synchronization sourceCSRC Contributing Source

    The really important thing here is that the protocol allows multiple sources added reliability and quality (in theory)*The header for RTCP is uninteresting (it only tells you how much and what sort of data you are sending), but it can be found at*SETUP, DESCRIBE, ANNOUNCE, GET_PARAMETER, SET_PARAMETER, OPTIONS, PLAY, PAUSE, RECORD, REDIRECT, TEARDOWNRTP is actually an app layer protocol, so when that is used, your stack has a true app. layer, a pseudo-app./trans. layer, then the true trans. layer*Built on UDP

    LIF Length Include Flag set if there is more than one packet within the UDP datagramBit 1 is always 1 (need reliable always true)SID Stream IDIR Is Reliable flagBBP Back-to-Back Packet used for timing issuesSD Slow Data Flag not currently usedASM Algorithmic State Machine rules which rules does this stream follow allows the client to only grab streams its available bandwidth and such can handle

    The NAK and ACK headers are slightly different: NAK :: 0-23 = 0x40ff02 | 24-4 = SID | 41-55 = Seq # | 56-71 = bit count | 72-79 = map lengthACK :: 0-23 = 0x00ff02 (almost always) | [24-4 = SID | 41-55 = Seq # | 56-71 = bit count | 72-79 = map length | 80-(?) bit field] (repeat the [] for each stream in the sequenceIn both cases, bit 1 is the loss bit which is always 1 for a NAK, and almost always a 0 for and ACK (hence the static values for the first 24 bits)*Apple reasserted its control over it with the release of v. 7 which now requires a client ID in the header In spite of its popularity and long standing, there is shotty documentation at best, at that is all from the open source variety.

    *Public Switched Telephone NetworkWith TCP, multi-streaming would require multiplexing, and even then, if one of the streams lost a packet, all of them would be halted until the one packet was found causing unnecessary delay on other streams**Depending on the codec, you may be able to navigate through everything that has already been downloaded*Many common codecs wont actually work. Example: avi, divx, etc. dont allow playback of incomplete files*352x240 has an aspect ratio of 4:3.73*Picture from,1697,1153900,00.asp*176x144 has an aspect ratio of 4:3.27*Picture from,1697,1153914,00.asp*The format flag is set by an encoder to say its in TV format, video conferencing format, normal format, etc.As of the printing of the article (October 2001) only QuickTime checked the format flag, and composated depending on how it was set Windows Media Player and Real Player did not. This was WMP v. 7 however, so this may have been corrected by now, since were on v. 11