opusenc : problem sample causes clipping
Encoding this 10 second pcm wav sample with opusenc 0.1.6 causes obvious clipping (repeated clicks in right channel) from about 7 seconds.
I tried default: opusenc sample.wav sample.opus
That produced a file opusinfo shows as: Average bitrate: 124.4 kb/s, w/o overhead: 123.3 kb/s
then I tried: opusenc --bitrate 160 sample.wav sample_160.opus
That produced a file opusinfo shows as: Average bitrate: 198 kb/s, w/o overhead: 196.8 kb/s
The 160 target file also clips.
Then I tried: opusenc --bitrate 192 sample.wav sample_192.opus
That produced a file opusinfo shows as: Average bitrate: 229.2 kb/s, w/o overhead: 227.7 kb/s
That plays without clipping. This is quite similar to Ogg Vorbis which on the same sample clips at -q 6 but is OK at -q 7. The sample is pcm from my retail CD and hasn't been touched by a lossy encoder. I've compressed it to flac for attachment.
Here are examples of what I did so you can see the version I'm using:
$ opusenc sample.wav sample.opus Skipping chunk of type "LIST", length 26 Encoding using libopus 1.1-alpha (audio)
Input: 44.1kHz 2 channels Output: 2 channels (2 coupled) 20ms packets, 96kbit/sec VBR Preskip: 356
Encoded: 10.02 seconds Runtime: 1 seconds (10.02x realtime) Wrote: 155636 bytes, 501 packets, 13 pages Bitrate: 123.112kbit/s (without overhead)
Rate range: 92.8kbit/s to 193.6kbit/s (232 to 484 bytes per packet) Overhead: 0.924% (container+metadata)
$ opusinfo sample.opus Processing file "sample.opus"...
New logical stream (#1, serial: 1ce42e69): type opus Encoded with libopus 1.1-alpha User comments section follows... ENCODER=opusenc from opus-tools 0.1.6 Opus stream 1: Pre-skip: 356 Playback gain: 0 dB Channels: 2 Original sample rate: 44100Hz Packet duration: 20.0ms (max), 20.0ms (avg), 20.0ms (min) Page duration: 1000.0ms (max), 910.9ms (avg), 20.0ms (min) Total data length: 155636 bytes (overhead: 0.924%) Playback length: 0m:10.007s Average bitrate: 124.4 kb/s, w/o overhead: 123.3 kb/s Logical stream 1 ended
This is on i386 Debian Wheezy/Testing on AMD Athlon64 CPU. I built opus-tools from the tarball supplied at http://www.opus-codec.org/downloads.
I also built ffmpeg and opus from current git (yesterday) and get identical results when using ffmpeg -c:a libopus.
I tried playback/decoding with and without software sample rate conversion and ruled out any possibility of sample rate conversion artefacts. I got the same clipping whether running opusdec alone or doing 'opusdec sample.opus --force-wav - |mplayer -'