When you encode a MP3 file with the command-line tool FFmpeg, you can change the bitrate to see how much compression the file will use. However, when you play the file back on your computer or portable audio player, the size of the MP3 remains unchanged. The reason for this is that MP3 files are encoded at a constant bitrate, no matter what the bitrate setting. This means that even if you reduce the bitrate by a factor of 10, the resulting file will still be about 1 megabyte in size. ..
If you are new to the process of converting audio files, then many of the details and how they work can be a bit confusing when you get unexpected results. So what do you do to fix the problem? Today’s SuperUser Q&A post has the answer to a confused reader’s question.
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
Photo courtesy of Warein (Flickr).
The Question
SuperUser reader Arlen Beiler wants to know why using different bitrate settings when converting an audio stream produced files that were all the same exact size:
How did using different bitrate settings produce files of the same exact size?
ffmpeg -i “Likoonl-Q1-All. mp4” -c:v copy -c:a libmp3lame -q:a 1 -b:a 192k “Q1-All-192k. mp4” ffmpeg -i “Likoonl-Q1-All. mp4” -c:v copy -c:a libmp3lame -q:a 1 -b:a 160k “Q1-All-160k. mp4” ffmpeg -i “Likoonl-Q1-All. mp4” -c:v copy -c:a libmp3lame -q:a 1 -b:a 128k “Q1-All-128k. mp4”
The Answer
SuperUser contributor slhck has the answer for us:
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
For the sake of completeness, here is the relevant part of libmp3lame.c (qscale is the long name of q):