Last active
September 7, 2015 09:34
-
-
Save jabooth/6924a8d8c96320780d7c to your computer and use it in GitHub Desktop.
Mirror incremental files for ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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