Video Editing - KeynesYouDigIt/Knowledge GitHub Wiki

Trimming Videos

ffmpeg -t 00:55:19 -i input.flv -vcodec copy -acodec copy output.flv

  • -t HH:MM:SS is the duration of the video, use this to trim
  • -ss HH:MM:SS is the beginning of the video
  • -i is the input file
  • -vcodec copy and -acodec copy work on the stream directly, without any conversion
  • The last argument is the output file

Concatenating Videos

You have to put the filenames in a file first because the built-in concat doesn't work with .mp4 videos

$ cat mylist.txt
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
    
$ ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4