Repository navigation
Description
Context
Working on a potential Live TV feature that plays broadcast-style MPEG-TS channels (IPTV / OTA re-streams, FFmpeg ingest path). On US broadcast and cable-sourced feeds, closed captions are not a demuxable caption track — they ride inside the H.264/H.265 picture as ATSC A/53 cc_data in user_data_registered_itu_t_t35 SEI messages. Today those captions are invisible to the engine, so a whole class of live channels plays with no subtitle option at all.
Current state (audited at d9abd79)
- Render embedded CEA-608/708 closed captions (eia_608) — currently no decode or passthrough path #77's
ClosedCaptionTapis exactly the right consumer, but it only ingests packets from a demuxable caption stream:isEmbeddedClosedCaptionCodecmatcheseia_608/c608-style stream codecs, and the producer hands the tap that stream's packets (AetherEngine+ClosedCaptions.swift,AetherEngine+Loading.swift:431-470). - FFmpeg's mpegts demuxer never synthesizes such a stream for A53-in-video captions — they only exist as SEI in the video packets (or as
AV_FRAME_DATA_A53_CCafter decode). So on live TS the tap never arms, even though the channel is captioned. - I found no other A53/CC side-data handling in the engine: packet side-data scanning covers
AV_PKT_DATA_DOVI_CONF,AV_PKT_DATA_NEW_EXTRADATA, and the HDR10+ T.35 SEI prefix detection only.
Ask
Extend the #77 pipeline with a second cue source for live/TS sessions: extract cc_data from video-packet SEI and feed it into the existing CEA608Decoder + cue-buffer machinery.
Two plausible extraction points, in preference order:
- Producer pump, packet-level — parse
user_data_registered_itu_t_t35(provider 0x31GA94,user_data_type_code 0x03) from video packet NALs on the pump thread. The producer already scans video packets for the HDR10+ T.35 prefix (HLSSegmentProducer.swift:414), so the plumbing precedent exists; this works for the VideoToolbox path where no FFmpeg decode happens. Bitstream caveat: SEI order relative to presentation differs from decode order on B-frame content, so cues should be keyed by packet PTS like the existing tap already does. - Decoder-side
AV_FRAME_DATA_A53_CCon the software path (FFmpeg surfaces it for free there), as a complement.
Host side needs nothing new: once the track/cues surface through the existing subtitleTracks + subtitleCues contract, Prism's subtitle menu already labels eia_608/eia_708 tracks ("CEA-608"/"CEA-708") and renders cues through its overlay.
CEA-708 (the native ATSC service, richer styling) could stay out of scope initially, matching #77's "608 field-1/CC1 first cut" — A53 cc_data carries both, so the extraction layer is shared and 708 decode can layer on later.
Why engine-level
The host never touches demux/decode on the internal path, so there is no app-side workaround — packet SEI is only visible inside the engine.
Activity
feat(cc): A53 decode-to-presentation reorder buffer (#131)
feat(cc): A53 SEI cc_data bitstream parser for H.264/HEVC (#131)
refactor(cc): hoist GA94 prefilter needle off the per-packet path (#131)
feat(cc): A53 tap ingest with reorder + lazy synthetic track surfacing (
feat(cc): producer-side A53 SEI extraction, session threading, native…
feat(cc): A53 captions from decoded-frame side data on the SW path (#131
fix(cc): stale synthetic A53 track must not read as demuxable CC on r…
docs: A53/SEI caption extraction paths (#131)
fix(cc): final-review fixes for A53 arming seams, reorder stability, …
test(cc): make stray-tap notify leg discriminate the identity guard (#…
Merge feat/131-a53-sei-captions: A53/SEI-embedded CEA-608 captions fo…
superuser404notfound commentedon Jul 17, 2026
Shipped in 5.6.0. Both extraction points from the issue landed, in your preference order:
AV_FRAME_DATA_A53_CC(software path): MPEG-2 and the other FFmpeg-decoded codecs feed the same tap from decoded-frame side data, so true ATSC OTA feeds are covered too.Since no caption AVStream exists, the engine surfaces a synthetic
eia_608track (id 99608) intosubtitleTrackslazily on the first real (non-padding) caption pair, typically moments after joining a captioned channel; padding-onlycc_datanever surfaces a track, so uncaptioned channels keep a clean menu. As you predicted, the host side needs nothing: the track rides the existingsubtitleTracks+subtitleCuescontract, and Prism's existingeia_608labeling and overlay rendering should just work. One heads-up: the entry appears shortly after playback starts rather than at load time, so the subtitle menu needs to react tosubtitleTrackschanges (it sounds like it already does).Scope matches your suggestion: 608 field-1/CC1 first cut, and CEA-708 can layer on later since the extraction layer already carries both. Current limitation: overlay-only, the synthetic track gets no native WebVTT rendition yet, so no PiP/AirPlay captions on this path.
Verified locally end to end on an H.264+A53 sample (tap arms, track surfaces exactly once, cues render). Would appreciate a retest on your live channel matrix, IPTV and OTA re-streams both, whenever you get a chance.
Thanks for the audit, it was precise enough to serve as the implementation spec: the arming gap, both extraction points, and the reordering caveat were all exactly right.
refactor(cc): byte-level cc_data triplet overload for A53 reuse (supe…
feat(decode): render VideoToolbox deinterlaced frames via VTPixelTran…
dlev02 commentedon Jul 21, 2026
Happy to close this out for now, thanks for getting this in, and for landing both extraction points from the issue. Live TV is still in active development on my side, so I haven't exercised every caption path yet; if I hit anything new as that work continues I'll open fresh issues rather than reopening this one. Appreciate the quick turnaround!
superuser404notfound commentedon Jul 21, 2026
Sounds good, closing on that basis. The 708 layer, field 2/CC2+, and a native rendition for PiP/AirPlay captions on this path are all natural follow-ups once your Live TV work exercises them, so fresh issues are exactly the right shape for whatever surfaces. Thanks again for the audit-grade report, it made this one straightforward to land.
fix(captions): put A/53 caption timestamps back on the source axis (s…