Opus files are encoded in hard-CBR
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| SoundConverter |
Medium
|
GautierPortet | ||
| soundconverter (Debian) |
Fix Released
|
Unknown
|
||
| soundconverter (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
Opusinfo tool shows that OPUS files produced by soundconverter use hard-CBR mode (instead of VBR).
Changed in soundconverter (Ubuntu): | |
assignee: | nobody → GautierPortet (kassoulet) |
Changed in soundconverter: | |
assignee: | nobody → GautierPortet (kassoulet) |
Changed in soundconverter (Ubuntu): | |
assignee: | GautierPortet (kassoulet) → nobody |
Changed in soundconverter: | |
status: | New → Confirmed |
Changed in soundconverter: | |
status: | Confirmed → In Progress |
Changed in soundconverter: | |
status: | In Progress → Confirmed |
Launchpad Janitor (janitor) wrote : | #2 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in soundconverter (Ubuntu): | |
status: | New → Confirmed |
Lem (lem-jjr) wrote : | #3 |
Soundconverter 2.1.2, in gstreamer.py, line 668 and 669:
def add_opus_
return 'opusenc bitrate=%s cbr=false ! oggmux' % (self.opus_quality * 1000)
Adding cbr=false seemed to result in a different output.
Encoded on Ubuntu 13.10 (unsure whether soundconverter 2.1.2 from source is using gstreamer 0.10 or 1.0), before adding cbr=false:
$ opusinfo 03\ -\ North\ Bound\ \(1\).opus
Processing file "03 - North Bound (1).opus"...
New logical stream (#1, serial: 7dc771f2): type opus
WARNING: Implausibly low preskip in Opus stream (1)
Encoded with Encoded with GStreamer Opusenc
User comments section follows...
TITLE=North Bound
ARTIST=Tony O'Connor
ALBUM=Seashore Sunrise
DISCNUMBER=1
DATE=1991-01-01
TRACKNUMBER=3
TRACKTOTAL=6
GENRE=New Age
DESCRIPTION=EAC FLAC -8
COMMENT=EAC FLAC -8
Opus stream 1:
Pre-skip: 0
Playback gain: 0 dB
Channels: 2
Original sample rate: 48000Hz
Packet duration: 20.0ms (max), 20.0ms (avg), 20.0ms (min)
Page duration: 260.0ms (max), 259.9ms (avg), 120.0ms (min)
Total data length: 5129508 bytes (overhead: 1.26%)
Playback length: 5m:16.539s
Average bitrate: 129.6 kb/s, w/o overhead: 128 kb/s (hard-CBR)
Logical stream 1 ended
After adding cbr=false:
$ opusinfo 03\ -\ North\ Bound\ \(2\).opus
Processing file "03 - North Bound (2).opus"...
New logical stream (#1, serial: 658e5e51): type opus
WARNING: Implausibly low preskip in Opus stream (1)
Encoded with Encoded with GStreamer Opusenc
User comments section follows...
TITLE=North Bound
ARTIST=Tony O'Connor
ALBUM=Seashore Sunrise
DISCNUMBER=1
DATE=1991
TRACKNUMBER=3
TRACKTOTAL=6
GENRE=New Age
DESCRIPTION=EAC FLAC -8
COMMENT=EAC FLAC -8
Opus stream 1:
Pre-skip: 0
Playback gain: 0 dB
Channels: 2
Original sample rate: 48000Hz
Packet duration: 20.0ms (max), 20.0ms (avg), 20.0ms (min)
Page duration: 280.0ms (max), 261.2ms (avg), 220.0ms (min)
Total data length: 5145176 bytes (overhead: 1.26%)
Playback length: 5m:16.539s
Average bitrate: 130 kb/s, w/o overhead: 128.4 kb/s
Logical stream 1 ended
However using opusenc (opus-tools 0.1.8) with --bitrate=128, I get a different file again:
$ opusinfo 03\ -\ North\ Bound.flac.opus
Processing file "03 - North Bound.flac.opus"...
New logical stream (#1, serial: 126ed0e5): type opus
Encoded with libopus 1.1
User comments section follows...
ENCODER=opusenc from opus-tools 0.1.8
ENCODER_
TITLE=North Bound
ARTIST=Tony O'Connor
ALBUM=Seashore Sunrise
DISCNUMBER=1
DATE=1991
TRACKNUMBER=03
TRACKTOTAL=06
GENRE=New Age
DESCRIPTION=EAC FLAC -8
COMMENT=EAC FLAC -8
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), 998.6ms (avg), 560.0ms (min)
Total data length: 5431593 bytes (overhead: 0.763%)
Playback length: 5m:16.533s
Average bitrate: 137.3 kb/s, w/o overhead: 136.2 kb/s
Logical stream 1 ended
Anyway, the different size/bitrate files might be due to opus version. But, was it really that simple to just add cbr=false?
Lem (lem-jjr) wrote : | #4 |
Oops, I forgot that adding cbr=false crashes Soundconverter. From the debug log:
launching: 'giosrc location=
Segmentation fault (core dumped)
I actually then launched the above command with gst-launch-1.0, that worked.
One more thing about the output from opusdec above, I noticed that the files were 48kHz (the source is definitely 44.1kHz), but I didn't have resampling enabled. opusenc itself didn't resample the FLAC to 48kHz.
GautierPortet (kassoulet) wrote : | #5 |
So hopefully this will be solved by using gstreamer 1.0...
Changed in soundconverter: | |
milestone: | none → 3.0 |
Changed in soundconverter: | |
status: | Confirmed → In Progress |
wayne (mathwhiz1212) wrote : | #6 |
I can't use soundconverter for conversion if this is the case. Wouldn't opusenc --vbr work?
Alexander Schlarb (alexander255) wrote : | #7 |
Just wanted to chime in. I needed to convert some music today and your tool worked almost perfectly for me. :+1:
Regarding this issue: I'm using `soundconverter` 3.0.0~alpha1+
GStreamer error when creating pipeline
gst_
After finding this issue, I did a short investigation and it turns out that the `cbr` option does not exist in GStreamer 1.0; instead the `bitrate-type` option was introduced:
bitrate-type : Bitrate type
Replacing `cbr=false` with `bitrate-type=vbr` resulted in a proper VBR Opus being generated:
Processing file "10 Running In Place.opus"...
New logical stream (#1, serial: 30e48d71): type opus
Encoded with Encoded with GStreamer opusenc
User comments section follows...
Opus stream 1:
Packet duration: 20.0ms (max), 20.0ms (avg), 20.0ms (min)
Page duration: 520.0ms (max), 185.3ms (avg), 120.0ms (min)
Total data length: 5144236 bytes (overhead: 1.6%)
Average bitrate: 190.6 kb/s, w/o overhead: 187.6 kb/s
Logical stream 1 ended
GautierPortet (kassoulet) wrote : | #8 |
Fix: https:/
Thanks Alexander !
Changed in soundconverter: | |
status: | In Progress → Fix Committed |
milestone: | 3.0 → 3.0.0-beta2 |
Changed in soundconverter (Debian): | |
status: | Unknown → New |
Changed in soundconverter (Debian): | |
status: | New → Fix Released |
Sebastian Ramacher (s-ramacher) wrote : | #9 |
Fixed in 3.0.0~beta1-1.
Changed in soundconverter (Ubuntu): | |
status: | Confirmed → Fix Released |
Changed in soundconverter: | |
status: | Fix Committed → Fix Released |
So I have to add cbr=false to opusenc. But there is a big problem here. It crashes GStreamer...