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