Skip to content

Instantly share code, notes, and snippets.

@jabooth
Last active September 7, 2015 09:34
Show Gist options
  • Save jabooth/6924a8d8c96320780d7c to your computer and use it in GitHub Desktop.
Save jabooth/6924a8d8c96320780d7c to your computer and use it in GitHub Desktop.
Mirror incremental files for ffmpeg
from pathlib import Path
from shutil import copy
# find all the jpg images in this dir (000.jpg, 001.jpg, ...)
paths = list(Path('./').glob('*.jpg'))
pathnames = sorted([p.stem for p in paths])
maxcount = int(pathnames[-1]) * 2 + 1 # get the new max cont
for path in paths:
i = int(path.stem)
copy(str(path), str(Path('./') / '{:03d}.jpg'.format(maxcount - i)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment