After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319782 - Lame encoding is broken with vbr=vbr-new and vbr-quality=9
Lame encoding is broken with vbr=vbr-new and vbr-quality=9
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other All
: Normal normal
: 0.10.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-25 19:56 UTC by Gautier Portet
Modified: 2006-02-16 17:19 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
proposed patch (829 bytes, patch)
2006-01-27 20:48 UTC, Gautier Portet
none Details | Review

Description Gautier Portet 2005-10-25 19:56:18 UTC
Please describe the problem:
Lame encoding is broken with vbr=vbr-new and vbr-quality=9

with vbr-quality=8, it works!

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
ERROR (0x8277d98 - 313963:30:56.191153000)                 lame(25425)
gstlame.c(1134):gst_lame_setup:<encoder> lame_init_params returned -1
ERROR (0x8277d98 - 313963:30:56.191636000)                 lame(25425)
gstlame.c(1134):gst_lame_setup:<encoder> lame_init_params returned -1
ERROR (0x8277d98 - 313963:30:56.423685000)                 lame(25425)
gstlame.c(1134):gst_lame_setup:<encoder> lame_init_params returned -1
ERROR (0x8277d98 - 313963:30:56.623063000)                 lame(25425)
gstlame.c(1134):gst_lame_setup:<encoder> lame_init_params returned -1
ERROR (0x8277d98 - 313963:30:56.623170000)                 lame(25425)
gstlame.c(503):gst_lame_sink_link:<encoder> could not initialize encoder (wrong
parameters?)
ERROR (0x8277d98 - 313963:30:56.624010000)             GST_PADS(25425)
gstpad.c(2562):gst_pad_set_explicit_caps:<vorbisdec1> failed to negotiate
(try_set_caps with "audio/x-raw-float, rate=(int)44100, channels=(int)2,
endianness=(int)1234, width=(int)32, buffer-frames=(int)0" returned REFUSED)
Comment 1 Andy Wingo 2006-01-13 11:21:33 UTC
Can you try this with gstreamer 0.10? lame is in gst-plugins-ugly I think.
Comment 2 Gautier Portet 2006-01-13 22:24:34 UTC
it breaks with this simple pipeline:
gst-launch sinesrc ! lame vbr=4 vbr-quality=9 ! fakesink

with quality=8, it works.

This is with 0.8.8, I will try with a more recent version asap.
Comment 3 Gautier Portet 2006-01-14 16:25:22 UTC
Yes, it's the same with GStreamer 0.10:

$ gst-launch-0.10 audiotestsrc ! lame vbr=4 vbr-quality=9 ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR (0x8063168 - 0:00:00.057735000)                 lame(  594) gstlame.c(1124):gst_lame_setup:<lame0> lame_init_params returned -1
Pipeline is PREROLLED ...
ERROR: from element /pipeline0/lame0: Internal GStreamer error: negotiation problem.  Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.
Additional debug info:
gstlame.c(480): gst_lame_sink_setcaps: /pipeline0/lame0:
could not initialize encoder (wrong parameters?)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...
Comment 4 Gautier Portet 2006-01-14 21:52:26 UTC
After some hours playing with gdb, I've found the problem.

Lame switches to mpeg2 when encoding with VBR and low quality, so the max-bitrate set to 320 in gstlame is not valid since the max is 160 then.

To fix this, just change gstlame.c:531 to:
lame->vbr_max_bitrate = 0;
Comment 5 Andy Wingo 2006-01-27 14:55:13 UTC
Gautier, can you attach a patch against current CVS along with a changelog entry? Also can you verify that this works with other values of vbr-quality?
Comment 6 Gautier Portet 2006-01-27 20:48:30 UTC
Created attachment 58233 [details] [review]
proposed patch

Here is a patch against current cvs to fix this bug.

I tested it with vbr-quality from 0 to 9 to be sure it doesn't break vbr:

before:

test-0.mp3:     MPEG ADTS, layer III, v1, 160 kBits, 44.1 kHz, JntStereo
test-1.mp3:     MPEG ADTS, layer III, v1, 160 kBits, 44.1 kHz, JntStereo
test-2.mp3:     MPEG ADTS, layer III, v1, 128 kBits, 44.1 kHz, JntStereo
test-3.mp3:     MPEG ADTS, layer III, v1, 112 kBits, 44.1 kHz, JntStereo
test-4.mp3:     MPEG ADTS, layer III, v1,  96 kBits, 44.1 kHz, JntStereo
test-5.mp3:     MPEG ADTS, layer III, v1,  56 kBits, 44.1 kHz, JntStereo
test-6.mp3:     MPEG ADTS, layer III, v1,  56 kBits, 44.1 kHz, JntStereo
test-7.mp3:     MPEG ADTS, layer III, v1,  48 kBits, 32 kHz, JntStereo
test-8.mp3:     MPEG ADTS, layer III, v1,  40 kBits, 32 kHz, JntStereo
test-9.mp3:     empty (gst-lame breaks at init)

after:

test_new-0.mp3: MPEG ADTS, layer III, v1, 160 kBits, 44.1 kHz, JntStereo
test_new-1.mp3: MPEG ADTS, layer III, v1, 160 kBits, 44.1 kHz, JntStereo
test_new-2.mp3: MPEG ADTS, layer III, v1, 128 kBits, 44.1 kHz, JntStereo
test_new-3.mp3: MPEG ADTS, layer III, v1, 112 kBits, 44.1 kHz, JntStereo
test_new-4.mp3: MPEG ADTS, layer III, v1,  96 kBits, 44.1 kHz, JntStereo
test_new-5.mp3: MPEG ADTS, layer III, v1,  56 kBits, 44.1 kHz, JntStereo
test_new-6.mp3: MPEG ADTS, layer III, v1,  56 kBits, 44.1 kHz, JntStereo
test_new-7.mp3: MPEG ADTS, layer III, v1,  48 kBits, 32 kHz, JntStereo
test_new-8.mp3: MPEG ADTS, layer III, v1,  40 kBits, 32 kHz, JntStereo
test_new-9.mp3: MPEG ADTS, layer III, v2,   8 kBits, 24 kHz, JntStereo
Comment 7 Wim Taymans 2006-02-16 17:19:51 UTC
        * ext/lame/gstlame.c: (gst_lame_init), (gst_lame_chain),
        (gst_lame_change_state):
        Fix up lame a bit.
        Apply patch #319782 by Gautier Portet.