PDA

View Full Version : Lame MP3 Encoding on Linux


Staz
16th December 2006, 02:01
Hi I am wanting to encode my DVD audio track to lame mp3.
This is the mencoder setting I use to rip the audio.

mencoder -dvd-device . dvd:// -aid <aid> -oac copy -of rawaudio -ovc copy -o test.ac3

But when I try to encode to mp3 using lame my result is a terrible screeching sound. Why is this? Also when lame is encoding the total frames is far less than it should me. eg : 24300/26094. There are far more frames than 26094 in the movie.

lame -V 5 --vbr-new test.ac3 test.mp3

I then tried using mencoder to output the audio track to PCM .wav

mplayer -dvd-device . dvd:// -vo null -vc dummy -ao pcm:file=output.wav

Then used lame again:

lame -V 5 --vbr-new output.wav test.mp3

The result actually sounded really good, but it was far quieter rips I have done on windows using robot4rip. Why is this? Also I heard that lame doesn't like to convert a 48khz source. Is this true? What is the best way to boost the audio on linux (get the optimal gain setting). I notice besweet has a -ota (-hybridgain) switch. What does this do and how can I closely replicate it on linux?

Thanks
Staz

shevegen
16th December 2006, 06:58
Yeah not sure why there is a screech but i have it also sometimes

i am using ffmpeg directly these days to get the audio from a DVD
especially if its already a .mp3 file

if its wav though, lame works always for me

d'Oursse
17th December 2006, 07:06
why don't you tell mencoder to convert your audio track directly to wav, instead of ac3 ?

echo
17th December 2006, 14:25
Lame does not accept ac3 as input. That's why you're getting the screeching sounds and you have less frames. Always export to wav and then encode with lame as you did in your second try. And yes it's true that lame is tuned for 44.1kHz material but works OK for 48kHz too. You could also use mp3gain to boost the volume without clipping the audio.

Staz
18th December 2006, 01:07
I have been getting perfect results by exporting to .wav with mencoder, encoding to vbr mp3 with lame and then by using the following command in mp3gain:

mp3gain -r -k
I get the maximum gain possible without any clipping at all! Thanks everyone :D

JVz
2nd January 2007, 17:20
Have you considered using MPlayer's built-in LAME support instead?

lpn1160
13th January 2007, 23:16
mplayer dvd://1 −alang en −dumpaudio −dumpfile audio.ac3 && ffmpeg -i audio.ac3 audio.wav && lame --abr 192 audio.wav

exit 0
clear