- ExifTool on macOS: Sync Photo & Video Metadata Fast
ExifTool on macOS: Sync Photo & Video Metadata Fast
Step-by-step ExifTool workflow to copy EXIF/XMP/IPTC, fix FileModifyDate, and align Finder dates for JPG & MP4

📚 Get Practical Development Guides
Join developers getting comprehensive guides, code examples, optimization tips, and time-saving prompts to accelerate their development workflow.
Related Posts:
I was batch-optimizing a photo/video library for sharing when I noticed two things immediately: the optimized files had lost useful metadata, and Finder was suddenly convinced everything was captured “today”. After chasing it for a bit, the fix turned out to be straightforward: copy metadata from the originals back onto the optimized files, then align the optimized files’ filesystem timestamps to the capture/recording time.
This guide shows the exact workflow I use on macOS with exiftool.
What we’re fixing
When you compress, resize, or re-encode media, you usually end up with:
- Missing or altered metadata (EXIF/XMP/IPTC for photos, QuickTime dates for videos).
- Wrong filesystem timestamps (so Finder sorts by “today” instead of the real capture date).
The goal is to keep your originals untouched as the source of truth, and make the optimized copies look like the originals to both metadata readers and Finder.
Prerequisites
Install ExifTool:
brew install exiftool
Set up your folders like this (optimized files in a subfolder, with matching basenames):
/path/to/media/ DSC03873.JPG C0342.MP4 optimized/ DSC03873.JPG C0342.mp4
From here on, every command runs inside optimized/ and writes only to the optimized files.
Part 1 — Photos (JPG)
Step 1 — Copy metadata from originals to optimized photos
This step copies the tags that usually matter in practice: capture date, camera info, keywords/captions, orientation, and other EXIF/XMP/IPTC fields.
# Working directory: /path/to/media/optimized
cd "/path/to/media/optimized"
# JPG (matches .JPG and .jpg)
exiftool -overwrite_original -P \
-TagsFromFile "../%f.%e" \
-Exif -XMP -IPTC -IFD0 -IFD1 \
*.[Jj][Pp][Gg]
-TagsFromFile "../%f.%e" is the key: %f is the filename without extension, and %e is the extension. So optimized/DSC03873.JPG pulls tags from ../DSC03873.JPG.
Once this finishes, your optimized photos should have the same embedded metadata as the originals. Next we’ll fix what Finder uses for date-based sorting.
Step 2 — Make Finder dates match the capture time
Finder (and a lot of tooling) relies on filesystem timestamps. After optimization, those timestamps usually reflect when the optimized file was generated. I set the optimized file’s modification time to match DateTimeOriginal.
# Working directory: /path/to/media/optimized
cd "/path/to/media/optimized"
exiftool -overwrite_original -P "-FileModifyDate<DateTimeOriginal" *.[Jj][Pp][Gg]
At this point, both the embedded capture date and the file modification time should line up with the original photo.
Step 3 — Sanity check one file
# File paths:
# - Original: /path/to/media/DSC03873.JPG
# - Optimized: /path/to/media/optimized/DSC03873.JPG
exiftool -DateTimeOriginal -Make -Model "/path/to/media/DSC03873.JPG"
exiftool -DateTimeOriginal -Make -Model -FileModifyDate "/path/to/media/optimized/DSC03873.JPG"
You’re looking for DateTimeOriginal (and optionally Make/Model) to match between the two, and for the optimized file’s FileModifyDate to match its DateTimeOriginal.
Part 2 — Videos (MP4)
Step 1 — Copy metadata from originals to optimized videos
For MP4s, I start by copying what’s writable from the original container (QuickTime dates plus any XMP/IPTC that exists).
# Working directory: /path/to/media/optimized
cd "/path/to/media/optimized"
exiftool -overwrite_original -P \
-TagsFromFile "../%f.%e" \
-XMP:All -IPTC:All -QuickTime:All \
*.[Mm][Pp]4
If your optimized videos already have the right recording date after this step, skip the XML sidecar step and go straight to syncing filesystem timestamps.
Step 2 (Optional) — Override CreateDate using XML sidecars
Some cameras export sidecar files like C0342M01.XML with a CreationDate value that’s more trustworthy than what ends up in the MP4. If you have those XML files and your video dates still look wrong, this loop extracts CreationDate from each sidecar and writes it into the matching optimized MP4.
# Working directory: /path/to/media/optimized
cd "/path/to/media/optimized"
for xml_file in ../*M01.XML; do
video_opt="./$(basename "$xml_file" M01.XML).mp4"
creation_date="$(grep 'CreationDate value=' "$xml_file" | sed 's/.*value=\"\\([^\"]*\\)\".*/\\1/')"
if [ -n "$creation_date" ] && [ -f "$video_opt" ]; then
exiftool -overwrite_original -P "-CreateDate=$creation_date" "$video_opt"
fi
done
This keeps the mapping simple: ../C0342M01.XML updates ./C0342.mp4. If your naming differs, adjust the video_opt line accordingly.
Step 3 — Make Finder dates match the recording time
Now align the optimized videos’ filesystem modification time to the embedded CreateDate:
# Working directory: /path/to/media/optimized
cd "/path/to/media/optimized"
exiftool -overwrite_original -P "-FileModifyDate<CreateDate" *.[Mm][Pp]4
Step 4 — Sanity check one video
# File path: /path/to/media/optimized/C0342.mp4
exiftool -CreateDate -FileModifyDate "/path/to/media/optimized/C0342.mp4"
If the times look “off by a couple hours”, it’s usually timezone display. ExifTool will show the stored timezone offset (when present); Finder may render the same moment in your system timezone.
Troubleshooting
If ExifTool prints “File not found” warnings, it almost always means the optimized/ file doesn’t have an exact name match in the parent folder. Double-check that you’re running from optimized/ and that basenames and extensions match.
If Finder still shows “today”, make sure you ran the filesystem timestamp step (-FileModifyDate<...). Also note that Finder has multiple date columns; this workflow intentionally targets embedded capture/recording metadata plus filesystem modification time.
Conclusion
If you follow the steps above, you end up with optimized photos and videos that keep the important embedded metadata from the originals, and that sort correctly in Finder because their filesystem modification times match the real capture/recording dates. You now have a repeatable ExifTool workflow for syncing metadata from a parent “originals” folder into an optimized/ folder, including the optional XML-sidecar override for MP4 CreateDate.
Let me know in the comments if you have questions, and subscribe for more practical development guides.
Thanks, Matija
Last updated: 2026-02-18


