
map '' -map '' -c:v libx264 -crf 22 -preset veryfast -c:a libfdk_aac -vbr 3 -afterburner 1 output.mp4

If that doesn't work, or you want to combine videos of different types, you can use the Concat filter ffmpeg -i input1.flv -i input2.flv -i input3.flv -i input4.flv \ Then use the following command: ffmpeg -f concat -i inputs.txt -c copy output.flv This is probably the more useful answer to your question, since it is compatible with -c copy (and so should be lossless, and take an almost trivially short time to complete).įirst, create a file called inputs.txt containing the following: file '/path/to/input1.flv' If all your inputs are the same type of file (same codecs etc), then you can use the concat demuxer.

Fortunately, there are two really useful ways to concatenate files with ffmpeg. Using cat like that can cause unpredictable problems.
