Concatenate video files
mouse 407 · person cloud · link
Last update
2019-10-02
2019
10-02
«ffmpeg, mplayer/mencoder»

Use either of these commands to concatenate video files with the same codec and dimensions:

1
2
3
4
5
# mencoder
mencoder -oac copy -ovc copy -idx -o out.avi in*.avi

# ffmpeg
ls in*.avi | sed 's/.*/file \0/' | ffmpeg -f concat -c copy -i - out.avi

To concatenate video files with different codecs and/or dimensions you have to reencode all files choosing common codecs/dimensions:

1
mencoder -oac mp3lame -ovc x264 -idx -vf expand=640:640 -o out.avi in*.avi

Source: FFmpeg / ffmpeg@stackoverflow, Mencoder