Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Questions about VBR Opus (Read 9689 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Questions about VBR Opus

I'm curious about Opus VBR mode, every thing I throw at it, the bitrate tends around my target bitrate very tightly +-5%, unlike say vorbis or lame which wildly fluctuate, 'ball park' style bitrates.


Here is an extreme example:

Code: [Select]
sox.exe -n -t sox - synth 30 brownnoise brownnoise gain -3 lowpass 180 | ffmpeg -f sox -i - -q:a 10 -y output.ogg


This generates 30 seconds of brownnoise with a lowpass filter over the top, sounds like the warp engine of the Enterprise.

Basically Ogg vorbis at quality 10, nominal 500kbps~, but the actual output is only 183.8kbps because of the simplicity of the audio sample.

Opus on the other hand:
Code: [Select]
sox.exe -n -t sox - synth 30 brownnoise brownnoise gain -3 lowpass 180 | ffmpeg -f sox -i - -b:a 510k -vbr on -y output.opus


The output is 499.2kbps, this is not exactly what I expected vbr mode to do.

too me this looks like ABR, does Opus' VBR just need more time to mature?

Questions about VBR Opus

Reply #1
Opus VBR varies as expected for me.  Probably an ffmpeg issue.  What version of libopus do you have?  Have you tried with opusenc?  libopus 1.1 supports unconstraint VBR (-vbr), constrained VBR (-cbr), and CBR (--hard-cbr).  Older versions did not support true unconstrained VBR.


Questions about VBR Opus

Reply #3
Opus VBR varies as expected for me.  Probably an ffmpeg issue.  What version of libopus do you have?  Have you tried with opusenc?  libopus 1.1 supports unconstraint VBR (-vbr), constrained VBR (-cbr), and CBR (--hard-cbr).  Older versions did not support true unconstrained VBR.


opusenc does the same thing, at least on my specific example, I tried running a movie soundtrack through opusenc and got a bitrate of about 60kbps for 64kbps, but the 'instant bitrates' were 30-130kbps, Still find it odd that it allocates so much to such a similar sample.

Questions about VBR Opus

Reply #4
Opus VBR varies as expected for me.  Probably an ffmpeg issue.  What version of libopus do you have?  Have you tried with opusenc?  libopus 1.1 supports unconstraint VBR (-vbr), constrained VBR (-cbr), and CBR (--hard-cbr).  Older versions did not support true unconstrained VBR.


opusenc does the same thing, at least on my specific example, I tried running a movie soundtrack through opusenc and got a bitrate of about 60kbps for 64kbps, but the 'instant bitrates' were 30-130kbps, Still find it odd that it allocates so much to such a similar sample.


By "similar sample" you mean brown noise?  I wouldn't call noise very similar to a movie sound track at all.  Noise has very high entropy.

Questions about VBR Opus

Reply #5
Opus is not at all like Vorbis, so it's no surprise that the VBR behavior differs between the two. Try encoding something else, you might be surprised by the results.

Here's a graph of the bitrates of each track from two CDs encoded at a target bitrate of 64kbps. I chose these CDs specifically for their variety of genres, so these results might be exaggerated somewhat. However, it should be apparent that there is (almost?) no correlation between the VBR behaviors of these codecs.



(Bonus if you can guess what type of music the top-left point represents.)

Questions about VBR Opus

Reply #6
(Bonus if you can guess what type of music the top-left point represents.)

Classic  or some 8 bit computer game music

While Opus has some similarity with AAC and Vorbis it also has come important differences.  Even two encoders of the same format can have different VBR approaches.

Questions about VBR Opus

Reply #7
Vegetarian Progressive Metal?


Questions about VBR Opus

Reply #9
Sorry guys I meant simple (for Vorbis), not similar. My brain had a fart.

I was considering noise had pretty high entropy, but at the same time Vorbis didn't struggle nearly as much.

Maybe some more sane settings will produce far lower bitrates.

Questions about VBR Opus

Reply #10
Sorry guys I meant simple (for Vorbis), not similar. My brain had a fart.

I was considering noise had pretty high entropy, but at the same time Vorbis didn't struggle nearly as much.

Maybe some more sane settings will produce far lower bitrates.


As someone already pointed out, if you were using a 1.0.x encoder, then you'll get nearly no variation on the final size because 1.0.x never had true unconstrained VBR, only ABR. OTOH, with 1.1.x, you'll see large differences between files. Noise should end up at a lower bitrate and tonal content should end up at a higher bitrate.

Questions about VBR Opus

Reply #11
if you were using a 1.0.x encoder


Definitely the latest opusenc from their website, 0.1.9, and a fairly new version of ffmpeg (build within days of the post), both output extremely high 500kbps~ streams.

 

Questions about VBR Opus

Reply #12
Here's the final bitrates from encoding three samples: lowpassed brown noise, the 8-bit game music from before, and something loud with lots of distortion and dubstep-like bass.

Code: [Select]
        Brown    8-bit     Loud
  Rate  noise    Nintendo  music
  ----  -------  --------  -------
     8    8.018    9.012     7.219
    12   12.00    11.94     11.75
    16   16.01    15.63     15.53
    24   23.81    25.30     23.80
    32   32.01    33.97     31.98
    48   47.47    61.61     46.07
    64   63.03    91.31     57.46
    96   95.14   129.6      84.81
   128  126.1    163.0     114.0
   192  189.4    232.4     174.7
   256  250.5    291.8     235.8
   384  378.5    415.7     360.2
   512  502.3    501.0     479.9

This looks normal to me. If you don't see enough variation in bitrate, choose something lower than 510kbps.

Or, as I said earlier:
Try encoding something else.