Skip to content

Instantly share code, notes, and snippets.

@rsnk96
Created October 21, 2018 17:08
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 rsnk96/85995fe5e6ec171c9dca699c0f0dbb8c to your computer and use it in GitHub Desktop.
Save rsnk96/85995fe5e6ec171c9dca699c0f0dbb8c to your computer and use it in GitHub Desktop.
Merging indexed video fragments
import subprocess as sp
with open("temp_files.txt", "w") as f:
for t in ["output_{}.avi".format(i) for i in range(num_processes)]:
f.write("file {} \n".format(t))
ffmpeg_command = "ffmpeg -f concat -safe 0 -i temp_files.txt -vcodec copy"
sp.Popen(ffmpeg_command, shell=True).wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment