GNOME Bugzilla – Bug 626285
'lame' element is deprecated, should use 'lamemp3enc' instead
Last modified: 2010-11-26 01:31:14 UTC
The 'lame' encoder element has been deprecated from gstreamer (see http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-ugly-plugins/html/gst-plugins-ugly-plugins-lame.html ). This should be replaced by the 'lamemp3enc' element, which has a simpler interface and defaults to higher quality mp3s: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-ugly-plugins/html/gst-plugins-ugly-plugins-lamemp3enc.html
Created attachment 173607 [details] [review] gstreamer lame => lamemp3enc I have written a patch that replaces lame with lamemp3enc. It was necessary to remove average bitrate and presets, as lamemp3enc doesn't seem to support those. Nevertheless, VBR and CBR work fine so far.
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-ugly-plugins/html/gst-plugins-ugly-plugins-lamemp3enc.html says that it does implement GstPreset -- not sure if that's replacing the old preset property, though.
I read that too, but didn't find any further information about GstPreset. Overall, i think its enough to have banshee's own default values, users who wish to tweak the quality should be satisfied with either cbr or vbr
Created attachment 173654 [details] [review] Better Patch ;-P Better commit message
Created attachment 173655 [details] [review] This one should be ok. Hope this patch is ok
I am happy to see you working on this Raimo, could you please check with this bug[1] to ensure that we do not encode lower than expected quality for vbr mode. [1] https://bugzilla.gnome.org/show_bug.cgi?id=482776
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-ugly-plugins/html/gst-plugins-ugly-plugins-lamemp3enc.html As far as I see lamemp3enc does not offer anything like vbr-max/min settings. Its so basic, i even had to remove presets from the whole audio-profile. It seems to only understand cbr and vbr quality (not even abr) About the encoding quality: I'm not at home but i will do some encodings to try this later.
Test Case: - Encode from CD to WAV, MP3 with V0 and MP3 with V9 - Take WAV and manually encode with lame to MP3 with V0 and V9 Results: -rwxr-xr-x 1 raimo root 2198535 2010-11-05 16:04 01. Genesis-Lame-V0.mp3 -rwxr-xr-x 1 raimo root 2199951 2010-11-05 15:53 01. Genesis-Banshee-V0.mp3 -rwxr-xr-x 1 raimo root 606989 2010-11-05 16:07 01. Genesis-Lame-V9.mp3 -rwxr-xr-x 1 raimo root 608614 2010-11-05 16:06 01. Genesis-Banshee-V9.mp3 Guess those few (kilo)bytes difference are due to the metadata.
As someone who was actively looking at bug 482776, I should add that the main issue in that bug seemed to resolve itself at some point after my last comment there, due to a fix in gstreamer (it started using lame's default vbr-min-bitrate and vbr-max-bitrate values, instead of its own weird ones). Raimo, given your test results, it definitely looks like you've got VBR working right. There were a couple of additional issues that I had addressed in my patches on that bug: 1. ABR is currently all wrong. The idea with ABR is that you're supposed to specify your target average bit rate, and lame attempts to hit that target using variable bit rate encoding. Specifying a quality does nothing, and so all ABR encoding is done with a default target bitrate (128k, no doubt). But since ABR isn't available in lamemp3enc and you're removing this mode, I suppose this won't be an issue anymore. Yay! 2. I thought the label "VBR Mode" wasn't very good, since one option, Constant Bitrate, isn't a VBR mode. Also, VBR is an acronym that might not be familiar to the user. So, in my patch, I changed that label to just "Mode" and the "VBR Quality" label to just "Quality". I would suggest doing the same in the new patch. Finally, regarding the lack of support for presets, I should point out that those are just aliases. So you could keep them and do the translation manually, but I'd say losing them wouldn't be that bad. Medium: -V 4 Standard: -V 2 Extreme: -V 0 Insane: -b 320 Source: http://wiki.hydrogenaudio.org/index.php?title=LAME Thanks to Raimo for doing this work and to David for mentioning it on the other bug!
Created attachment 173915 [details] [review] gstreamer lame => lamemp3enc + naming fix Thanks Dave for pointing out the naming mistake. Imho the whole encoding part of Banshee is way too userfriendly (e.g. i would like to have a custom naming template and a seperate directory, but thats a different issue). I think it makes sense to offer the same slider as other plugins feature. I noticed that LAME uses V2 as default for encoding, which makes sense to me. I therefore changed the default value for vbr_quality to 7 (9-7 => 2 ;) ).
Looks sane to me. Using my N900 to test as a transcoding target, valid high quality mp3s were created which played back without issue. Great work Raimo.
Review of attachment 173915 [details] [review]: Looks good to me
Review of attachment 173915 [details] [review]: Looks good thanks