Thursday, November 25, 2010

Ripping audio from an flv file under Linux

Today I was trying to rip the audio from an flv off YouTube, and the basic rip with mplayer:


$ mplayer -dumpaudio input_file.flv -dumpfile output_file


...was giving me a binary file that I couldn't use.

After some Googling, reading and trying I found this worked:


$ mplayer -ao pcm:file=output_filename.wav -vo null -vc dummy input_filename.flv


The output file from an 8MB flv was a 50MB wav file.

To get it in a smaller file I converted it to an ogg:


$ oggenc output_filename.wav -o target_filename.ogg


The resulting ogg file was 3.7MB

I got help from here: http://linuxgazette.net/131/howell1.html