How can I batch-add EXIF timestamps that increase by a fixed interval?
Asked 2/20/2015
6 views
2 answers
0
I have thousands of image files with no usable date metadata. The files have no EXIF date fields, and their file modification times are all the same. The only ordering I have is the filename sequence, such as image-0001.jpg, image-0002.jpg, image-0003.jpg, etc.
I want to write a starting date/time to the images and then increment each subsequent photo by a fixed interval, for example 10 seconds between files. The exact starting date is not important; I just need the timestamps to follow the filename order.
Is there a practical way to do this in bulk on Windows, ideally with ExifTool?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
11y ago
2 Answers
11
There's already a similar question on the ExifTool forums. It can be done using two sequential ExifTool commands. First, make sure all the date to the same
exiftool -datetimeoriginal='2015:02:22 00:00:00' DIR
And then increment the time on each
exiftool '-datetimeoriginal+<0:0:${filesequence}0' DIR
This command creates backup files. Add -overwrite_original to suppress the creation of backup files. Add -r to recurse into subdirectories. If this command is run under Windows CMD, change the single quotes into double quotes.
Many of the other answers here involve looping and running exiftool once/twice per file. This is Exiftool Common Mistake #3. Exiftool's biggest performance hit is the startup time. When processing thousands of images, this will greatly increase the processing time.
Originally by user37960. Source · Licensed CC BY-SA 4.0
user37960
11y ago
0
Generated from our catalog & community — verify before relying on it.
Yes. ExifTool can do this efficiently in bulk, and it’s better to avoid looping one file at a time when processing thousands of images.
On Windows, first set the same base time for all files:
exiftool -datetimeoriginal="2015:01:01 12:00:00" DIR
Then add an increment based on file sequence. For a 10-second gap:
exiftool "-datetimeoriginal+<0:0:${filesequence;$_*=10}" DIR
Replace DIR with your folder path. Use 10 for 10 seconds; change that number for a different interval.
Notes:
- On Windows CMD, use double quotes, not single quotes.
- ExifTool creates backup files by default; add
-overwrite_originalif you don’t want them. - Add
-rif you need to process subfolders. - If you want all common photo date tags updated,
-alldatesmay also be useful instead of only-datetimeoriginal.
This assumes the filename order matches the desired image order.
Recommended products
UniqueBot
AI11y ago
Your Answer
Related Questions
How can I batch geotag JPGs from a CSV of filenames and coordinates on Windows?
How can I rename photo files using the EXIF capture date?
How can I avoid duplicate file names when importing and exporting in Lightroom?
How can I set EXIF date tags from the filename using ExifTool?
How can I find JPEGs where the EXIF capture year doesn’t match the year at the start of the filename?