Skip to content

Instantly share code, notes, and snippets.

@charliecm
Last active November 13, 2023 23:43
Show Gist options
  • Save charliecm/3562285d23b1ab4f57db to your computer and use it in GitHub Desktop.
Save charliecm/3562285d23b1ab4f57db to your computer and use it in GitHub Desktop.
Useful metadata editing and batch renaming snippets using exiftool.
# Change video date to "Creation Date" (written by iOS)
# Affected files will have a version with _original suffix
exiftool -ext m4v -ext mp4 "-CreationDate>FileModifyDate" "-CreationDate>CreateDate" "-CreationDate>ModifyDate" "-CreationDate>TrackCreateDate" "-CreationDate>TrackModifyDate" "-CreationDate>MediaCreateDate" "-CreationDate>MediaModifyDate" .
# Change video file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
# Replace -testname with -filename to confirm change
exiftool -ext m4v -ext mp4 -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
# Change CreateDate metadata of an image
exiftool "-CreateDate 2016:07:10 12:00:00" IMG.jpg
# Change JPG file names to date (e.g., 2015-10-Oct-28-10-28-31.m4v)
# Replace -testname with -filename to confirm change
exiftool -ext jpg -ext png -d "%Y-%m-%b-%d-%H-%M-%S%%-c.%%e" "-testname<CreateDate" .
# Add -r to perform operations recursively
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment