Downloading HDS Flash (f4m) video streams.

Some WebTV or other video streaming websites use a special Adobe (surprise, surprise) inspired protocol to stream their content. The special thing about this protocol is that the file is split into chunks which I guess is good if you want to jump on different points in the video or you have an unstable internet connection but really annoying if you just want to download the video and view it in a different player.

This protocol is called Abode Dynamic Streaming for Flash and usually the sites link to f4m manifest files. From the SWF Wikipedia Page we read get the following definition for f4m

.f4m files are XML manifest files. Containing base64 FLV on MetaData headers for an Adobe version of bit rate control HTTP Live Streaming.

Thankfully K-S-V provides a script that reads these files, downloads all the announced chunks and finally assembles them into one video file. Interestingly the script is written in PHP cli mode (!) which probably you don't have installed locally.

I created a Docker Image that installs whatever is needed to run the script and the actual script. With a bit of Docker magic you can now download .f4m manifests with a one-liner:

docker run -v `pwd`/video:/output giorgos/hds-downloader --delete --manifest <MANIFEST_URL>

For example:

docker run -v `pwd`/video:/output giorgos/hds-downloader --delete --manifest  ",c8e81912-517d-448c-bfe8-c083d7ef8819,.mp4.csmil/manifest.f4m?g=IMEQTLFUJHZE&hdcore=3.8.0&plugin=jwplayer-"

will save in video directory on the host a small tribute to the Back to the Future

Go Top