Converting several flash videos into a single MPEG4

Today, I came across the documentary The World according to Monsanto. Since I was quite intrigued (Roundup gets sold here in NZ as well), I wanted to watch it. But instead of watching the 10 separate flash videos (hosted on youtube.com), I wanted a single MPEG4 movie. But how to proceed?

  1. Downloading the flash videos
    I copied the links of the flash videos and used youtube-dl to download them:
    youtube-dl -o 1.flv http://www.youtube.com/v/c_OJcPKEYDE
    youtube-dl -o 2.flv http://www.youtube.com/v/Rt8ldmvEY9E
    youtube-dl -o 3.flv http://www.youtube.com/v/zgSCd-Qaqn0
    youtube-dl -o 4.flv http://www.youtube.com/v/NPa95CjYffw
    youtube-dl -o 5.flv http://www.youtube.com/v/VkWUcAuFYto
    youtube-dl -o 6.flv http://www.youtube.com/v/Ny9K-YeAMUI
    youtube-dl -o 7.flv http://www.youtube.com/v/PCBY9pNB584
    youtube-dl -o 8.flv http://www.youtube.com/v/Tk9_eN9Y1Dw
    youtube-dl -o 9.flv http://www.youtube.com/v/f5dNdUah0D0
    youtube-dl -o A.flv http://www.youtube.com/v/-TmFEOmRbWU
  2. Converting the flash videos to MPEG4 using ffmpeg with a one-liner bash script:
    for i in 1 2 3 4 5 6 7 8 9 A; do ffmpeg -i $i.flv -b 1200000 -s 320x180 $i.mp4; done;
  3. Concatenating the movies using MP4Box (all in one line again):
    MP4Box -out The_World_according_to_Monsanto.mp4 -cat 2.mp4 -cat 3.mp4 -cat 4.mp4 -cat 5.mp4 -cat 6.mp4 -cat 7.mp4 -cat 8.mp4 -cat 9.mp4 -cat A.mp4 1.mp4

And that’s it! 🙂