0

Using ffmpeg to convert audio files into mp3 (using -acodec libmp3lame). There is a ffmpeg parameter -aq, which is explained in the help as

-aq quality set audio quality (codec-specific)

What are meaningful values for this parameter, if I want to have good audio quality?

  • That would depend on what you need and expect. For some 64 might be good, for other 320 might still be too bad. For others a 3 or 4 might be sufficient. You might need to check the libmp3lame documentation to see what it accepts. – Seth Jan 9 at 9:18
  • @Seth : The example I have seen for my use case on the net, was -aq 2. The libmp3lame docs don't say explicitly, which parameter would correspond to ffmpeg, but perhaps it is -q (Internal algorithm quality setting), which allows only values from 0 to 9, where 0 is best. – user1934428 Jan 9 at 10:02
  • You haven't really described your use case. As such it was hard to recommend anything meaningful. For instance if it's just a wave file why not use lame directly instead of having a roundabout way with ffmpeg. The ffmpeg description already tells you it's codec specific and depending on your own requirements "average" quality or even "low quality" might be sufficient. The links in the answer from slhck have more details. – Seth Jan 9 at 11:27
  • 1
    You are right; I thought the only important part is the encoding (actually, they are .m4a files), and I just wanted to understand the -aq parameter. For instance, I had initially no idea, whether higher or lower numbers are good. But slhck has clarified this. – user1934428 Jan 9 at 12:33
1

Please have a look at the FFmpeg Wiki and the hydrogenaudio Wiki (particularly the recommended settings).

Since the value is codec-specific, -q:a (or -aq) is mapped to the LAME -V parameter when using -c:a libmp3lame. According to the FFmpeg Wiki,

a lower value is a higher quality. 0-3 will normally produce transparent results, 4 (default) should be close to perceptual transparency, and 6 produces an "acceptable" quality

So this should be your guideline. But of course, use your ears as well.

| improve this answer | |
  • Thank you. From the LAME documentation of -V: VBR quality setting (0=highest quality, 9.999=lowest). This is slightly differnt to what the Wiki says, but still it means that lower numbers mean better quality. – user1934428 Jan 9 at 10:07
  • I can also not find in the documentation, where it says thta -aq is indeed equivalent to -q:a, respectively -qscale:a 2.... – user1934428 Jan 9 at 10:26
  • 1
    See ffmpeg.org/ffmpeg-all.html: "Set the audio quality (codec-specific, VBR). This is an alias for -q:a." And -q and -qscale are the same per the documentation. – slhck Jan 9 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.