Skip to content
FramesField
FIX 17 · FFMPEG & DELIVERY
raw .md ↗ Verified Dec 1, 2026

Fix FFmpeg H.265 / HEVC Not Playing in Safari (hev1 vs hvc1)

Direct Fix: Fix existing FFmpeg HEVC files in 2 seconds without re-encoding via ffmpeg -i broken.mp4 -c copy -tag:v hvc1 -movflags +faststart fixed.mp4, and include -tag:v hvc1 on every new libx265 or hevc_videotoolbox export so Safari, QuickTime, and iOS play immediately.
Exact Error / Visual Signature
QuickTime Player: "The file isn't compatible with QuickTime Player" | Safari <video>: Blank black box or audio-only | ffprobe: hevc, Main, hev1
OBSERVED SYMPTOM

Your H.265 / HEVC MP4 plays smoothly in VLC, mpv, and desktop Chrome, yet refuses to open in macOS QuickTime Player, renders a blank canvas inside Safari on macOS and iOS, or fails Apple AirDrop and Photos playback.

TECHNICAL ROOT CAUSE

When FFmpeg muxes libx265 into an MP4 or MOV container without an explicit codec tag flag, it defaults to the hev1 ISO Base Media FourCC (allowing in-band parameter sets), whereas Apple AVFoundation, QuickTime Player, Safari, and iOS strictly enforce the hvc1 sample-entry tag.

Copy-Paste Verified Fix

Instant Lossless hev1-to-hvc1 Remux + Fresh libx265 & Apple Silicon Commands fix-hevc-hvc1-safari.sh
# 1. Inspect existing HEVC codec_tag_string (if it prints "hev1", Safari & QuickTime reject it)
ffprobe -v error -select_streams v:0 \
  -show_entries stream=codec_name,profile,codec_tag_string,pix_fmt \
  -of csv=p=0 broken_hevc.mp4

# 2. Option A (2-Second Lossless Remux — Zero Re-Encoding!): rewrite hev1 -> hvc1
ffmpeg -y -i broken_hevc.mp4 -c copy -tag:v hvc1 -movflags +faststart fixed_hvc1.mp4

# 3. Option B (Fresh Software libx265 Encode — 8-bit SDR Universal HEVC)
ffmpeg -y -i source.mov \
  -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" \
  -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p -tag:v hvc1 \
  -colorspace bt709 -color_primaries bt709 -color_trc bt709 -color_range tv \
  -c:a aac -b:a 192k -ar 48000 -movflags +faststart export_x265_hvc1.mp4

# 4. Option C (macOS Apple Silicon Hardware Encode — 10-bit Main 10 HEVC)
ffmpeg -y -i source.mov \
  -c:v hevc_videotoolbox -profile:v main10 -q:v 65 -pix_fmt p010le -tag:v hvc1 \
  -colorspace bt709 -color_primaries bt709 -color_trc bt709 -color_range tv \
  -c:a aac -b:a 192k -ar 48000 -movflags +faststart export_vt_hvc1.mp4

Before vs. After (Broken Pattern vs. Verified Fix)

Broken · Broken Command (Default libx265 Writes hev1 FourCC Tag)
ffmpeg -y -i master.mov -c:v libx265 -crf 22 -pix_fmt yuv420p -c:a aac hevc_broken.mp4
# ffprobe reports: hevc,Main,hev1,yuv420p -> Rejected by QuickTime & Safari
Verified · Verified Apple-Compatible Command (Explicit -tag:v hvc1 + faststart)
# Fresh encode with Safari/QuickTime hvc1 tag:
ffmpeg -y -i master.mov \
  -c:v libx265 -crf 22 -preset medium -pix_fmt yuv420p -tag:v hvc1 \
  -colorspace bt709 -color_primaries bt709 -color_trc bt709 -color_range tv \
  -c:a aac -b:a 192k -ar 48000 -movflags +faststart hevc_safari.mp4

Why this works: Passing -tag:v hvc1 writes the exact hvc1 FourCC sample entry Apple VideoToolbox expects, while -movflags +faststart places the MP4 index at byte 0 for instant web streaming.

Under the Hood

Why This Failure Happens in Real Pipelines

The ISO/IEC 14496-15 MP4 specification defines two valid sample entry tags for HEVC video tracks: hev1 and hvc1. Under hev1, Video Parameter Sets (VPS), Sequence Parameter Sets (SPS), and Picture Parameter Sets (PPS) may be interleaved inside the video bitstream itself. Under hvc1, those decoder configuration records must reside out-of-band in the MP4 container’s hvcC configuration box so hardware decoders can initialize cleanly before reading frame 0.

