[MEncoder-users] How concatenate several MPEG2 clips

Gennady Ovcharov henadzi.aucharou at vpi-minsk.com
Wed Nov 29 12:07:15 CET 2006


Nico Sabbi пишет:
> Gennady Ovcharov wrote:
>
>> Hi Ladies and Gentlemen!
>>
>> I want concatenate several MPEG2 clips in one MPEG2 file
>> mencoder version: MEncoder 1.0rc1-3.3.3
>>
>> I prepared 10 clips as:
>> mencoder [1..10].avi -o [1..10].mpg \
>>    -vf softskip,scale=352:576,harddup,smartblur=0.3:1:0 \
>>    -of mpeg -mpegopts format=dvd -srate 48000 -af lavcresample=48000 
>> -ofps 25 \
>>    -ovc lavc -oac lavc \
>>    -lavcopts 
>> vcodec=mpeg2video:aspect=4/3:vrc_buf_size=1835:vrc_maxrate=9800:\
>>        
>> vbitrate=2000:keyint=15:acodec=ac3:abitrate=192:trell:mbd=2:dc=10:cbp:mv0:vstrict=1 
>>
>>
>> ... and make:
>> cat *.mpg | mencoder -of mpeg -ovc copy -oac copy -o ../big.mpg -
>>
>> O-o-p-s :(
>>
>> on stdout i see:
>> ...
>>
>> BUFFER UNDEFLOW at stream 1, raising muxrate to 2898 kb/s, delta_scr: 
>> 152597
>> ERROR: scr 15.597, dts 0.000, pts 15.472
>> ERROR: scr 15.636, dts 15.480, pts 15.520
>> Pos:  15.9s    390f ( 0%)  0.00fps Trem:   0min   0mb  A-V:-0.063 
>> [1249:192]
>> ...
>
>
> specify the :format option in -mpegopts (e.g. format=dvd:tsaf)
>
>>
>> In result I have big.mpg. On border between clips - boxing artifacts 
>> and disalignment A/V :(
>>
>> I attempt
>>    cat *.mpg | mencoder -of mpeg -mpegopts -format=dvd -ovc copy -oac 
>> copy -o ../big.mpg -
>> and
>>    cat *.mpg | mencoder -of mpeg -ovc copy -oac copy -forceidx -o 
>> ../big.mpg -
>>
> don't. rather use
> mencoder -of mpeg -ovc copy -oac copy -mpegopts format=dvd:tsaf -o 
> final.mpg file1.mpg file2.mpg...
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
>
Thanks for you answer
You are GENIUS !

I  rebuild all  clips as:
mencoder "${src}" -o "out_${src}.mpg" \
    -vf softskip,scale=352:576,harddup,smartblur=0.3:1:0 \
    -of mpeg -mpegopts format=dvd:*tsaf* -srate 48000 -af 
lavcresample=48000 -ofps 25 \
    -ovc lavc -oac lavc \
    -lavcopts 
vcodec=mpeg2video:aspect=4/3:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=2000:keyint=15:/
        acodec=ac3:abitrate=192:trell:mbd=2:dc=10:cbp:mv0:vstrict=1

and
    mencoder *.mpg -o ../final.mpg -of mpeg -ovc copy -oac copy 
-mpegopts format=dvd:*tsaf*

final.mpg - file without any problem :)

# ==========================================
Really wrong way:
    cat *.mpg | mencoder -o ../final3.mpg -of mpeg -ovc copy -oac copy 
-mpegopts format=dvd:tsaf -

# ls -l
-rw-r--r--   1 gonza     video     211255296 Nov 29 12:39 final.mpg
-rw-r--r--   1 gonza     video     210890752 Nov 29 12:52 final3.mpg
# ==========================================

regards,

Gennady Ovcharov



More information about the MEncoder-users mailing list