I have some Dolby files which I'd like to listen to on my phone. Is there a way to figure out the optimal Opus bitrate, or am I displaying my ignorance?
A stereo AC3 file is about 10MB @ 256 kbps. Converted to WAV it's ~60MB.
I naively thought that if I did
opusenc --bitrate 512 in.wav out.opus
it wouldn't use all 512, but reading the documentation, I understand it's a target. So the Opus file is twice the size of the original AC3.
ffmpeg -i in.ac3 -b:a 256k out.opus
creates a file of the same size as the original AC3, obviously!
I assume that Opus is a lot more efficient that AC3 or DTS - so re-encoding to the same bitrate is a waste of time. Is there a way to automatically figure out the best / most efficient bitrate?
Or, should I just accept that 128k ought to be enough for anyone and use that as default.
I'm prepared to be told that I'm being daft! :)
when decoding AC3 with ffmpeg i would use -drc_scale 0 to avoid dynamic range compression.
ffmpeg -drc_scale 0 -i in.ac3 -b:a 256k out.opus
There is no easy answer because each compression algorithm uses a different psychoacoustic model and different parameters/compromises, and sometimes there are other changes & artifacts. It could be worse with a higher opus bitrate.
i.e. I'm pretty sure if you transcode from MP3 to MP3 multiple times at a higher bitrate each time the accumulated damage will eventually become audible.
I'd just go with whatever you normally use and then if it "sounds bad" try a higher bitrate (or go lossless).
The opus encoder's default bitrate (the one chosen if none is specified) is 96k. It gives very good quality audio, so if you're targeting efficiency that is a quality worth considering.
Youtube uses opus @160k for the default audio selection when available. If you're paranoid about audible encoding artifacts that's a safer selection. Any higher is probably excessive.