Linux users are often slighted when it comes to media tools. Macromedia/Adobe’s shameful implementation of Flash 7 is one example (though Flash 9 is due out in January). When trying to watch a YouTube video this makes for some very difficult viewing, because the video and audio become out of sync.
Fortunately, we have a fantastic tool in FFMPEG. FFMPEG is a collection of free software for recording, transcoding, and streaming digital video and audio. It is a fantastic tool for Linux users who need to convert.
Of course, being able to convert to MPEG only works if you have an FLV. If the video is natively in SWF form (e.g. it doesn’t use an FLV embed) you are out of luck, Linux users. To download your FLV, use a site such as VideoDownloader. You can also usually tell if the video is an FLV if it uses a player similar in style to the one available at Jeroen Wijering‘s site.
I’m on Ubuntu Linux (6.06) and FFMPEG is already installed. It’s best to check again though. You can open up the Synaptic Package Manger and search for “FFMPEG”. If it’s checked, you’ve got it. If not, install it! While you’re there, you’ll want to install nautilus-open-terminal as I reference this in the tutorial.
Now navigate to your home folder (using Places > Home) and create a new folder for “My Videos” (or whatever you want to call it). This is important because Nautilus-open-terminal won’t pick up your standard home folder. Move your downloaded FLV into this folder, and make sure it has a good name (I recommend video.flv for ease). Note that YouTube videos always are named get_video.htm, but you’ll want to change this to an flv extension!
Now right click somewhere in the folder and select “Open in Terminal”. This will launch a terminal specific to that folder. Edit the below code to suit your needs, paste into Terminal, and press enter.
Ubuntu users might need Sudo, might not. I usually use it out of habit so I’m not positive if it’s required or not.
ffmpeg -i video.flv -ab 56 -ar 22050 -b 500 -s 320x240 test.mpg
The script, in this order:
- Launches FFMPEG
- Opens your FLV (change to suit yours)
- -ab : Sets the audio bitrate. Without this, it’ll be set to the default of 64kbps
- -ar : Sets the audio samplerate. Default is 44100hz
- -b : Sets the video bitrate. Default is 2000kbps
- -s : Sets the size. Default is 160x128px
- Outputs to the filename you enter (change to suit your needs)
When I tried this, I changed nothing and got fairly decent video quality but the audio lacked. I’d definitely recommend tweaking the settings a bit to improve quality.
This is a far more stable method of converting video (in my testing) than the most dominant free Windows alternative, RIVA FLV Encoder. I plan on utilizing FFMPEG in the future, and hopefully looking into Windows implementations!