Script to download Youtube videos and merge into an AVI file

youtube downloader mergerI had the need to watch a TV program on youtube splitted into 12 videos when I was on holiday at home. Due to my poor connection there, I decided to obtain the merged version in AVI format and watch it on the TV screen via HD player. I did not found any software/script that suited me on linux (apparently on windows nothing similar exists neither) so my developer instinct made me developing something appropriate … and made me go to sleep late as usual :).

I’ve eventually made a PHP script that downloads all the youtube videos (using the already existing python script youtube-dl) from the URLs specified in the Command line, then convert them to AVI (pipeline process with more than one file) and merge together into a final AVI file (FLV of different framerates and size are supported, using mencoder). The script is tested on linux ubuntu 10 (mencoder obtainable from repositories).

Download here (public SVN): http://svn.phpntips.com/projects/youtube-merge/

Example of use with 2 short videos:

youtube-multi "http://www.youtube.com/watch?v=MaZRgTJlN2Y&NR=1" 
 "http://www.youtube.com/watch?v=na_3XoysbCk"

See other options and instruction inside the file (max number of simultaneous processes, AVI bitrate etc..).

copy the file into /usr/bin to have them available evertywhere