fix(web-ui): improve AC-3/E-AC-3 demux and MP4 remux#604
Conversation
Correct sampling rates and E-AC-3 config generation, carry incomplete frame data across PES payloads, emit Dolby ftyp/btrt boxes, and rebuild embedded web assets.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Revert embedded_web_data.h to main; rebuild separately when merging.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-604.eastasia.1.azurestaticapps.net |
Fix lint failure from an overlong f-string line in build_services_m3u.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-604.eastasia.1.azurestaticapps.net |
1 similar comment
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-604.eastasia.1.azurestaticapps.net |
There was a problem hiding this comment.
Pull request overview
This PR improves Dolby Digital (AC-3) / Dolby Digital Plus (E-AC-3) handling in the Web UI MPEG-TS pipeline so that demuxed audio frames are more reliably parsed across PES boundaries and remuxed into MP4 init segments that are more compatible with browser MSE playback.
Changes:
- Add bitrate propagation into MP4 metadata and emit Dolby-oriented
ftypplusbtrtboxes for AC-3 / E-AC-3 sample entries. - Improve AC-3 / E-AC-3 demux: validate headers more defensively, compute correct sample durations (including E-AC-3
num_blks), and carry incomplete frames across PES payloads. - Extend E-AC-3 metadata change detection and propagate bitrate into init-segment generation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| web-ui/src/mpegts/remux/mp4-generator.ts | Adds Dolby-specific ftyp selection and emits btrt based on propagated audio bitrate for AC-3/E-AC-3. |
| web-ui/src/mpegts/demux/ts-demuxer.ts | Buffers incomplete AC-3/E-AC-3 frames across PES payloads, adjusts duration math, detects E-AC-3 metadata changes, and propagates bitrate into MP4 metadata. |
| web-ui/src/mpegts/demux/ac3.ts | Fixes AC-3/E-AC-3 sampling-frequency tables, validates frame headers before accepting syncwords, and computes per-frame bitrate/config values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Return early when timing cannot be derived because codec metadata is not yet initialized and the PES payload has no PTS, avoiding NaN timestamps.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-604.eastasia.1.azurestaticapps.net |
Summary
btrtboxes and Dolby-compatibleftypfor AC-3/E-AC-3 init segments256 * num_blks / sampling_frequency)Test plan