-
-
Save jnx/5d0655e6f40416b2b984018fe2e7b2c3 to your computer and use it in GitHub Desktop.
exiftool : rename files in current dir to YYYY-MM-DD-HH-MM-SS-1.ext
This file contains hidden or 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
| # Rename JPG, CR2, and MOV files according to EXIF capture date in YYYY-MM-DD-HH-MM-SS | |
| format. | |
| # Files shot within the same second get copy number added (-1,-2, etc.). | |
| # Since iPhone video files appear to use GMT in CreateDate instead of local time, | |
| # we extract MediaModifyDate instead of CreateDate. | |
| # References: | |
| # http://www.sno.phy.queensu.ca/~phil/exiftool/ | |
| # http://ninedegreesbelow.com/photography/exiftool-commands.html#rename | |
| # http://www.polaine.com/2015/01/fixing-photo-and-video-file-metadata-with-exiftool/ | |
| exiftool -ext CR2 '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext JPG '-filename<CreateDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le .; exiftool -ext MOV '-filename<MediaModifyDate' -d %Y-%m-%d-%H-%M-%S%%-c.%%le . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment