Recommended settings to convert Opus to AAC

More generally, I would recommend to have a look at the FFmpeg Wiki page on AAC encoding. Here you will find tips on how to achieve the best quality, which involves:

  • using the libfdk_aac encoder instead of the built-in one (the encoder can make a huge difference in quality!)
  • using VBR — there is no need to constrain the rate or waste bits
  • turning off the high pass filter, as by default some high frequencies are lost during conversion

Thus, the following would work:

ffmpeg -i input.opus -c:a libfdk_aac -vbr 5 -cutoff 18000 output.m4a

This should be absolutely transparent to anyone's ears. You may even use -vbr 4 and check whether you can detect the difference. I guess you won't.


More specifically, you ask:

And finally, youtube-dl also can download an AAC file of 128 kbs. (…) But would transcoding the opus to AAC (…) maintain that quality difference, or would the transcoding (…) induce artefacts so that the audio quality (…) would actually be worse?

Great question that I don't know how to answer without conducting a formal listening test.

However, if you assume that stereo AAC at 128 kbps is at least good quality (but not excellent), you may forgo any conversion and use that directly if it sounds good to you. I think I would listen to the original Opus and AAC samples that you directly downloaded and try to do a blind test — can you reliably detect the difference? If no, then just use AAC and save yourself the conversion.

PS: I listened to a few music clips from YouTube with both the Opus and AAC variants and I personally liked Opus better — it seemed to have a bit more high-frequency spatiality to it. But don't consider that a scientifically sound conclusion!


Finally, there is a thread discussing a similar issue, and here, one user thinks that there is more aggressive psycho-acoustic shaping in VBR encoding, which may enhance already present artifacts when encoding a lossy file again. He concludes that ABR at a high bitrate may be better suited for such tasks.