PDA

View Full Version : Audio track copy acting funny in 3 pass xvid encoding


waveking
31st March 2007, 14:28
Somehow my 3 pass encoding is not working as expected with Mencoder. The frameno.avi file has the audio in the correct format as expected(0x0055 MPEG-1 Layer 3 128 kbps), but the end movie has audio in a different format(0x0050 MPEG-1 Layer 2 224 kbps) altogether! Later analysis showed me that the final movie was getting the audio dirctly from the original source mpg, which has audio in MPEG-1 layer 2 format. I also tried adding the -audiofile option inthe two passes to point to the frameno.avi, and that adding an audio track with the correct format, but there was no content in the audio track :( Please help people!

Can anybody detect any thing i missed from my syntax below? Any other improvements to the encoding options i chose? I am converting recorded PAL TV shows to xvid for archiving.
Thanks.

REM rip audio track (bitrate: 128)
mencoder -oac mp3lame -lameopts mode=2:cbr:br=128:vol=3 -ovc frameno -o frameno.avi %input%

REM video track (pass: 1)
mencoder -sws 2 -oac copy -ovc xvid -xvidencopts pass=1:turbo -vf yadif,crop=704:560:4:6,scale=704:576 input.mpg -o output.avi

REM video track (pass: 2)
mencoder -sws 2 -oac copy -ovc xvid -xvidencopts pass=2:bitrate=%bitrate% -vf yadif,crop=704:560:4:6,scale=704:576 input.mpg -o output.avi

Mr_Odwin
31st March 2007, 16:25
I'm no Mencoder cli expert but it seems that you create an avi file with the mp3 audio in and then don't use it. Try this:

REM video track (pass: 1)
mencoder -sws 2 -oac mp3lame -lameopts mode=2:cbr:br=128:vol=3 -ovc xvid -xvidencopts pass=1:turbo -vf yadif,crop=704:560:4:6,scale=704:576 input.mpg -o output.avi

REM video track (pass: 2)
mencoder -sws 2 -oac mp3lame -lameopts mode=2:cbr:br=128:vol=3 -ovc xvid -xvidencopts pass=2:bitrate=%bitrate% -vf yadif,crop=704:560:4:6,scale=704:576 input.mpg -o output.avi

waveking
31st March 2007, 18:28
Yes, this method of the 2 pass way i had tried already and its working, but this makes mencoder to encode audio twice, right? Perhaps thats not needed, so was trying the 3 pass method, of encoding the audio only once. Trying to save CPU time, if can be :)

Mr_Odwin
31st March 2007, 18:37
Try this? (The audio is only encoded in the final pass.)

REM video track (pass: 1)
mencoder -sws 2 -oac copy -ovc xvid -xvidencopts pass=1:turbo -vf yadif,crop=704:560:4:6,scale=704:576 input.mpg -o output.avi

REM video track (pass: 2)
mencoder -sws 2 -oac mp3lame -lameopts mode=2:cbr:br=128:vol=3 -ovc xvid -xvidencopts pass=2:bitrate=%bitrate% -vf yadif,crop=704:560:4:6,scale=704:576 input.mpg -o output.avi

45tripp
31st March 2007, 18:49
I'd get rid of frameno.

REM extract pcm audio
mplayer %input% -ao pcm:fast:file=audio.wav -vc null -vo null

REM video track (pass: 1)
mencoder -sws 2 -nosound -ovc xvid -xvidencopts pass=1:turbo -vf yadif,crop=704:560:4:6,scale=704:576 input.mpg -o output.avi

REM video track (pass: 2)
mencoder -sws 2 -ovc xvid -xvidencopts pass=2:bitrate=%bitrate% -vf yadif,crop=704:560:4:6,scale=704:576 input.mpg -audiofile audio.wav -oac mp3lame -lameopts mode=2:cbr:br=128:vol=3 -o output.avi

waveking
1st April 2007, 02:47
This seems to be working...encoding with these options on full movie now.Thanks mr_odwin and immersion!