• Home
BuildWithMatija
Get In Touch
  1. Home
  2. Blog
  3. Tools
  4. 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

27th February 2026·Updated on:22nd February 2026·MŽMatija Žiberna·
Tools
ExifTool on macOS: Sync Photo & Video Metadata Fast

📚 Get Practical Development Guides

Join developers getting comprehensive guides, code examples, optimization tips, and time-saving prompts to accelerate their development workflow.

No spam. Unsubscribe anytime.

Related Posts:

  • •Install Docker CLI on Mac with Colima — Fast Guide 2026
  • •Local DNS Override — Mirror a Production Domain Locally
  • •Ultimate Next.js Standalone Dockerfile Guide (Tiny Images)

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:

  1. Missing or altered metadata (EXIF/XMP/IPTC for photos, QuickTime dates for videos).
  2. 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

📄View markdown version
0

Frequently Asked Questions

Comments

Leave a Comment

Your email will not be published

Stay updated! Get our weekly digest with the latest learnings on NextJS, React, AI, and web development tips delivered straight to your inbox.

10-2000 characters

• Comments are automatically approved and will appear immediately

• Your name and email will be saved for future comments

• Be respectful and constructive in your feedback

• No spam, self-promotion, or off-topic content

Matija Žiberna
Matija Žiberna
Full-stack developer, co-founder

I'm Matija Žiberna, a self-taught full-stack developer and co-founder passionate about building products, writing clean code, and figuring out how to turn ideas into businesses. I write about web development with Next.js, lessons from entrepreneurship, and the journey of learning by doing. My goal is to provide value through code—whether it's through tools, content, or real-world software.

You might be interested in

Install Docker CLI on Mac with Colima — Fast Guide 2026
Install Docker CLI on Mac with Colima — Fast Guide 2026

5th January 2026

Local DNS Override — Mirror a Production Domain Locally
Local DNS Override — Mirror a Production Domain Locally

16th January 2026

Ultimate Next.js Standalone Dockerfile Guide (Tiny Images)
Ultimate Next.js Standalone Dockerfile Guide (Tiny Images)

2nd March 2026

Table of Contents

  • What we’re fixing
  • Prerequisites
  • Part 1 — Photos (JPG)
  • Step 1 — Copy metadata from originals to optimized photos
  • Step 2 — Make Finder dates match the capture time
  • Step 3 — Sanity check one file
  • Part 2 — Videos (MP4)
  • Step 1 — Copy metadata from originals to optimized videos
  • Step 2 (Optional) — Override `CreateDate` using XML sidecars
  • Step 3 — Make Finder dates match the recording time
  • Step 4 — Sanity check one video
  • Troubleshooting
  • Conclusion
On this page:
  • What we’re fixing
  • Prerequisites
  • Part 1 — Photos (JPG)
  • Part 2 — Videos (MP4)
  • Troubleshooting
Build With Matija Logo

Build with Matija

Matija Žiberna

I turn scattered business knowledge into one usable system. End-to-end system architecture, AI integration, and development.

Quick Links

Payload CMS Websites
  • Bespoke AI Applications
  • Projects
  • How I Work
  • Blog
  • Payload CMS

    • Migration
    • Pricing

    Get in Touch

    Have a project in mind? Let's discuss how we can help your business grow.

    Contact me →
    © 2026BuildWithMatija•Principal-led system architecture•All rights reserved