mencoder part_*.avi -o concatenated.avi -ovc copy -oac copyThis should work nicely as long as all parts have been encoded with the same video and audio encoders, using similar encoding parameters.
Now, suppose that you've downloaded a bunch of MP4 video files from, say, youtube.com using a command line tool like get-flash-videos (highly recommended!), and you want to concatenate them into a single AVI file. But some of these files have different encoding parameters than the rest, so we need to re-encode the files such that their parameters match:
ls -1 part_*.mp4 | \
while read f ; do \
mencoder $f -o ${f/.mp4/.avi} -oac mp3lame -lameopts mode=2:cbr:br=128 \
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1200 \
-vf scale=720:480 -af volnorm=1 -ffourcc XVID -ofps 29.917; \
donewhere the parameters can be determined by examining the console output of MPlayer during playback of each file and selecting the parameters that match most files, in order to reduce quality loss as much as possible (you may find this script helpful).Re-encoding is a time consuming process, so unless you absolutely need these files concatenated (e.g. for playback using your DivX DVD player
mplayer -fs part_*.mp4
Ah! very nice article, I was wondering how to do it on linux and here it is.
ReplyDelete=D
Is there a limit on the avi's sizes?
Say 2gb ?
I dunno. Largest AVI I generated was a bit over 1GB.
ReplyDeleteI did a quick Google search and it seems that there's a 2GB size limit to the AVI format itself.
And there's also a limit on the file size, depending on the file system that's used to store the file (e.g. FAT32 limit is 4GB).