---
title: "ExifTool on macOS: Sync Photo & Video Metadata Fast"
slug: "exiftool-macos-sync-metadata-jpg-mp4"
published: "2026-02-27"
updated: "2026-04-06"
validated: "2026-02-18"
categories:
  - "Tools"
tags:
  - "ExifTool macOS"
  - "sync metadata macOS"
  - "copy EXIF to optimized files"
  - "FileModifyDate DateTimeOriginal"
  - "EXIF XMP IPTC"
  - "ExifTool MP4 metadata"
  - "XML sidecar CreateDate"
  - "Finder dates macOS"
  - "JPG metadata sync"
  - "video metadata workflow"
llm-intent: "reference"
audience-level: "intermediate"
framework-versions:
  - "exiftool@13"
  - "bash@5"
  - "macOS@12+"
  - "homebrew@latest"
status: "stable"
llm-purpose: "ExifTool on macOS: copy EXIF/XMP/IPTC to optimized JPGs/MP4s and set FileModifyDate to capture time so Finder sorts correctly. Follow step-by-step CLI…"
llm-prereqs:
  - "Access to ExifTool"
  - "Access to bash"
  - "Access to Homebrew"
  - "Access to Finder"
  - "Access to grep"
llm-outputs:
  - "Completed outcome: ExifTool on macOS: copy EXIF/XMP/IPTC to optimized JPGs/MP4s and set FileModifyDate to capture time so Finder sorts correctly. Follow step-by-step CLI…"
---

**Summary Triples**
- (optimized files, often lose, EXIF/XMP/IPTC (photos) and QuickTime dates (videos) after recompression/re-encoding)
- (goal, is to, copy metadata from originals to optimized files and set filesystem timestamps to capture time so Finder sorts correctly)
- (working directory, should be, the optimized/ folder (cd /path/to/media/optimized) so commands write only to optimized files)
- (copy photo metadata, use, exiftool -overwrite_original -P -TagsFromFile "../%f.%e" -Exif -XMP -IPTC -IFD0 -IFD1 [files])
- (copy video metadata (MP4), use, exiftool -overwrite_original -P -TagsFromFile "../%f.%e" -QuickTime:all -XMP -IPTC [files] (match extension case))
- (set filesystem timestamp for photos, use, exiftool "-FileModifyDate<DateTimeOriginal" -overwrite_original [files])
- (set filesystem timestamp for MP4, use, exiftool "-FileModifyDate<CreateDate" -overwrite_original [files] (verify correct source tag with exiftool -G -a -s))
- (safety, ExifTool creates, _original backup files by default unless -overwrite_original is specified)
- (matching basenames, is required for, the ../%f.%e TagsFromFile pattern to find corresponding originals; use ../%f.* if extensions differ)
- (testing, preview, tags with exiftool -G -a -s file.jpg and run commands on a small subset before bulk changes)

### {GOAL}
ExifTool on macOS: copy EXIF/XMP/IPTC to optimized JPGs/MP4s and set FileModifyDate to capture time so Finder sorts correctly. Follow step-by-step CLI…

### {PREREQS}
- Access to ExifTool
- Access to bash
- Access to Homebrew
- Access to Finder
- Access to grep

### {STEPS}
1. Install ExifTool and prepare folders
2. Change to optimized working directory
3. Copy EXIF/XMP/IPTC for JPGs
4. Align file modification date for photos
5. Sanity-check photo metadata
6. Copy metadata for MP4 videos
7. Optional: apply XML sidecar CreateDate to MP4
8. Align file modification date for videos
9. Final sanity check and troubleshooting

<!-- llm:goal="ExifTool on macOS: copy EXIF/XMP/IPTC to optimized JPGs/MP4s and set FileModifyDate to capture time so Finder sorts correctly. Follow step-by-step CLI…" -->
<!-- llm:prereq="Access to ExifTool" -->
<!-- llm:prereq="Access to bash" -->
<!-- llm:prereq="Access to Homebrew" -->
<!-- llm:prereq="Access to Finder" -->
<!-- llm:prereq="Access to grep" -->
<!-- llm:output="Completed outcome: ExifTool on macOS: copy EXIF/XMP/IPTC to optimized JPGs/MP4s and set FileModifyDate to capture time so Finder sorts correctly. Follow step-by-step CLI…" -->

# ExifTool on macOS: Sync Photo & Video Metadata Fast
> ExifTool on macOS: copy EXIF/XMP/IPTC to optimized JPGs/MP4s and set FileModifyDate to capture time so Finder sorts correctly. Follow step-by-step CLI…
Matija Žiberna · 2026-02-27

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:

```bash
brew install exiftool
```

Set up your folders like this (optimized files in a subfolder, with matching basenames):

```text
/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.

```bash
# 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`.

```bash
# 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

```bash
# 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).

```bash
# 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.

```bash
# 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`:

```bash
# 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

```bash
# 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

## LLM Response Snippet
```json
{
  "goal": "ExifTool on macOS: copy EXIF/XMP/IPTC to optimized JPGs/MP4s and set FileModifyDate to capture time so Finder sorts correctly. Follow step-by-step CLI…",
  "responses": [
    {
      "question": "What does the article \"ExifTool on macOS: Sync Photo & Video Metadata Fast\" cover?",
      "answer": "ExifTool on macOS: copy EXIF/XMP/IPTC to optimized JPGs/MP4s and set FileModifyDate to capture time so Finder sorts correctly. Follow step-by-step CLI…"
    }
  ]
}
```