Repository navigation
Detect ProRes 4444 alpha from sample-entry depth (3.1.1) - #4
Merged
Merged
Conversation
ap4h/ap4x streams were always reported as yuva444p12le, but alpha is optional in ProRes 4444 and most masters are opaque. Use the VisualSampleEntry depth (32 = alpha, 24 = opaque) and, when that is inconclusive, the first frame header's alpha_channel_type, matching ffprobe. Also set hasAlphaChannel, keep the depth out of bitDepth for ProRes, and apply FourCC defaults to sample entries with no children. Prepare the 3.1.1 patch release (version, README, changelog, checklist). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
MP4Parser.applyFourCCDefaultssetpixelFormat = "yuva444p12le"for every ProRes 4444 / 4444 XQ (ap4h/ap4x) stream. Alpha is optional in 4444, and opaque camera and grading masters were reported with an alpha plane. ffprobe reportsyuv444p12lefor those. Aagedal Media Converter uses this field to decide whether to keep alpha, so opaque masters got a forced alpha plane in ProRes exports and an all-white matte sidecar.Fix
depthdecides alpha for ap4h/ap4x: 32 givesyuva444p12le, 24 givesyuv444p12le.alpha_channel_typedecides (the field ffprobe uses). This is a 26-byte read at the firststco/co64offset in the already-mapped file, the same pattern the tmcd and BRAW paths use. With no usable signal the stream is reported opaque.hasAlphaChannelis nowtrueorfalsefor these streams.bitDepth, so 4444 stays at 12.Matroska (
V_PRORES) and MXF don't assume alpha. MKV reports no ProRes pixel format at all. MXF derivesyuv444p12lefrom the CDCI descriptor, so it misses alpha on 4444-with-alpha MXF (ffprobe needs the frame for that). That's a separate gap and isn't changed here.Release
Bumps to 3.1.1 (CLI version, README, CHANGELOG, RELEASE_CHECKLIST). Not tagged. Tag after merge, once confirmed.
Testing
MP4ParserTests: depth 24, depth 32, ap4x, depth 48 (not read as bitDepth), missing depth with a frame-header alpha of 1 or 0, depth taking precedence over the frame header, and the opaque default.prores_ksap4h/ap4x MOVs with and without alpha, plus copies with the depth zeroed (frame-header path).pixelFormatmatches ffprobe in all 8 cases.scripts/verify-release.sh 3.1.1passed: 1686 library tests (21 skipped, 0 failures), CLI tests, and the release archive build.🤖 Generated with Claude Code