em500
5th April 2008, 12:19
The goal: (PAL) DVD compliant low resolution (D4 or 352x288) MPEG2
The tool: mencoder
I regularly encode a bunch of medium quality (resolution between VCD and DVD) inputs in various formats that mencoder understands (mostly RV10). I want them to convert them into standard DVDs, where fitting more hours on a disc ranks higher than getting best quality (which is why I'm downsizing to 352x288 rather than upsizing to 720x576). But of course I still want the best quality within these constraints. :) And I'd really like to do it all in mencoder without installing any other tools if at all possible. But mencoder has tons of options that are pretty confusing for amateurs.
What I've used so far is mainly based on mencoder documentation (http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html). I've also seen Sagittaire's batch files (http://forum.doom9.org/showthread.php?t=117655), but I don't really understand some of the advanced options. This is what I use now.
1st pass:
mencoder -oac lavc -ovc lavc (use lavc for everything)
-ofps 25 -of -mpeg -mpegopts format=dvd:tsaf (I want to make PAL DVDs)
-vf scale=352:288,harddup (VCD resolution is ok for me)
-srate 48000 -af lavcresample=48000 (resample audio to DVD rate)
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:me_range=128:keyint=15:vstrict=0 (options for DVD compliance)
:trell:mbd=2: precmp=2:subcmp=2:cmp=2:dia=-10: predia=-10:cbp:mv0:vqmin=1:lmin=1:dc=10 (quality enhancement according to mencoder docs)
:aspect=4/3 (probably redundant but harmless)
:vrc_maxrate=1800:vbitrate=1050 (VCD-like quality, fits about 9 hours on a DVD-5)
:vpass=1:turbo (first pass)
:acodec=ac3:abitrate=128 (low bitrate ac3 for audio, which is mainly dialog)
-o output.mpg input.rmvb (in and output names)
2nd pass command is the same, but with "vpass=1:turbo" replaced by "vpass=2"
This has worked pretty well for me, but I'm looking for improvements if possible. I haven't done anything with the more advanced options from Sagittaire, like B-frames or custom matrices, as I don't understand most of them, and the batch file seems more geared towards higher quality encodes. So I'm posting this to see if anyone can give me tips to improve on what I'm using now.
BTW, I think audio encoding in the first pass is superfluous, but mencoder complains if I left them out IIRC.
The tool: mencoder
I regularly encode a bunch of medium quality (resolution between VCD and DVD) inputs in various formats that mencoder understands (mostly RV10). I want them to convert them into standard DVDs, where fitting more hours on a disc ranks higher than getting best quality (which is why I'm downsizing to 352x288 rather than upsizing to 720x576). But of course I still want the best quality within these constraints. :) And I'd really like to do it all in mencoder without installing any other tools if at all possible. But mencoder has tons of options that are pretty confusing for amateurs.
What I've used so far is mainly based on mencoder documentation (http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html). I've also seen Sagittaire's batch files (http://forum.doom9.org/showthread.php?t=117655), but I don't really understand some of the advanced options. This is what I use now.
1st pass:
mencoder -oac lavc -ovc lavc (use lavc for everything)
-ofps 25 -of -mpeg -mpegopts format=dvd:tsaf (I want to make PAL DVDs)
-vf scale=352:288,harddup (VCD resolution is ok for me)
-srate 48000 -af lavcresample=48000 (resample audio to DVD rate)
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:me_range=128:keyint=15:vstrict=0 (options for DVD compliance)
:trell:mbd=2: precmp=2:subcmp=2:cmp=2:dia=-10: predia=-10:cbp:mv0:vqmin=1:lmin=1:dc=10 (quality enhancement according to mencoder docs)
:aspect=4/3 (probably redundant but harmless)
:vrc_maxrate=1800:vbitrate=1050 (VCD-like quality, fits about 9 hours on a DVD-5)
:vpass=1:turbo (first pass)
:acodec=ac3:abitrate=128 (low bitrate ac3 for audio, which is mainly dialog)
-o output.mpg input.rmvb (in and output names)
2nd pass command is the same, but with "vpass=1:turbo" replaced by "vpass=2"
This has worked pretty well for me, but I'm looking for improvements if possible. I haven't done anything with the more advanced options from Sagittaire, like B-frames or custom matrices, as I don't understand most of them, and the batch file seems more geared towards higher quality encodes. So I'm posting this to see if anyone can give me tips to improve on what I'm using now.
BTW, I think audio encoding in the first pass is superfluous, but mencoder complains if I left them out IIRC.