How to implement the Adobe HTTP Streaming spec without using their Streaming server

Scott picture Scott · Dec 14, 2010 · Viewed 7k times · Source

As of Flash 10.1, they have added the ability to add bytes into the NetStream object via the appendBytes method (described here http://www.bytearray.org/?p=1689). The main reason for this addition is that Adobe is finally supporting HTTP streaming of video. This is great, but it seems that you need to use the Adobe Media Streaming Server (http://www.adobe.com/products/httpdynamicstreaming/) to create the correct video chunks from your existing video to allow for smooth streaming.

I have tried to do a hacked version of HTTP streaming in the past where I swap out the NetStream objects (similar to here http://video.leizhu.com/video.html), but there is always a momentary pause between the chunks. With the new appendBytes, I tried to do a quick mock up with the two sections of video from the preceding site, but even then, the skip still remains.

Does anyone know how the two consecutive .FLV files needs to be formated in order for the appendBytes method on the NetStream object to create a nice smooth video without a noticeable skip between the segments?

Answer

Grant picture Grant · Feb 23, 2011

I was able to get this working using Adobe's File Packager Tool which Samuel described. I didn't use the NetStream object but I used the OSMF Sample Player which I assume uses this internally. Here's how to do with without using FMS:

  1. Get Adobe's File Packager for Http Dynamic Streaming from http://www.adobe.com/products/httpdynamicstreaming/
  2. Run the File Packager on an existing MP4 file containing H.264/AAC like this: C:\Program Files\Adobe\Flash Media Server 4\tools\f4fpackager> f4fpackager.exe --input-file="MyFile.mp4" --segment-duration=30

This will result in 30 second long F4F files, also F4X and a F4M file. The F4F files are your correctly segmented (and fragmented) MP4 files that should play. If you want to test this using the OSMF Player also do the following:

  1. Get Apache Server
  2. Get Adobe's Http Origin Module for Apache from http://www.adobe.com/products/httpdynamicstreaming/
  3. Install the module according to http://help.adobe.com/en_US/HTTPStreaming/1.0/Using/WS8d6ed60bd880807c48597a9e1265edd6cc0-8000.html
  4. Put the F4F, F4X and F4M file into the vod directory under httpdocs
  5. Get the “OSMF Sample Player for HTTP Dynamic Streaming” from http://www.osmf.org/downloads/OSFMPlayer_zeri2.zip
  6. Put the Sample Player in the httpdocs directory
  7. Load the html file from the Sample Player in a browser eg http://localhost/OSMFPlayer.html
  8. Press the eject button and put in the URL of your F4M file, it should play

So to answer the original question Adobe's File Packager is the file splitter to use, you don't need to buy FMS to use it and it works for FLV and MP4/F4V files.