By Lucas, founder of FixMyVideos · Updated
Can't Decode H.265 / HEVC on Mac: Find the Real Cause
When QuickTime says it cannot open an HEVC file, or opens it and shows a black frame, the usual advice is to blame the codec and transcode. Sometimes that is right. In several files we have taken apart, though, the HEVC data was fine and the problem sat in the few bytes around it that tell Apple's player how to read it. Those cases have quick fixes, and some come down to a single ffmpeg command.
Before you start, know that ffmpeg, VLC and other ffmpeg-based tools play several kinds of broken HEVC without a single complaint, while Apple's decoder refuses them. So "it plays in VLC" proves less than it seems to. Below are the causes we have actually hit, in the order you should rule them out.
First, look at the file
Run this on the file (install ffmpeg with Homebrew if you don't have it):
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,codec_tag_string,profile,pix_fmt -of default=nw=1 yourfile.mov
You get four lines. codec_name should say hevc. The two lines that matter most here are codec_tag_string and profile.
If ffprobe instead prints moov atom not found or Invalid data found when processing input, stop reading this page. The file's index is missing or damaged, which is a different problem covered under moov atom not found.
Cause 1: the track is tagged hev1 instead of hvc1
An MP4 or MOV labels its HEVC track with one of two four-letter codes. hvc1 means the decoder settings live in the file header. hev1 means they may be repeated inside the stream. Both are legal. QuickTime, iOS and Safari only accept hvc1.
ffmpeg writes hev1 by default when it muxes HEVC, so any tool built on it can hand you an hev1 file, and every ffmpeg-based check will call that file perfectly healthy, because ffmpeg plays both tags. We pin hvc1 on every HEVC file we deliver for exactly this reason.
If your codec_tag_string reads hev1, this usually fixes it with no quality loss, since it only rewrites the label:
ffmpeg -i yourfile.mp4 -c copy -tag:v hvc1 fixed.mp4
Cause 2: the profile is one your Mac does not decode
If the tag is already hvc1, look at profile and pix_fmt. macOS has decoded HEVC since High Sierra (10.13), but which HEVC profiles a given Mac accepts depends on its hardware and macOS version. The common 8-bit Main and 10-bit Main 10 profiles are the safe ones. Professional modes such as 10-bit 4:2:2 (pix_fmt ending in 422p10le) are not covered on every Mac.
For a file that plays everywhere, re-encode it to H.264:
ffmpeg -i yourfile.mov -c:v libx264 -crf 18 -pix_fmt yuv420p -c:a copy playable.mov
The result is bigger and loses the 10-bit colour, so keep the original. If a newer Mac or a current macOS opens the original, nothing was wrong with it.
Cause 3: frames play out of order ("shaking")
This one is easy to mistake for a decoder problem. The file opens, but motion stutters back and forth, as if every other pair of frames were swapped.
HEVC from phones and cameras uses B-frames, pictures that are stored in one order and shown in another. The container carries a table (ctts, composition offsets) that tells the player when to show each picture. If a repair tool rebuilt the file from raw stream data and did not write that table, or wrote it wrong, the player shows pictures in storage order. ffmpeg reorders them internally from the picture order count inside each slice, so any check built on ffmpeg's decoder passes the file.
We hit this on three HEVC 4:2:2 recordings that came off a card recovery tool. Our founder played the repaired files on a Mac and saw the shaking while every check we had was green. Compared with a healthy copy of one clip, 142 of 610 pictures shared a presentation timestamp and 158 gaps were double length. Our timing rebuilder had no HEVC slice parser, so it fell back to ffmpeg's dts2pts filter, and that is what collided the timestamps. Writing the parser had its own trap. HEVC puts slice_type after the parameter-set id, and two fields before the picture order count depend on the PPS, so a first draft that skipped them read the count one bit late and got small, plausible, wrong numbers. With the finished parser, the same clip's timing (timebase, every sample duration, the ctts histogram) came out identical to the twin's, and all 610 pictures were byte-identical to the original.
There is no reliable one-line fix for this at home. ffmpeg's dts2pts filter is meant for it, and on the files above it is exactly what produced the collisions. If your file shakes on a Mac while ffmpeg decodes it without error, the timing table needs rebuilding from the slice headers.
Cause 4: reference pictures are missing
Every P or B picture refers back to earlier pictures. If a repair or carve dropped some of them, the stream still parses. ffmpeg fills the holes with nearby content and prints nothing at all. Apple's VideoToolbox refuses the file outright, and QuickTime says it cannot decode it.
We found this the hard way twice. On a static tripod shot, real reference pictures were under 1 KB, and a size filter in our own carver threw them away as noise. The second time was a DJI Osmo Pocket 3 recording that came to us without its index. Our repair decoded "cleanly" in ffmpeg, yet the picture looked washed out with a seam across the middle, and the Mac would not play it at all. A green tint came on top, partly from a decoder profile borrowed from a different DJI camera. To measure it, we cut a healthy Pocket 3 clip at 250 MB and ran it through the engine: the carver had dropped 216 of 722 frames. After the fix, all 722 came back byte-exact against the original and audio lined up at 0.0 ms offset.
A related case is specific to iPhone HDR footage. With HDR Video on, the iPhone attaches a Dolby Vision metadata unit (NAL type 62) to every picture. Our carver once rejected that type, which made it lose 426 bytes per picture on an iPhone 13 Pro test file. Before the fix the carve found 294 of 314 pictures, none of them complete. Accepting the whole vendor range brought it to all 314, byte-exact.
What you can do yourself: if ffmpeg or VLC plays the file and QuickTime refuses it, a full re-encode with the H.264 command above usually gives you something the Mac will open, because the encoder writes a fresh, complete stream. Whatever ffmpeg concealed will still be visible as smears. If those frames matter, the missing pictures have to be found in the original bytes instead.
Cause 5: part of the picture is bright green
A frame that is solid green below a certain line is not a colour problem. When the data inside a single picture breaks, ffmpeg's HEVC decoder, unlike its H.264 one, does not paper over it. It stops writing and leaves the rest of the frame at zero. Zero in all three YUV channels displays as saturated green. Every picture that depends on that keyframe inherits the damage until the next keyframe.
On a 552 MB HEVC MOV that came out of a recovery tool, 55.4 % of the first keyframe was never written and the picture was green from the horizon down for that whole group of pictures. ffmpeg's log showed one parse error and no concealment warning. We now measure the decoded pixels directly (the share of the frame where Y, U and V are all exactly zero) instead of trusting the log, and start the preview at the first keyframe that decodes clean, which on that file was the keyframe at frame 30.
If the green appears only at the start and then clears, the damage is local and the rest of the recording is probably intact.
When it is not decodable by anyone
Some files cannot be helped by any player or service, and we would rather tell you than let you wait for a preview that cannot come. These are the three we have seen:
- All zeros. The file has its full size but every byte is 0x00. There is no video data in it at all.
- Header only. We have seen a 24-byte upload that was a lone
ftypbox with nothing behind it. - One block repeated. A 20 MB file that held only 12,288 bytes of distinct data, the same few sectors repeated over and over. Something in the read chain failed (card, reader, cable or USB adapter), and the file alone does not say which.
You can check the first two yourself: xxd yourfile.mov | head shows only zeros, or the file is a few kilobytes when it should be gigabytes. If the header-only file came out of a recovery program, look first at the other, larger files from the same run, since the footage is often in one of them. Otherwise the only real fix is to copy the file again from the original card or phone, ideally through a different reader.
What we do with a broken HEVC file
Upload it and the engine reads the file at the byte level. It walks the HEVC units and rebuilds missing indexes and timing from the slice headers. Every HEVC file we deliver is tagged hvc1, the timing is rebuilt from the slice headers where the stream needs it, and the preview starts on a keyframe whose decoded pixels are checked for unwritten (green) regions. Where we fixed a file in the cases above, the HEVC data itself was carried over without re-encoding.
You get a free 5-second preview, converted to H.264 so it plays in any browser whatever your Mac supports. If it shows your footage, you pay to download the full file: €6 under 2 GB, €18 from 2 to 20 GB, €35 from 20 to 50 GB and €59 above that, VAT included. Files up to 150 GB are accepted, and everything is deleted automatically after 48 hours.
If your file turned out to be Cause 1 or 2, you don't need us. Fix it locally with the command above.
FAQ
VLC plays my HEVC file but QuickTime won't. Is the file corrupted?
Not necessarily. Check codec_tag_string first. An hev1 tag takes one copy command to fix, so rule it out before anything else. If the tag is hvc1, the remaining suspects are an unsupported profile, a missing timing table or missing reference pictures, and only the last two mean real damage.
Can I stop my iPhone recording HEVC? Yes. Settings, Camera, Formats, then choose "Most Compatible" and new videos are recorded in H.264. Files get larger. Videos you already shot stay HEVC.
Will transcoding fix a corrupted HEVC file? It fixes playback, not damage. ffmpeg conceals what it cannot decode and the encoder bakes those concealed frames into the new file. If the smears or green areas matter, the original bytes need to be recovered first.
Why does my recovered file play on my PC but not my Mac?
Apple's decoder is stricter than ffmpeg's. A file with an hev1 tag, no composition offsets or missing reference pictures plays on almost anything built on ffmpeg and is refused by QuickTime. A repair tool that only tested with ffmpeg would not have noticed.
Is my footage safe? Files are processed on EU-based servers and deleted automatically after 48 hours. Nobody opens one unless you ask us to or the automatic repair fails, and then only to recover it and to fix our repair software so the next file like it repairs on its own. Files are never shared and never used to train AI. See the privacy policy.
Related
- QuickTime error -2048
- Moov atom not found
- Black screen when playing video
- iPhone 15 Pro MOV won't open
- Recover XAVC S files
Free preview · No commitment
Ready to recover your video?
Upload your file and get a free 5-second preview in about a minute. Pay only if the preview looks right.
Upload your file →