HydrogenAudio

Lossy Audio Compression => Opus => Topic started by: edent on 2020-01-09 21:49:27

Title: Converting AC3 / DTS to Opus. Am I overthinking this?
Post by: edent on 2020-01-09 21:49:27
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
Code: [Select]
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.

Using
Code: [Select]
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!  :)
Title: Re: Converting AC3 / DTS to Opus. Am I overthinking this?
Post by: Rollin on 2020-01-09 22:02:31
when decoding AC3 with ffmpeg i would use -drc_scale 0 to avoid dynamic range compression.
Code: [Select]
ffmpeg -drc_scale 0 -i in.ac3 -b:a 256k out.opus
Title: Re: Converting AC3 / DTS to Opus. Am I overthinking this?
Post by: DVDdoug on 2020-01-10 21:51:24
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).
Title: Re: Converting AC3 / DTS to Opus. Am I overthinking this?
Post by: Em on 2020-01-11 08:40:46
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.
SimplePortal 1.0.0 RC1 © 2008-2021