I am downloading some music from Youtube, and it seems that in most cases (popular videos), the best quality audio is an opus file.
I know that (1) Opus is the newest and more efficient codec, and (2) converting from one lossy codec to another is not recommended.
However, as I want to use the same file, i.e. using same container, across Windows/iOs/car, I want to convert to AAC or MP3.
I have read here that you can mitigate the generation loss to a certain extent by using a higher bitrate for the target codec.
So what settings (e.g. ffmpeg) would you recommend to convert an opus file to AAC to keep same audio quality (I know this is subjective ...)?
According to the youtube-dl -F
data it is 160kbs, but when downloaded, MediaInfo gives 127Kbps overall bitrate and 48Khz sampling rate.
Would 192kbs be a good choice for the AAC file? (I presume AAC is in any case a better choice than MP3?) I know that from CD or lossless, VBR is most recommended, but for transcoding from Opus, would CBR be better? And should I keep the 48khz sample rate from the opus file, or downsample to the usual 44.1khz of AAC?
And finally, youtube-dl also can download an AAC file of 128 kbs. Given that opus is more efficient/better, quality will be higher at the same bitrate. But would transcoding the opus to AAC (e.g. at 192kbs/212kbs) maintain that quality difference, or would the transcoding (even to a higher bitrate) induce artefacts so that the audio quality of the 192kbs AAC file would actually be worse than the AAC 128kbs file ?
EDIT
Let me explain why I “conceptually” struggle with understanding how to determine optimized settings for transcoding.
In most cases, you start with lossless file (e.g. a 50Mb wav), and you choose encoder settings for quality (VBR) or desired bitrate (CBR/ABR). The encoder then does its hocus pocus (discard inaudible info, compression, etc.), which then give you a smaller lossy file, based on the settings you choose. For arguments sake, let’s say maybe 3Mb for a 128kbs MP3, 5-6Mb for a top quality VBR ( i.e. highest settings for lame or qaac), and 7-8Mb for a 320kbs CBR).
But in this case, the source file is a 5Mb 128kbs opus file. The first step in transcoding is to first decode the file (to a PCM stream?), and then encode again in the new format.
So is my understanding correct that the maximum information in the file is not more than 5Mb, so to encode (and if it is not a requirement to reduce file size) I should just use the highest possible quality VBR, or possibly a high CBR (256 or 320) to capture virtually all information still present in the opus file. The resulting file would in any case not be larger than the 5Mb, as I assume no new information can be invented/generated in the process (I will do some experimenting over the weekend to test this).
The first answer given seems to suggest this.