opus icon indicating copy to clipboard operation
opus copied to clipboard

Poor stereo handling with --hard-cbr and short frames

Open jcj83429 opened this issue 3 years ago • 2 comments

When --hard-cbr and short frame sizes (10ms or less) are used together, stereo content is handled poorly.

  • With --hard-cbr --framesize 10 --bitrate 128, there are significant spectral holes in the mid channel, resulting in poor mono compatibility.
  • With --hard-cbr --framesize 10 --bitrate 128 --no-phase-inv, the side channel is lowpassed at about 3kHz, resulting in loss of stereo image.

With 10ms frames, the problem persists at 256kbps but disappears at 512kbps. With 5ms frames, even 512kbps is not enough to get rid of the problem.

These problems only show up if both --hard-cbr and short frame sizes are used. If (C)VBR or 20ms frames are used, then stereo content is handled well.

BTW I looked at the encoded opus files in a hex editor, and the --hard-cbr --framesize 5 --bitrate 512 file has regularly occurring strings of zeros throughout the file occupying about 40% of the space.

jcj83429 avatar May 24 '22 21:05 jcj83429

Are you using an up to date libopus? I fixed this one two years ago, and it sounds exactly like what you describe. Looks like there hasn't been a libopus release since then, though... maybe try the latest Git version and see if it's fixed?

marcan avatar Jul 03 '22 05:07 marcan

Sorry I forgot to mention the version. I was using libopus 1.3.1. I just tested the latest version from git and I can confirm the fix. Perhaps it's time to do a release.

Thanks.

jcj83429 avatar Jul 03 '22 19:07 jcj83429