Code, Computers & Random Junk

Convert Sound to Mp3 With ‘Ffmpeg’

Just an easy way to convert you sound files. The syntax is really simple.

ffmpeg -i input.flv -a<sound quality> output.mp3

I took a file a made a few samples to see where it landed.

ffmpeg -i input.flv -acodec mp3 output.mp3  # CBR 128 kbits/s

ffmpeg -i input.flv -ab 320k output.mp3     # CBR 320 kbits/s

ffmpeg -i input.flv -aq 3 output.mp3    # VBR ≈ 160-170 kbits/s
ffmpeg -i input.flv -aq 2 output.mp3    # VBR ≈ 180-190 kbits/s
ffmpeg -i input.flv -aq 1 output.mp3    # VBR ≈ 210-220 kbits/s
ffmpeg -i input.flv -aq 0 output.mp3    # VBR ≈ 235-240 kbits/s

For OS X, there are a few pre-compiled binaries you can use, like here and another one here. The first one, the lastest version didn’t work for me and I haven’t tried the other one. Though, if you have programs like Adapter it’s included there.

In Linux - look in your package manager.