Upgrade to Pro — share decks privately, control downloads, hide ads and more …

This Old Video Site How PBS streams video - and...

PyCon 2013
March 15, 2013
930

This Old Video Site How PBS streams video - and you can too! by Edgar Roman

Overview of how the Public Broadcasting Service streams video online. Learn how PBS uses video and other services to provide video streaming online. Talk will discuss lessons learned, explanation of video formats, and experiences with mobile device support. Talk will include recommendations for others to easily adopt similar practices to quickly host their own online video site.

PyCon 2013

March 15, 2013
Tweet

Transcript

  1. This Old Video Site: How PBS streams video - and

    you can too! Edgar Román PyCon 2013
  2. PBS Digital • We are the online division of the

    Public Broadcasting Service • We stream millions videos for both pbs.org and pbskids.org • Our core projects and video CMS are python based This talk focuses on streaming video, not python And streaming video in 2013… Disclaimer: Reference herein to any specific commercial products, or services does not necessarily imply its endorsement, recommendation, or favoring by the Public Broadcasting Service
  3. Online Video Goal One of our goals at PBSd is

    to make PBS video accessible everywhere, by everyone This goal affects how we stream video, and your goals will affect how you stream online video
  4. Video Formats • 1994 - MPEG-2 – Used by Digital

    Television and DVD – Lossless format, big files • 2003 - MPEG-4 with H.264 (AVC) – MPEG-4 is the container format and H.264 is the video codec – Lossy format, much smaller files – More complex to decode • Ogg Vorbis/WebM VP8/Other – Now you’re in the niche video formats – Great if you can narrow your audience
  5. MPEG-4 with H.264 • Success driven by broad support –

    Flash support since 9.115 – SilverLight, Windows, Xbox, PS3, Android, iOS • Excellent compression • Huge number of options – Standard Profiles: Baseline vs Main vs High • But there is a shadow over H.264 – MPEG-LA licensing fees – ‘Free to end users’
  6. Video Streaming • HTTP – Good ol’ progressive download •

    RTMP – Proprietary from Adobe • HTTP Live Streaming (HLS) • Others – RTSP – MS Smooth Streaming – HTTP Dynamic Streaming – DASH
  7. Video Playback • Player Requirements – Plays Ads – Closed

    Captioning Support – Customizable (Twitter, Facebook, Buy DVD / iTunes) • Using combinations of many players – Open Source Media Framework (OSMF) – Custom HTML5 framework – Native players on mobile devices
  8. How to get started with video • First Target: Desktop

    browsers – Picked MPEG4/H.264 to lower file size – MP4 main profile – Delivery via RTMP – Broad support in Flash players – Started with 400Kbps in 2009 – Expectation now is in range of 800Kbps to 1.2Mbps
  9. Mobile Devices • Apple’s iOS – No Flash – HTTP

    Live Streaming (HLS) – Auto bitrate adjust possible – Any old CDN will do – Built-in player • Android – MP4 Baseline via HTTP Progressive download – Later versions of Android support HLS • Capability Detection on app servers
  10. S3 Amazon Cloudfront CDN Includes Flash Media Server for delivery

    via RTMP Plain old CDN serving HTTP files iPhone iPhone HLS Encoded
  11. S3 Amazon Cloudfront CDN Includes Flash Media Server for delivery

    via RTMP Plain old CDN serving HTTP files iPhone iPhone Droid MP4 Baseline
  12. HTML5 <video> tag • Allows browser to have native video

    support • Basic <video> tag is great, but lacks frills to match rich Flash environment • HTML5 frameworks out there: – VideoJS – MediaElement – JWPlayer • If you need Flash-like flexibility in HTML5, be prepared for disappointment – Ad serving – Captions – Video Codec support
  13. Transcoding • Act of converting one video format to another

    • Useful Tools • At PBS we start with a high-resolution 5 Mbps mp4 file • From this we create 16 streams http://to.pbs.org/video-specs Local Machine Online Services ffmpeg zencoder x264 Encoding.com Handbrake
  14. Editor Uploads Mezzanine File with caption file Store Original File

    in Archive and send to Transcoding Service Stage files on CDN Origin Server and register streams in CMS Django site determines client video capabilities and renders links
  15. Haxors stealing my stuff • Tough challenge – see ‘analog

    loophole’ • PBS offers many videos for free streaming online so motivation to steal is low • Your circumstances might be different • Beware the DRM Graveyard – http://opensource.com/life/12/7/drm-graveyard- brief-history-digital-rights-management-video- film-and-tv
  16. More Info • Waggoner, Ben. Compression for Great Video and

    Audio. Focal Press. © 2010. • PBS Video Specs: http://to.pbs.org/video-specs • https://github.com/pbs/pycaption • This presentation available at: http://to.pbs.org/pycon2013