1030Concatenating Videos with ffmpeg

Concatenating videos with the Quicktime Player requires unnecessary decoding/encoding, with takes time and computational resources.

Solution: Concatente Files von FFMPEG

https://trac.ffmpeg.org/wiki/Concatenate

Using ffmpeg

  1. Create a list: mylist.txt

    file '/path/to/file1.mp4'
    file '/path/to/file2.mp4'
    file '/path/to/file3.mp4'
  2. Run ffmpeg ffmpeg -f concat -i mylist.txt -c copy output.mp4

Troubleshooting

[concat @ 0x7fc407904080] Unsafe file name '2008-08-05 21_38_08.mov' mylist.txt: Operation not permitted

If filenames have a spaces, it is necessary to use the -safe 0 option.

mylist.txt

file '/path/to/file 1.mp4'
file '/path/to/file 2.mp4'
file '/path/to/file 3.mp4'

ffmpeg -safe 0 -f concat -i filelist.txt -c copy output.mp4

Make a list of all .mp4 files in a directory:

printf "file '%s'\n" *.mp4 > filelist.txt