Skip to content

Instantly share code, notes, and snippets.

import subprocess
frames = 50
for frame in range(frames):
print(frame)
if frame == 0:
cmd = ['ffmpeg', '-y', '-i', 'test_source.mp4',
'-filter_complex',
'''[0]select='eq(n,0)'[A],[0]select='eq(n,1)'[B],[A][B]blend=all_mode=difference[out]''',
'-map', '[out]', '-vsync', '0', 'out.jpg']
subprocess.run(cmd)