FFmpeg’s MP4 muxer historically defaults to hev1 for libx265 outputs so dynamically changing parameter sets remain legal. Apple’s HLS authoring specification and VideoToolbox hardware playback stack explicitly require hvc1 and reject hev1 tracks outright—even when the underlying compressed H.265 frames are 100% compliant Main or Main 10 profile video. That single 4-byte FourCC mismatch is why an HEVC master that looks healthy in VLC will not even open in QuickTime.

Because libx265 already places global headers in the MP4 box when muxing standard constant-resolution files, fixing an existing hev1 deliverable rarely requires a slow re-encode: a lossless stream-copy remux with -c copy -tag:v hvc1 -movflags +faststart rewrites the MP4 container tag in under two seconds with zero generational quality loss. For brand-new encodes, always append -tag:v hvc1 alongside -pix_fmt yuv420p (or yuv420p10le for 10-bit HDR/graded masters) and BT.709 color signaling.

Step-by-Step Resolution & Verification

  1. 01

    Probe codec_tag_string with ffprobe to confirm hev1 mismatch

    Inspect video stream v:0 with ffprobe. If codec_name is hevc and codec_tag_string prints hev1, the bitstream tag—not video corruption—is blocking Safari and QuickTime.

  2. 02

    Remux losslessly with -c copy -tag:v hvc1 or re-encode with explicit color tags

    Run the 2-second lossless remux first on already-rendered masters. If the file also has odd dimensions, 4:4:4 chroma, or missing BT.709 metadata, run the fresh libx265 or hevc_videotoolbox command with -tag:v hvc1.

  3. 03

    Verify hvc1 output and pair an H.264 fallback for web embeds

    Confirm ffprobe prints hvc1, open the file directly in macOS QuickTime Player, and include an H.264 <source> fallback inside HTML5 <video> tags for browsers or Linux systems lacking HEVC hardware decoders.

Verification Check · Confirm Output FourCC Tag Reads hvc1 Instead of hev1
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,profile,codec_tag_string,pix_fmt -of csv=p=0 fixed_hvc1.mp4
Expected healthy output:
hevc,Main,hvc1,yuv420p   # Third column MUST read "hvc1" (never "hev1")

How to Prevent This Error From Recurring

GUARDRAIL 01

Make -tag:v hvc1 mandatory in every libx265 and VideoToolbox preset

Every browser and player that accepts hev1 also accepts hvc1, whereas Apple platforms strictly demand hvc1—there is zero compatibility downside to standardizing on hvc1.

GUARDRAIL 02

Keep H.264 yuv420p as fallback in HTML5 <video> elements

List <source src="clip-hevc.mp4" type='video/mp4; codecs="hvc1"'> first and <source src="clip-h264.mp4" type="video/mp4"> second so older Firefox and non-HEVC Windows machines play seamlessly.

GUARDRAIL 03

Avoid 4:2:2 or 4:4:4 HEVC profiles for public web delivery

Even with -tag:v hvc1, standard iPhones and older browsers only hardware-decode 8-bit Main (yuv420p) and 10-bit Main 10 (yuv420p10le); reserve 4:2:2 for internal editing mezzanines.

Troubleshooting FAQs

Does remuxing hev1 to hvc1 with -c copy lose any video quality?
No. Stream copy (-c copy) leaves every compressed HEVC video frame and AAC audio packet completely untouched; it only updates the MP4 container FourCC metadata and relocates the moov index atom when -movflags +faststart is included.
Can -c copy -tag:v hvc1 ever fail on an existing HEVC file?
Only if the source HEVC bitstream literally changes SPS/PPS parameters mid-stream or uses an unsupported profile like Main 4:4:4. In that rare case, re-encode once with libx265 -pix_fmt yuv420p -tag:v hvc1 so global parameter sets stay constant.
Does Safari support 10-bit HEVC (yuv420p10le / Main 10) with hvc1?
Yes. Modern macOS Safari, iOS Safari, and Apple Silicon Macs hardware-decode 10-bit Main 10 HEVC tagged as hvc1 cleanly, which greatly reduces gradient banding on dark AI sky and studio backdrops.
Why does Chrome play my hvc1 file on macOS but not on some Windows or Linux desktops?
Chrome delegates HEVC decoding to the operating system hardware decoder. macOS and modern Windows systems with HEVC extensions decode hvc1 natively, while many Linux builds and older Firefox releases require an H.264 or VP9/AV1 fallback source.
Is -vtag hvc1 identical to -tag:v hvc1 in FFmpeg?
Yes. -vtag hvc1 is a legacy shorthand alias for -tag:v hvc1. Modern FFmpeg scripts prefer -tag:v hvc1 because stream-specifier syntax (:v, :a, :v:0) remains explicit in multi-stream filtergraphs.
Use this page in AI tools or notes
raw .md