Repository navigation
Fall back to SPS frame_mbs_only_flag when demuxer field_order is UNKNOWN (#150) - #155
Merged
superuser404notfound merged 1 commit intoJul 19, 2026
Merged
Conversation
… UNKNOWN (#150) Some interlaced live H.264 channels (frame_mbs_only_flag=0 in the SPS) probe with field_order=UNKNOWN, silently defeating the #107 interlaced-goes-software rule and leaving them on native VideoToolbox decode with a persistent colour cast. When the field-order probe is inconclusive, parse the SPS from codecpar extradata (Annex-B and avcC layouts) and treat frame_mbs_only_flag=0 as interlaced for routing. A concrete PROGRESSIVE probe still wins, and a false positive only costs an unnecessary software decode since deint passes progressive frames through untouched. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw
superuser404notfound
deleted the
fix/ae150-sps-interlaced-routing-fallback
branch
July 19, 2026 16:25
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.
Fixes #150.
Problem
Some interlaced live H.264 channels are interlaced at the SPS level (frame_mbs_only_flag=0) but the demuxer's field-order probe returns UNKNOWN instead of TT/BB/TB/BT. The #107 routing rule only consults field_order, so these channels stayed on native VideoToolbox decode, which does not deinterlace, producing a persistent green colour cast from the first frame.
Fix
H264SPS: exposeframeMbsOnly(fromNAL:)(the parser already walked the flag for dimensions) andspsNAL(fromExtradata:), which accepts both extradata layouts, Annex-B (MPEG-TS) and avcC (MP4/MKV).VideoRoutingPolicy.requiresSoftwarePathgainsspsIndicatesInterlaced, consulted only when field_order is UNKNOWN. A concrete PROGRESSIVE probe (which analyzed actual frames) still wins over the SPS capability flag. New pure helperspsIndicatesInterlaced(extradata:)classifies extradata.AetherEngine.loadcomputes the fallback from codecpar extradata and logsfieldOrder=UNKNOWN but SPS frame_mbs_only_flag=0; treating as interlaced for routing (#150)when it fires.Safety: a false positive (interlaced-capable SPS carrying progressive frames) only pays an unnecessary software decode. The SW decoder gates bwdif per frame on AV_FRAME_FLAG_INTERLACED from the slice headers, so progressive frames pass through untouched. Unparseable or missing extradata classifies as not-interlaced and keeps the native path.
Tests
dimensionsparser.frameMbsOnlytrue/false/nil cases, SPS extraction from Annex-B and avcC extradata, garbage rejection.🤖 Generated with Claude Code
https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw