I was trying to extract the audio file from some youtube videos in order to play it back from my iPod shuffle. I tried various methods (including the otherwise quite versatile VLC Player, but finally settled on the following two step procedure:
1. Download the flash video (file ending .flv) file to your local disk. You can use any method to accomplish this task, but as usual Firefox has the perfect plug-in for this task: Download helper.
2. Extract and convert the audio file with ffmpeg using the following command: ffmpeg -i video-infile.flv audio-outfile.mp3
It is also possible to convert the flv file into a mpeg file. You need to do this e.g. if you want to import the video into iTunes. For some strange reason Quicktime can play Flash Videos, but iTunes doesn't allow their playback. The command is almost the same: ffmpeg -i video-infile.flv audio-outfile.mpeg
Another nifty usage of ffmpeg is to check video files for corruption and other problems:
ffmpeg -v 5 -i file.avi -f null - 2>error.log