fix(encode): tag HEVC as hvc1 so AVFoundation players open the file - #460
Merged
Merged
Conversation
`--codec h265` produced an mp4 that QuickTime, Safari and avconvert refuse. The bitstream was never the problem: ffmpeg's mp4/mov muxer writes HEVC under the `hev1` sample entry unless told otherwise, and Apple's stack reads only `hvc1`. A `-c copy` remux that changes nothing but the tag is enough to make the same file play, which is what the issue measured. The tag now comes from the codec and the output extension, so both the libx265 branch and the hardware one get it, and mkv — which has no such sample entry — gets nothing. `rustmotion concat` needed no change: `-c copy` carries the tag across, verified on two rendered segments. Closes #457
Merged
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.
--codec h265wrote an mp4 that QuickTime, Safari andavconvertrefuse. ffmpeg's mp4/mov muxer writes HEVC under thehev1sample entry unless told otherwise, and Apple's stack reads onlyhvc1. The issue measured it: a-c copyremux that changes the tag and nothing else makes the identical bitstream play.ffmpeg_argsnow derives the tag from the codec and the output extension, so it lands on the libx265 branch and the hardware one alike —hevc_videotoolbox,hevc_nvenc,hevc_qsv,hevc_amfall go through the same muxer with the same gap. mkv has no sample entry table, so it gets nothing, and no other codec is touched:prores_kssets its own tag, andavc1was never refused.rustmotion concatturned out to need no change.-c copycarries the tag across, checked on two--framessegments rendered from this branch and joined:hvc1,hvc1,hvc1.Verification — three args-level tests (both codec spellings, both branches,
.mp4/.mov/uppercase/the.partial.path the encoder actually passes; absent for mkv and for every other codec), plus one that renders an HEVC mp4 and readscodec_tag_stringback with ffprobe, skipping itself where ffmpeg, ffprobe or libx265 is missing. The args test was red before the fix and the two negative ones green, which is what keeps the fix from over-reaching.cargo fmt --all --check,cargo clippy --workspace --all-targets --features rustmotion/studio -- -D warnings,cargo test --workspace --features rustmotion/studio: 0 failed.Closes #457