FFmpeg – Fixing Bad Audio Quality with FFmpeg and libmp3lame

audiodownloadffmpegmp3youtube

when I get a flash video from YouTube, why is the quality of the audio much worse than the origin video on YouTube? When I downloaded the flash movie, I convert it to avi like this:

   ffmpeg -i ~/"$2.flv" -sameq -acodec libmp3lame -vol 200 -ar 44100 -aq 300 -ab 2097152 ~/"$2.avi"

I already set -aq (audio quality) to 300, but no difference to 100 or 200. Moreover 100 is the max. value in my opinion. -ar (frequecy) 44100 should be ok too and the bitrate in bit/s (-ab) should be 256kb/s (2097152 / 1024 / 8). I am not sure what is the right bitrate for a good quality but I think 256kb/s should be fine. Or did I calculate it wrong?

What could be the problem?

Best Answer

This is the command line you want:

ffmpeg -i ~/test.flv -acodec libmp3lame -qscale 8 test.avi

Using the video you suggested as example i have almost the same quality in vlc as original (original has aac encoding).

You were specifying a way too high bitrate (2Mb/sec, 192kb/sec is far enough), i don't think it had any collateral effect on your command line though.

The difference is made by -qscale 8 which let ffmpeg output a VBR mp3 instead of a CBR stream.

Related Question