[MEncoder-users] Backup policies

James Hastings-Trew jimht at shaw.ca
Sat Nov 17 22:49:58 CET 2007


infernix wrote:
> Ross Clement wrote:
>   
>> I'm sure I'll be able to steal many of your option settings and reuse
>> them. Particularly if I install or have x264.
>>     
>
> Here's a commandline that will give you near-lossless x264 encodes with 
> mencoder. Depending on your usage you might want to turn off bframes 
> completely, but if you convert to a different format anyway before you 
> edit, leave as is.
>
> CRF determines the quality here. I'd say 15 is as lossless as you can 
> get, but I use 18 on nearly everything, sometimes even 19. Experiment 
> with 10 and 18 and see if you can tell the difference. Generally, <15 is 
> considered a waste of bits, but YMMV depending on the source.
>
> m4g_hrm_v2.cfg is a custom matrix, find it on forum.doom9.org. for very 
> grainy material, you should search for prestige_cqm.cfg as it is 
> superior for grain preservation.
>
> CRF=18
> THREADS=$number_of_cores+1 or auto
> DEBLOCK=-3,-3
> OUTFILE=destination.264
> INFILE=source.avi
>
> mencoder -vf scale -oac pcm -nosound -lavdopts threads=2 -x264encopts 
> crf=$CRF:threads=$THREADS:cqm=m4g_hrm_v2.cfg:deblock=$DEBLOCK:bframes=3:b_pyramid:bime:weight_b:brdo:me=umh:frameref=5:mixed_refs:subq=7:trellis=1:8x8dct:nofast_pskip:nopsnr:nossim:direct_pred=auto 
> -ovc x264 -of rawvideo -o $OUTFILE $INFILE
I've done some playing with a variation of this command line and I do 
have to say, in situations where you don't care about the final file 
size or bitrate, this does produce a very high quality encode in about 
half the time of a two-pass. Here is my variation of it, eliminating 
bframe options and tweaked slightly for speed (since I am mostly 
encoding for the AppleTV at this point, which does not allow bframes) - 
(this is for a wide-aspect telecined NTSC DVD with no cropping).:

set crf=18
set threads=%NUMBER_OF_PROCESSORS%
set deblock=-3.-3
set outfile=destination.mp4
set infile=DVD://3 -aid 128
set scale=848:480
set idclevel=31

mencoder %infile% -sws 9 -of lavf -lavfopts format=mp4 /
-vf pullup,softskip,pp=lb,scale=%scale%,dsize=%scale%,harddup /
-oac faac -faacopts mpeg=4:object=2:br=160:raw -channels 2 -srate 48000 
-ovc x264 -x264encopts /
crf=%crf%:cqm=m4g_hrm_v2.cfg:deblock=%deblock%:me=umh:frameref=6:mixed_refs:subq=6:/
trellis=1:8x8dct:nofast_pskip:nocabac:global_header:level_idc=%idclevel%:threads=%threads% 
/
-ofps 24000/1001 -o temp.mp4

nicmp4box -add temp.mp4 %outfile%
del temp.mp4 >NUL

Works like a charm and the results are very high quality.





More information about the MEncoder-users mailing list