[MEncoder-users] What's wrong with this script (encoding x264 in mkv-container)

Stjepan Brbot stjepan.brbot at gmail.com
Thu Mar 26 00:19:01 CET 2009

On Sun, 2009-03-22 at 21:10 +0100, Al Bogner wrote:
> If I replace *.mpg with 1 existing filename, the script works. What do I have 
> to do to encode a few mpg-files to 1 mkv-file? Any improvement of the options 
> are welcome of course!

for i in *.mpg; do

 #1st pass
 mencoder $i -aspect 16/9 \
 -vf yadif=0,softskip,harddup -nosound \
 -ovc x264 -x264encopts bitrate=3500:subq=5:bframes=3:b_pyramid:weight_b:turbo=1:threads=auto:pass=1 \
 -of rawvideo -o /dev/null

 #2nd pass
 mencoder $i -aspect 16/9 \
 -vf yadif=0,softskip,harddup -nosound \
 -ovc x264 -x264encopts bitrate=3500:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:threads=auto:pass=2 \
 -of rawvideo -o tmp.264

 #audio pass
 mencoder $i -of rawaudio -oac mp3lame -lameopts preset=standard -ovc copy -o tmp.mp3

 #MKV muxing
 mkvmerge -o $i.mkv tmp.264 tmp.mp3

 rm tmp.mp3
 rm tmp.264
 rm divx2pass.log


More information about the MEncoder-users mailing list