Skip to content

Instantly share code, notes, and snippets.

@santiblanko
Created April 21, 2014 23:31
Show Gist options
  • Save santiblanko/11160111 to your computer and use it in GitHub Desktop.
Save santiblanko/11160111 to your computer and use it in GitHub Desktop.
###############################
#
# FFmpeg Concatenation Strategies
#
# these examples based on FFmpeg wiki page:
# https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files
#
# brew install ffmpeg
# brew upgrade ffmpeg
#
# joe, Apr 2014
#
###############################
#------------------------------
#--- EXAMPLE: single line concat with standard concat protocol ---#
# This example only available for files that are the same type
# AND that are MPG and MPEG transport streams:
# ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output.mpg
#------------------------------
#--- EXAMPLE: single line concat with concat demuxer ---#
# This example for files that are of the same type
# but is much more flexible as far as what filetype that is:
# ffmpeg -f concat -i <(for f in ~/Documents/ffmpegTests/src/*.mov; do echo "file '$f'"; done) -c copy output.mov
#------------------------------
#--- EXAMPLE: Demuxer: list.txt with concat demuxer ---#
# this file named 'mylist.txt'
# all files to be concatenated:
file 'input1.mov'
file 'input2.mov'
file 'input3.mov'
# note: can be relative path or absolute paths.
# then run:
# ffmpeg -f concat -i mylist.txt -c copy output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment