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: OPUS compression ratio vs samplerate/channels (Read 4242 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

OPUS compression ratio vs samplerate/channels

I have created these wav files, sorted by size (content is the same and it is resampled with Audacity. 44100 is the original)

   827 KB   11025-mono.wav    
1.652 KB   11025.wav           
1.652 KB   22500-mono.wav    
3.304 KB   22500.wav           
3.304 KB   44100-mono.wav    
6.607 KB   44100.wav           

This is after encoding to opus with Foobar2000 v1.3.17, again sorted by size

493 KB    44100.opus           
512 KB    22500.opus           
589 KB    22500-mono.opus    
593 KB    44100-mono.opus    
602 KB    11025-mono.opus    
628 KB    11025.opus           

I didn't expect this, why would this happen?

Re: OPUS compression ratio vs samplerate/channels

Reply #1
Yes, that's one thing I don't get about opus.
I've done this kind of thing too, but by feeding already resampled streams to the encoder using foobar and the SoX component.
I used full bandwitdth tracks and would resample them down to something and then back to 48kHz then fed to the opus encoder.
The reduced bandwidth never seems to result in a direct corelation to the resulting bitrate, and that messes with my head xD.


Re: OPUS compression ratio vs samplerate/channels

Reply #3
I don't know, foobar2000 did it for me. Right click menu -> quick convert. I tried to do it by command line with the encoder shipped with foobar2000 v1.3.17

opusenc.exe 11025-mono.wav 11025-mono.opus
opusenc.exe 11025.wav 11025.opus
opusenc.exe 22500-mono.wav 22500-mono.opus
opusenc.exe 22500.wav 22500.opus
opusenc.exe 44100-mono.wav 44100-mono.opus
opusenc.exe 44100.wav 44100.opus

That gave me this instead which is much better (only 11025.opus and 22500-mono.opus swap places)

139KB   11025-mono.opus
180KB   22500-mono.opus
195KB   11025.opus
238KB   22500.opus
299KB   44100-mono.opus
367KB   44100.opus

So foobar2000 is to blame.

 

Re: OPUS compression ratio vs samplerate/channels

Reply #4
So foobar2000 is to blame.

What most likely happened is that it resampled to 48 kHz before feeding the audio to the Opus encoder, so the encoder didn't know about the filtering. There's code to detect filtered signals, but it's quite conservative and sometimes it can mistake filter aliasing for useful content and still spend bits encoding it. Not to mention that in the end, you still get the bitrate you asked for (kinda of).