illphated
How to Repair a Corrupt MP4 File on macOS (Missing moov Atom Fix)
Corrupted video files are frustrating, especially when you’ve spent time recording or downloading something important. If you’re stuck with an unplayable .mp4 file on macOS and getting errors like:
pgsql
Copy
Edit
moov atom not found
Error opening input file
This guide will walk you through how to repair a damaged MP4 file — especially when the critical moov atom is missing.
❓What is the moov Atom?
The moov atom is part of the MP4 file’s structure that holds indexing and metadata. Without it, your media player doesn’t know how to read or seek the video. If it’s missing, you’ll see errors like:
less
Copy
Edit
[mov,mp4,…] moov atom not found
Error opening input file: Invalid data found when processing input
🧪 First Things First: Try VLC or QuickTime
Sometimes players can work around light corruption.
QuickTime Player — Try opening and exporting it.
VLC Player — Go to File > Convert/Stream and try saving it as a new file.
If those don’t work, you’ll need something stronger.
💪 Solution 1: Use FFmpeg to Salvage the File
Install FFmpeg with Homebrew:
bash
Copy
Edit
brew install ffmpeg
Try re-wrapping or re-encoding:
bash
Copy
Edit
ffmpeg -i broken.mp4 -c copy repaired.mp4
# OR
ffmpeg -err_detect ignore_err -i broken.mp4 -c:v libx264 -c:a aac repaired.mp4
If the moov atom is missing entirely, FFmpeg alone won’t be enough.
🔧 Solution 2: Repair MP4 with untrunc
The tool untrunc can rebuild the missing metadata if you provide a reference MP4 file from the same camera or recording app.
⚙️ How to Install untrunc on macOS
untrunc is no longer in Homebrew, so you’ll need to build it manually.
Step 1: Install Requirements
bash
Copy
Edit
brew install cmake ffmpeg
Step 2: Clone the Repo
bash
Copy
Edit
git clone https://github.com/ponchio/untrunc.git
cd untrunc
Step 3: Build It
bash
Copy
Edit
cmake .
make
This creates a binary called untrunc.
Step 4: Run It
bash
Copy
Edit
./untrunc good.mp4 broken.mp4
good.mp4: a healthy file from the same source
broken.mp4: your corrupted file (e.g., 03_06_2025_060150.mp4)
🔍 Bonus: Use MP4Box for More Options
Install:
bash
Copy
Edit
brew install gpac
Try to gather info:
bash
Copy
Edit
MP4Box -info broken.mp4
If recognized, you can try repackaging:
bash
Copy
Edit
MP4Box -isma -inter 500 -tmp /tmp repaired.mp4
But like FFmpeg, this only works if the structure isn’t too broken.
🧰 Optional GUI Tools
If you prefer a GUI and are okay with paid tools, try:
Stellar Video Repair (Mac)
Yodot MOV Repair (Mac) — Requires a matching reference file.
🎯 Final Thoughts
If your .mp4 won’t open and you see “moov atom not found,” don’t panic — tools like untrunc and FFmpeg can often recover the file, especially if you have a good reference video.
Need help prepping the right files? DM me at illphated.com or follow on Twitch.tv/illphated for tech breakdowns, automation hacks, and digital salvage missions.
🔖 Tags:
#illphated #ffmpeg #untrunc #macos #videorepair #mp4 #techsupport #moovatom #digitalrecovery