Skip to content

Instantly share code, notes, and snippets.

@sahal
Created July 14, 2022 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahal/da9824eeb1aeeb28723b388a640ca8ca to your computer and use it in GitHub Desktop.
Save sahal/da9824eeb1aeeb28723b388a640ca8ca to your computer and use it in GitHub Desktop.
concatonate (merge) mp4s using ffmpeg

Get a list of files

  • Assuming the files have some sort of number indicating their order in their filename.
find $(pwd) -maxdepth 1 -type f -name "*.mp4" | xargs -I "{}" echo file \'"{}"\' | sort | tee output.txt

FFmpeg

date && time ffmpeg -f concat -safe 0 -i output.txt -c copy output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment