I was recently interviewed by Mustard TV for a feature on the Norwich Sound & Vision festival, in which I’ve been involved. The feature was broadcast on Freeview cable TV but I can’t pick up the channel where I live, so I wanted to grab a copy off the website instead. They deliver videos using Adobe’s adaptive streaming protocol, which results in videos being sent in many fragments, of potentially different bitrates.

Here’s a little guide of what I had to do to save, join, and then convert the fragments into a single .MP4 video file.

1.) First, I went to the page in which the video was embedded and played the video the whole way through.

IMPORTANT NOTE: Since Adobe’s streaming media server chunks videos into many different fragments, you need to watch the entire video the whole way through to make sure all the fragments are requested and downloaded.

2.) Once the video has ended, I used the media tab of the FlashGot FireFox extension to save all the video fragments to a local folder.

IMPORTANT NOTE: Due to the nature of adaptive bitrate streaming, you’ll see that the resolution of some of the fragments above varies depending on what my internet speed was like at the time. (Fragments 4 and 5 are only 600×640 resolution rather than 1200×1080 – I must’ve had some sort of spike at that point). To join a single video, you’ll want to ensure that you end up with a complete set of fragments at the same resolution. For fragments 4 and 5 above, I simply replayed that part of the video and it re-requested the file at a better resolution – you could also probably copy the URL template and specify the resolution of the fragment you want.

3.) To join the fragments together, I then used a PHP script which I found here. I’m reproducing it below for convenience.

To use the script, start a new command prompt and call it as follows, with the full filename omitting the fragment number:

4.) You should now have a single .FLV video file with all the fragments joined together. If you use a media player that can play FLV video, such as VLC you can stop here. However, if you want to make the video a slightly more standard .MP4 format, you can convert it using FFMPEG, like this: