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

Stjepan Brbot stjepan.brbot at gmail.com
Fri Mar 27 09:55:25 CET 2009


Robert Ramiega wrote:
> On Thu, Mar 26, 2009 at 12:19:01AM +0100, Stjepan Brbot wrote:
>   
>> 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 
>>>       
>                                        ^^^^^^^^^^
>   
>> 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
>>     
>
>  Wouldn't this create separate mkv for each mpg file?
>
>   
Yes this will create separate mkv file for each combination of .264 and 
.mp3 files. Sorry, I haven't noticed that you needed only one mkv file. 
However, I don't know the syntax of mkvmerge app but can't this script 
be used in each iteration to append new created .264 and .mp3 to 
previously created mkv file?


More information about the MEncoder-users mailing list