Skip to content

Instantly share code, notes, and snippets.

@VadimBrodsky
Last active January 21, 2021 03:56
Show Gist options
  • Save VadimBrodsky/7ae106608d195666133d90f7bc1c377f to your computer and use it in GitHub Desktop.
Save VadimBrodsky/7ae106608d195666133d90f7bc1c377f to your computer and use it in GitHub Desktop.
ffmpeg concat
# ffmpeg -f concat -safe 0 -i files.txt -codec copy output.mov
# ffmpeg -safe 0 -f concat -segment_time_metadata 1 -i file.txt -vf select=concatdec_select -af aselect=concatdec_select,aresample=async=1 out.mp4
# ffmpeg -i "concat:source-1-int.ts|source-2-int.ts|source-3-int.ts" -c copy output.ts
# ffmpeg -f concat -safe 0 -i files.txt -c copy -bsf:v h264_mp4toannexb -f mpegts output-transcode.ts
# https://stackoverflow.com/questions/15908328/ffmpeg-to-combine-two-mov-files-from-iphone
# ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
# ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
# ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4
# ffmpeg -i source-1.mov -q 0 source-1.mts
ffconcat version 1.0
file './source-1.mov'
# inpoint -0.047891
# file './source-1.mts'
# inpoint 00:00
# outpoint 00:00
# duration 00:00:04.64
# Duration: 00:00:04.64, start: 0.000000, bitrate: 8783 kb/s
# Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 8686 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
file './source-2.mov'
# file './source-2.mts'
# duration 00:00:07.81
# Duration: 00:00:07.81, start: 0.000000, bitrate: 8435 kb/s
# Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 8342 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
file './source-3.mov'
# file './source-3.mts'
# duration 00:00:10.51
# Duration: 00:00:10.51, start: 0.000000, bitrate: 8360 kb/s
# Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 8265 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment