© De Montfort University, Designing streaming applications Howell Istance School of Computing De Montfort University
© De Montfort University, Steps in producing a streaming presentation Decide how to deliver clips Choose clip types and gather production tools Develop a bandwidth strategy Organise the presentation timeline Create the clips See Chapter 2 : Real System Production Guide
© De Montfort University, Download vs. streaming Download – complete file is transferred to client before playback begins Pseudo-streaming (aka HTTP streaming) – playback begins when ‘enough’ data has arrived at the client – when the time required to download the rest of the clip is equal to the duration (playtime) of the entire clip True streaming – frames played as they arrive and are not stored on client – may use small buffer to remove jitter
© De Montfort University, Pseudo-streaming time (figure from Chapman & Chapman page 341) download play start playing
© De Montfort University, Download from a web server - advantages Simple and cost effective for small clips – small scale broadcasting to a small number of simultaneous listeners No additional management overhead or cost of installing streaming server software Simple to set up MIME types on host server –Audio/x-pn-realaudio – for.ra,.ram,.rm extensions –Audio/x-pn-realaudio-plugin for.rpm extensions
© De Montfort University, Download from a web server - disadvantages Not suited to high volume sites serving large numbers of simultaneous users No automatic detection of a user modem speed –instead files optimised for different connect speeds/data rates have to be made available for the user to select from No support for live streaming, complete encoded file has to be present on the web server. No protection against saving the downloaded file on the client (copyright issue)
© De Montfort University, Download from a web server – more disadvantages Less possibility to keep audio and video synchronised Not possible to use internal timings from a clip, new clip has to be produced instead (cf smil clip-begin and clip- end ) No fast forward – move the slider forward, download continues as normal, playback resumes when slider position reached
© De Montfort University, Develop a bandwidth strategy Presentations stream at a particular rate (Kbps) Bandwidth of a users connection to a network determines (in part) how fast data can be received –E.g. users with a 28.8 Kbps modem can only view presentations which stream at less than 28.8 Kbps Presentations which stream at a faster rate may stall as data can not get over connection fast enough to keep the presentation flowing Strategy involves planning which level of compression to use and how clips are organised on the presentations timeline to avoid high delivery bandwidth bottlenecks
© De Montfort University, Data rates and connection speeds Server streams data at a rate determined by how a clip is encoded, and by how many clips requested by Player simultaneously
© De Montfort University, Buffering Data streams into a (small) buffer on the client side and out of the buffer to the player Helps to ensure that lapses of available bandwidth do not stall the presentation Each clip has to have initial data for several seconds of playtime before play commences (pre-roll) Developing clips that use appropriate bandwidth keeps pre-roll to an acceptable level RealProducer sets low pre-roll for audio and video clips Can also use elements in SMIL to force early pre- roll
© De Montfort University, Buffering Re-buffering required when data has stopped coming in and the buffer is empty Sometimes unavoidable – when available connection bandwidth drops for too long Choose appropriate data rate for target audience Objective to minimise pre-roll and eliminate re- buffering
© De Montfort University, Choosing a data rate Important not to consume all available bandwidth, –over heads for network transmission, –data rates not determined only by speed of connection of the user to the network RealSystems recommend calculating maximum streaming data rate as –75% of connection bandwidth for analogue (dialup) links –90% of connection bandwidth for high speed digital links Data Rates for each clip determined by encoding
© De Montfort University, Connection bandwidth and data rates Target audience Maximum Streaming Rate 14.4 Kbps modem 10 Kbps 28.8 Kbps modem 20 Kbps 56 Kbps modem 34 Kbps 64 Kbps ISDN 45 Kbps 112 Kbps dual ISDN 80 Kbps Corporate LAN 150 Kbps 256 Kbps DSL/cable modem 225 Kbps 384 Kbps DSL/cable modem 350 Kbps 512 Kbps DSL/cable modem 450 Kbps
© De Montfort University, Multiclip presentations… For Multiclip presentations, add the data rates of clips to be presented simultaneously together E.g RealPix and RealAudio streaming at 12 and 8 Kbps can be played together over 28.8 Kbps modems (aggregate data rate = 20 Kbps) …. But if they stream at 12 and 16 Kbps (aggregate data rate = 28 Kbps) – no bandwidth left for overhead, frequent re-buffering likely to result
© De Montfort University, Clip bandwidth characteristics RealAudio and RealVideo enables selection of target connection Flash streams well as low bandwidths, but the lower the bandwidth then fewer items in the animated scene – tools available to tune Flash to stream at a specific bit rate RealText and SMIL – plain text, little effect on bandwidth Images (jpg, gif, png) stream at 12 Kbps
© De Montfort University, Reaching multiple audiences RealSystem provides Surestream technology that creates a single clip that single different audience bandwidths if available bandwidth drops then RealServer automatically streams at a lower data rate – original rate resumed when bandwidth resumed
© De Montfort University, Reaching multiple audiences Alternative, create separate clips and use a switch statement in SMIL and the ‘system-bitrate’ variable <video src=“fullsizemovie.mov” system-bitrate=“56000” type=“video/quicktime”/> <video src=“halfsizemovie.mov” system-bitrate=“28800” type=“video/quicktime”/>
© De Montfort University, Single stream and SureStream files Original.wav – 10,017 K Surestream28only.rm – 507 K Surestream56only.rm – 753 K Surestream28and56.rm – 747 K Singlestream28only.rm – 151 K Singlestream56only.rm – 240 K
© De Montfort University, Organise presentation timeline Group and sequence clips so as not to overload connection bandwidth and thereby cause re-buffering Put low bandwidth clips in places such that the bandwidth left over can be used to pre-roll higher bandwidth clips that come next - Start presentations with low bandwidth clips (e.g text credits) Avoid putting two high bandwidth clips is parallel, combine high bandwidth clips with low bandwidth ones instead Stagger start time for clips so that RealServer does not need to send more than one clips pre-roll at a time. Test presentations in “real world”
© De Montfort University, Poor example of timeline RealVideo and RealPix clips play together exceeding connection bandwidth Second RealVideo clips starts before second one is finished
© De Montfort University, Better example of timeline Start with low bandwidth RealText xclip which does not interfer with streaming of images in the RealPix clip RealVideo starts after RealPix has streamed all of its images Second RealVideo clip does not start until first has finished