GNOME Bugzilla – Bug 319782
Lame encoding is broken with vbr=vbr-new and vbr-quality=9
Last modified: 2006-02-16 17:19:51 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)
Can you try this with gstreamer 0.10? lame is in gst-plugins-ugly I think.
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.
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 ...
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;
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?
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
* 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.