Every once in a while, you may come across some videos on YouTube-the popular free video sharing service. You may enjoy the videos more or less but sometimes, just sometimes, you come across a video you really need to have on your hard drive and to watch over and over again, every time you feel the need. Unfortunately, YouTube seems to discourage its users from downloading the videos. This can get rather annoying because you'll need to save a bookmark with the video url, load it in your browser every time you want to re-watch it, wait until it's loaded and so on. So why get through all this trouble, when you can easily download the file in Flash Video format (FLV), convert it into mpeg4 or xvid video with mp3 audio and watch it on your PC or even on your mobile phone?
However, the standard FFMpeg package is pretty useless since it doesn't offer support for mp3 so you'll have to go through a painful process first in order to encode your videos with mp3 audio. Before we start, your Ubuntu system needs to have the c compilers, patch tools and standard devel packages installed. It also needs to have multiverse and universe repositories enabled. And to make things easier, you'll need to have a password on the root account. As this is the easiest part, we'll start with it. Open a terminal and type:
# bzcat ../ffmpeg-0.cvs20060823_enable_amr.patch.bz2 | patch -p1
patching file Debian/rules
patching file libavcodec/amr_float/decoder.c
patching file libavcodec/amr_float/encoder.c
patching file libavcodec/amr_float/interf_dec.c
patching file libavcodec/amr_float/interf_dec.h
patching file libavcodec/amr_float/interf_enc.c
etc..
# dpkg -i ffmpeg_0.cvs20060823-3.1ubuntu1_i386.deb libavcodec0d_0.cvs20060823-3.1ubuntu1_i386.deb libavformat0d_0.cvs20060823-3.1ubuntu1_i386.deb libpostproc0d_0.cvs20060823-3.1ubuntu1_i386.deb
Package: libavcodec0d Pin: version 0.cvs20060823-3.1ubuntu1 Pin-Priority: 1001
Package: libavformat0d Pin: version 0.cvs20060823-3.1ubuntu1 Pin-Priority: 1001
Package: libpostproc0d Pin: version 0.cvs20060823-3.1ubuntu1 Pin-Priority: 1001
# chmod +x youtube-dl
# mv youtube-dl /usr/local/bin
Finally, convert .FLV files into MPEG: