Skip to main content
Topic: Why doesn't opusenc have a quality setting? (Read 2152 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Why doesn't opusenc have a quality setting?

Why doesn't opusenc have a quality setting? You can either accept the default quality, or you can set the bitrate, but there's no option to select a quality level. Seems very weird...am I missing something?

(To explain further, 1 channel at 128Kb/s is not the same quality level as 8 channels at 128Kb/s. So, the bitrate option is not a substitute for a quality selection option when encoding mixed sources.)

Re: Why doesn't opusenc have a quality setting?

Reply #1
What would you like a quality setting to mean?  Just be a proxy for some sort of bitrate?  A bitrate per channel?  A whole bunch of different bitrates for mono/speech/couple channels, etc.?  Something even more complex aiming for a level of transparency for each track?  There is a default bitrate and you can set a different one if you want.  The default is different per single channel or coupled pair, so reasonably scalable.

It is worth noting that giving a VBR bitrate to opusenc effectively is a quality setting.  Rather than produce output with that bitrate, it will encode with parameters that it knows on average will give that bitrate for a track, but those parameters on your track may use a considerably lower or higher bitrate to hopefully get a similar level of transparency.

Re: Why doesn't opusenc have a quality setting?

Reply #2
Developers just haven't gotten around to it.
have a "constant quality" mode so e.g. mono speech and 5.1 surround fullband music can be encoded with the same settings and be expected to achieve similar quality (quality as measured by e.g. ABC/HR, MUSHRA, etc). Opus devs have in the past talked about this as "fullband stereo equivalent bitrate."
Still under consideration, though not so high on the priority list.
This is unfortunate; even outside of surround sound situations there would be benefits of having such a mode. The VBR scheme has not really sufficed to avoid the fact that opusenc --bitrate XX will yield rather different subjective quality on mono speech vs stereo music. But being paid by Mozilla and working hard on the AV1 video format mean that time spent on Opus is limited and somewhat more directed towards WebRTC and other streaming use cases rather than towards end users encoding at-rest files.

Re: Why doesn't opusenc have a quality setting?

Reply #3
Quality? You mean bitrate per channel/couple right?

If you're worried about surround quality, here's a cool thing you should know about opus: there's a lot of techniques for optimizing stereo and surround inside opus that have been in development since the vorbis era, and they're pretty good. You can check a demo with some of it here and see that bits are only allocated where needed. (This is a demo of 1.1, we are currently on 1.3 and there are also other cool demos from newer versions on this same website)

Also, if 256 kb/s is enough for encoding good ambisonics that take way more channels than common surround, I wouldn't worry that much about it.  :D

Re: Why doesn't opusenc have a quality setting?

Reply #4
Quality? You mean bitrate per channel/couple right?

Ideally, bitrates that yield somewhat consistent subjective quality across audio formats (mono, stereo, 5.1, etc).

But I would settle for a really simple, dumb bitrate-per-channel option (like the default 64/96...just let me pick a different number). Opusenc doesn't even have that.

Re: Why doesn't opusenc have a quality setting?

Reply #5
C:\Program Files (x86)\Codecs>opusenc /?
Encoding options:
 --bitrate n.nnn    Set target bitrate in kbit/s (6-256/channel)
 --vbr              Use variable bitrate encoding (default)
 --cvbr             Use constrained variable bitrate encoding
 --hard-cbr         Use hard constant bitrate encoding

Re: Why doesn't opusenc have a quality setting?

Reply #6
I appear to be the only one who made a good faith attempt to understand what was being asked before leaping in with an irrelevant answer.

There's a clear difference between "quality" - measurable by e.g. ABC/HR, MUSHRA, etc - and either bitrate or bitrate per channel/pair. A 7.1 surround file at 80kbps will score much lower in subjective testing than a stereo file at 80kbps; you're throwing a lot more information away and will have more artifacts. A 7.1 surround file at 400kbps - which is 80kbps per channel/pair (three paired, center, LFE) will score higher than a stereo file at 80kbps; there are correlations, masking effects, etc which make it so 7.1 doesn't demand the bitrate of 5 stereo tracks.

Opus devs know this perfectly well, as their past statements about "fullband stereo equivalent bitrate" show.

If you stick to music with the same number of channels, the idea that bitrate is a perfect alias for quality is close enough to true, because that's what the VBR allocation does. If you have a mix of music and speech and/or a mix of channel counts, you're going to have to classify your tracks according to those distinctions and specify a different bitrate for each class. This can be a pain, and a real quality option - again, you could call it a "fullband stereo equivalent bitrate option" if that tickles your fancy- would be a boon.

Re: Why doesn't opusenc have a quality setting?

Reply #7
Caring about evaluating bitrates is annoying if you just want to have an ensured good-balanced output (bits<>transparency).
If it's music only, then it might be a bit more simple, but mixed content and more then 2 channels?
Forget it. It might also never give you the potential and gain you are aiming at.
Therefore people invented vbr and a quality-setting, to get the feature of variability/dynamic and something that expresses your demand/intent/purpose.
If so it definitely makes sense to ask this question.
Opus got a detector, but maybe jmvalin might spend a note to that question.

Re: Why doesn't opusenc have a quality setting?

Reply #8
The only thing hard coded into the encoder and decoder is the resampling quality, which is set at 5. I have made custom builds with this number changed to 10. I don't think the developers will change this behavior soon as they think that 5 is enough, but still internally at the code, it can go up to 10.

Re: Why doesn't opusenc have a quality setting?

Reply #9
The only thing hard coded into the encoder and decoder is the resampling quality, which is set at 5. I have made custom builds with this number changed to 10. I don't think the developers will change this behavior soon as they think that 5 is enough, but still internally at the code, it can go up to 10.
Any chance of getting a 32-bit build of this package?

Re: Why doesn't opusenc have a quality setting?

Reply #10
If it worries you, resample with SoX or something similar before encoding, but I've certainly not been able to detect any difference between quality setting 5 and 10.

Re: Why doesn't opusenc have a quality setting?

Reply #11
And don't forget that the noise level introduced by using lower quality levels with the speex resampler are probably completely dashed apart by what the Opus codec does to the signal.

Re: Why doesn't opusenc have a quality setting?

Reply #12
Higher resampling quality means higher latency, probably an issue for Opus devs.  Probably not an issue for most people reading this.  Not that quality 5 should be anything other than transparent anyway.

Re: Why doesn't opusenc have a quality setting?

Reply #13
Yo, thanks to all for your comments.  I was just curious as to if I would notice anything different, like I guess KozmoNaut was when he tried it.  Doesn't appear I would have  :)

Re: Why doesn't opusenc have a quality setting?

Reply #14
Opus works very well encoding multichannel audio at low bitrates.  I have encoded Pink Floyd's Dark Side of the Moon in 5.1 using Opus at 128 and 160 kbps and there is really very little difference between the low bitrates and going to 256kbps.  Opus is able to use the channels to mask lower bitrates.

Re: Why doesn't opusenc have a quality setting?

Reply #15
Just my .02 about the resampler… This thread should explain a bit ;)
sox -e float -b 32 -V4 -D gain -3 rate -v 48000 norm -1
opusenc --bitrate 128

 
SimplePortal 1.0.0 RC1 © 2008-2019