Tag HEVC output as hvc1 for all HEVC encoders in ISOBMFF containers#153
Open
kazukinakai wants to merge 1 commit into
Open
Tag HEVC output as hvc1 for all HEVC encoders in ISOBMFF containers#153kazukinakai wants to merge 1 commit into
kazukinakai wants to merge 1 commit into
Conversation
The VideoWriter only set the 'hvc1' codec tag for hevc_videotoolbox. ffmpeg defaults HEVC-in-MP4/MOV to the 'hev1' tag, which is spec-valid but rejected by Apple's AVFoundation: Finder thumbnails, QuickLook, QuickTime Player and Safari all treat hev1-tagged HEVC as unsupported. So output from hevc_nvenc / libx265 / hevc_amf / hevc_qsv silently failed to preview/play on Apple platforms. Set 'hvc1' for every HEVC encoder when the container is ISOBMFF (mp4/mov/m4v). It's a metadata-only change (no re-encode, no quality/size impact) and non-Apple players accept both tags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
VideoWriteronly sets thehvc1codec tag forhevc_videotoolbox. ffmpeg defaults HEVC-in-MP4/MOV to thehev1tag, which is spec-valid but rejected by Apple's AVFoundation — Finder thumbnails, QuickLook, QuickTime Player and Safari all treathev1-tagged HEVC as unsupported.So restored output produced with
hevc_nvenc(andlibx265/hevc_amf/hevc_qsv) silently fails to preview/play on Apple platforms, whilehevc_videotoolboxoutput works. We hit exactly this: NVENC-encoded restored.mp4files have no Finder thumbnail and won't QuickLook on macOS.Fix
Set
tag = 'hvc1'for every HEVC encoder when the container is ISOBMFF (.mp4/.mov/.m4v), not justhevc_videotoolbox:It's a metadata-only change (no re-encode, no quality/size impact), and non-Apple players accept both
hev1andhvc1.Note on venue
I see the project's canonical home is Codeberg and GitHub is a mirror — apologies if PRs here aren't your preferred flow. Happy to re-open this on Codeberg; opening here since this is where my fork lives. The patch is a single small diff in
lada/utils/video_utils.pyand easy to cherry-pick.