spacepaste

  1.  
  2. # create a list of concatencated videos
  3. with open(video_list, 'w') as f:
  4. f.write('file ' + video_black + '\n' +
  5. 'file ' + video_timescaled + '\n')
  6. # ffmpeg -f concat -i list.txt -c copy merged.mp4
  7. args_concat = ['ffmpeg', '-y', '-f', 'concat', '-safe', '0',
  8. '-i', video_list, '-c', 'copy', '-threads', '0',
  9. video_with_black]
  10. subprocess.run(args_concat, check=True)
  11.