Philip Gruebele
2014-Feb-27 05:03 UTC
[opus] OPUS_SET_MAX_BANDWIDTH does not have expected results
Hi All. I am seeing the following unexpected behavior with OPUS_SET_MAX_BANDWIDTH. I expect that setting this to OPUS_BANDWIDTH_NARROWBAND would give similar results to passing an 8Khz sample rate stream, but OPUS_SET_MAX_BANDWIDTH has almost no effect with any settings. My test data has 4Khz bandwidth. I am testing the opus encoder (latest versions) with the following opus_encoder_ctl options: OPUS_SET_VBR=1, OPUS_SET_VBR_CONSTRAINT=unconstrained, OPUS_SET_COMPLEXITY=10, OPUS_APPLICATION_AUDIO, frame=60ms I compress 2 separate audio streams which only differ in the sample rate. One is 8Khz and the other is 16Khz. Both contain identical 4Khz bandwidth audio (the 16Khz file is a properly up-sampled copy of the 8Khz file). When compressing these, the 16Khz input generates about double the opus file size even though the audio content is identical. I found this to be unexpected since I expected VBR mode to care only about the incoming audio bandwidth and not the incoming sample rate. So I tried to use OPUS_SET_MAX_BANDWIDTH=OPUS_BANDWIDTH_NARROWBAND in order to explicitly tell opus that even though the stream is 16Khz, the stream bandwidth is only 4Khz. However, this does not change the opus file size for the 16Khz stream. In fact, the OPUS_SET_MAX_BANDWIDTH setting really has little effect regardless of which bandwidth I select with it. Is this a bug? Am I misunderstanding something here? Basically I will have a 16Khz stream in which the bandwidth will toggle between 4 and 8 Khz. I would like opus to optimally compress this, but based on these tests it appears that the vbr compression rate is linearly related to the input sample rate even though I expected it to be a function of the actual input audio bandwidth. Because of this shortcoming I am considering using ogg with opus links, and creating a new link every time the bandwidth changes and setting the sample rate to be 2x the bandwidth. This would generate better compressed output but is a much more complex solution so any advice would be greatly appreciated. Cheers Philip
Jean-Marc Valin
2014-Feb-27 11:13 UTC
[opus] OPUS_SET_MAX_BANDWIDTH does not have expected results
And what do you set OPUS_SET_BITRATE to? Jean-Marc On 27/02/14 12:03 AM, Philip Gruebele wrote:> Hi All. > > I am seeing the following unexpected behavior with > OPUS_SET_MAX_BANDWIDTH. I expect that setting this to > OPUS_BANDWIDTH_NARROWBAND would give similar results to passing an 8Khz > sample rate stream, but OPUS_SET_MAX_BANDWIDTH has almost no effect with > any settings. > > My test data has 4Khz bandwidth. I am testing the opus encoder (latest > versions) with the following opus_encoder_ctl options: OPUS_SET_VBR=1, > OPUS_SET_VBR_CONSTRAINT=unconstrained, OPUS_SET_COMPLEXITY=10, > OPUS_APPLICATION_AUDIO, frame=60ms > > I compress 2 separate audio streams which only differ in the sample > rate. One is 8Khz and the other is 16Khz. Both contain identical 4Khz > bandwidth audio (the 16Khz file is a properly up-sampled copy of the > 8Khz file). When compressing these, the 16Khz input generates about > double the opus file size even though the audio content is identical. I > found this to be unexpected since I expected VBR mode to care only about > the incoming audio bandwidth and not the incoming sample rate. > > So I tried to use OPUS_SET_MAX_BANDWIDTH=OPUS_BANDWIDTH_NARROWBAND in > order to explicitly tell opus that even though the stream is 16Khz, the > stream bandwidth is only 4Khz. However, this does not change the opus > file size for the 16Khz stream. In fact, the OPUS_SET_MAX_BANDWIDTH > setting really has little effect regardless of which bandwidth I select > with it. Is this a bug? Am I misunderstanding something here? > > Basically I will have a 16Khz stream in which the bandwidth will toggle > between 4 and 8 Khz. I would like opus to optimally compress this, but > based on these tests it appears that the vbr compression rate is > linearly related to the input sample rate even though I expected it to > be a function of the actual input audio bandwidth. Because of this > shortcoming I am considering using ogg with opus links, and creating a > new link every time the bandwidth changes and setting the sample rate to > be 2x the bandwidth. This would generate better compressed output but > is a much more complex solution so any advice would be greatly appreciated. > > Cheers > Philip > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus >
Seemingly Similar Threads
- Questions regarding OPUS_APPLICATION_AUDIO vs OPUS_BANDWIDTH_NARROWBAND
- adaptive bandwidth
- Ask for suggestions about optimizing opus on STM32F407
- Questions regarding OPUS_APPLICATION_AUDIO vs OPUS_BANDWIDTH_NARROWBAND
- Opus multi-stream/surround: Audio corruption on decoded content