HTTP Dynamic Streaming

I’d like to demo HTTP Dynamic Streaming for you….

Benefits:

  • * Adaptive bitrate – will seamlessly switch between streams depending on your flexing bandwidth conditions.
  • * Jump point navigation – can jump to any point in the movie instantly.
  • * Only download what you watch, only holds a small amount of buffer at a time. This saves on bandwidth charges.

I’m going to point it to this URL:

http://zeridemo-f.akamaihd.net/content/robinhood/robin_hood_25fps_3000-2.f4m


So, what’s going on here? It’s not really a steady stream of video, although the intent is to keep the video playing.

Here is a graphic from Adobe’s site that helps to illustrate it:

The player, after fetching the f4m file, downloads the first segment’s Fragment #1, then #2, then #3, and if your bandwidth changes, it’ll simply switch to downloading one that is a lower bitrate.

I recorded with TamperData to illustrate what the player is doing behind the scenes. Notice the first one has a 2400 in it, then a 600, then 1800, then 3000, etc.. At first, it detected I needed the 600 Kbps bitrate movie, then decided 1800 Kbps was ok, then 3000 Kbps. They actually have files from 200 Kbps all the way up to 3000 Kbps, and the player will dynamically switch between them, seamlessly, for continuous playback adjusting to flexing bandwidth conditions! It also allows for jump point navigation, so you don’t download what you don’t watch, can just jump ahead to any point in the movie.

To take this a step further, I grabbed a video from bobparsons.me, made a low (200), medium (500) and high (1500) cut. Unfortunately, I don’t have a CDN to host this on at the moment, so I’m going to just host it here on my VDED server in Phoenix.

In order to get this to work, I did this:

1. Made 3 .mp4 files using the H.264 codec and AAC audio (for compatibility with iPad and Flash simultaneously) called:
38_640x352_200Kbps.mp4
38_640x352_500Kbps.mp4
38_640x352_1500Kbps.mp4

2. Used the VOD file packager to prep the files, like this:

./f4fpackager --input=38_640x352_200Kbps.mp4 --bitrate=200
 ./f4fpackager --input=38_640x352_500Kbps.mp4 --manifest-file=38_640x352_200Kbps.f4m --bitrate=500
 ./f4fpackager --input=38_640x352_1500Kbps.mp4 --manifest-file=38_640x352_500Kbps.f4m --bitrate=1500

3. That made a bunch of files. I made a new DIR on my server, /www/vod, and moved the files it created there.

4. Installed the HTTP Origin Module for Apache 2.2 by dropping the files I got from Adobe for free into my /etc/httpd/modules/ folder, and I created a /etc/httpd/conf.d/f4f.conf file that looks like this:

LoadModule f4fhttp_module modules/mod_f4fhttp.so

Alias /vod /www/vod
<Directory /www/vod>
    Options -Indexes
    AllowOverride All
</Directory>

<Location /vod> 
    HttpStreamingEnabled true 
    HttpStreamingContentPath "/www/vod" 
</Location>

5. Restarted Apache

6. I grabbed a copy of the Strobe Media Player, put it in view of my browser, pointed to it’s setup page at http://www.koopman.me/bob3/setup.html and put in the URL http://www.koopman.me/vod/38_640x352_1500Kbps.f4m, set the width and height to 640×388, set controlBarAutoHide to false (cause I like it that way) and clicked Preview and Update. It gives me the object code to embed.

What’s going on here? Pretty much the same thing as the Robin Hood video, except I only have 3 bitrates and I am serving the file fragments from my server, instead of Akamai CDN. To make this better, I should have 6 bitrates and should be using Akamai’s HD Network solution to host the file fragments on CDN.

79 thoughts on “HTTP Dynamic Streaming

  1. Ah, excellent question. Here’s the thing
    When this is run:

    ./f4fpackager –input=38_640x352_200Kbps.mp4 –bitrate=200
    It creates these files:

    38_640x352_200Kbps.f4m
    38_640x352_200KbpsSeg1.f4f
    38_640x352_200KbpsSeg1.f4x

    The f4m and f4x files are tiny. The f4f is the big file. So, when the client makes these requests:
    /38_640x352_200KbpsSeg1-Frag1
    /38_640x352_200KbpsSeg1-Frag2
    etc

    What the apache plugin does it figure out what section of the 38_640x352_200KbpsSeg1.f4f file is Frag1, Frag2, etc.

    I’m under the impression that you can use the f4fpackager to make all the Frag1, Frag2 files and host them on any HTTP server w/o the apache module, but I haven’t tried to do this.

  2. I haven’t looked at this in awhile. I remember struggling with it a bit when I first played with it. But the concept is so cool: keep the video playing, toggle between bitrates as the users available bandwidth changes. The technology to do this is now readily available for the masses, if you can get through the complexity of all the files and how they logically fit together.

Comments are closed.