Giter VIP home page Giter VIP logo

Comments (5)

silverbacknet avatar silverbacknet commented on July 18, 2024

It's better to think of "bitrate" in Opus and Vorbis as a quality factor, rather than a hard-and-fast rate. Like a much more fine-tunable version of LAME's Vx presets, except that the values for Xiph's bitrates actually do average out over a wide variety of content near the given bitrate. Finding any single piece of audio where they hit it on the nose is rare. Vorbis and Opus have very different methods of transforming audio, and somewhat different "easy" and "hard" areas, so it makes sense that they aren't entirely related in bitrate decisions on any individual song either.

As most of my music library is electronic and dance music, I just automatically accept that it'll always be 5-10% higher than the nominal bitrate, as that's what it takes to sound as good as, say, a folk song or a bass solo from Geddy Lee at far under the nominal bitrate. Vorbis tended to have even wider ranges in my experience.

There is a cbr mode to Opus, but now it's quality that will be uneven, rather than bitrate.

from opus.

manujchandra avatar manujchandra commented on July 18, 2024

Thanks for your response.

Curiously, when I did a comparison in Handbrake, with identical profiles but one using vorbis and in the other using opus, I saw a reduction in opus test, although it was not significant.

I read that opus produces smaller or equal sized audio, but in my tests using FFmpeg I am getting a bigger opus across the board.

I also noticed that opus was using 48K, but vorbis was using 44k. Maybe this has something to do with the size? I lowered sampling rate for opus to 16k(if I remember correctly), but still the file size was not lower than vorbis 44k.

from opus.

silverbacknet avatar silverbacknet commented on July 18, 2024

I read that opus produces smaller or equal sized audio

No, it produces higher quality at any given size on almost all audio; if you want to drive the size down then you can drop your bitrate. By asking for the same bitrate you're effectively asking for higher quality than Vorbis, not smaller size.

Don't touch sampling rate, that has absolutely nothing to do with quality or bitrate, except that it will significantly lower quality if you force it incorrectly. Outside of the API, Opus will always nominally use 48kHz, but will use only as much bandwidth as set for the range. Very low bitrates will reduce from the default 20kHz lowpass down all the way to 8kHz, and will also drop down stereo modes until mono, entirely automatically.

There are no modern audio codecs that increase size with PCM sample rate, except pure lossless like FLAC. They don't record samples, they record frequencies and maybe a bit of noise. That's just an abstraction now, so unless your hardware can't do it, signaling higher is always better.

Handbrake was probably using different versions of the codecs than your ffmpeg build was, assuming that each and every single parameter was the same (ffmpeg does set a few differently from opusenc, btw).

Is Opus being 10% larger for your small sample set really enough of a dealbreaker to keep trying to break the codec until you can get them equal?

from opus.

manujchandra avatar manujchandra commented on July 18, 2024

@silverbacknet

Hi Emily,

The use case is that I have some audio files which I want to archive on a cloud bucket. Theoretically, the smaller the size the lesser the bill. This is the reason I was conducting tests to get equivalent quality to vorbis at an equal or lower size.

I took 4 audio files - one flac, wav, mp3 and aac. I encoded them using the above commands, but changed the bit rate. These are the results I got:

Original Size : 50.7 MB

Codec kbps size in MB
vorbis 128 9.84
opus 64 5.68
opus 100 8.62
opus 112 9.52
opus 128 11

I think opus at 112kbps is giving approximately the same size as vorbis at 128. The question is that is the quality equivalent? Personally, I could not tell the difference in this small sample.

Is Opus being 10% larger for your small sample set really enough of a dealbreaker to keep trying to break the codec until you can get them equal?

I guess not. I read that opus produces smaller files than vorbis, so I was investigating why I am getting larger files out of curiosity.

from opus.

manujchandra avatar manujchandra commented on July 18, 2024

I think I am going to stick to the recommended bitrates:

https://wiki.xiph.org/Opus_Recommended_Settings#Recommended_Bitrates

from opus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.