Repository navigation
feat(mux): export whole-PES tracks at their placement - #5832
Conversation
|
Quest outcome: implemented (written by Claude Opus 5.5) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f0801934d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let pts = (pts_dts & 0b10 != 0).then(|| { | ||
| let b = &fields[..5]; | ||
| u64::from((b[0] >> 1) & 7) << 30 |
There was a problem hiding this comment.
Reject malformed PES clock fields
Reject PTS/DTS fields whose 4-bit prefixes or mandatory marker bits are invalid. Currently any five bytes are decoded whenever PTS_DTS_flags announces a timestamp, so a frame with cleared marker bits or a PTS-only field lacking the 0010 prefix passes validation, is emitted unchanged, and may be rejected or mis-timed downstream despite the new format requiring consumers to refuse malformed PES packets. The DTS field in the 11 form needs the same validation.
AGENTS.md reference: AGENTS.md:L17-L18
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2ccb457: each PTS/DTS field now needs its prefix ('0010' alone, '0011' with '0001' for the DTS) and all three marker bits, with unit tests for both fields.
(written by Claude Opus 5.5)
Add the `pesPacket` member to an `mpegts.tracks` entry: each frame is one whole PES packet, written unchanged and sent no earlier than its timestamp, the source's placement. Tune-in compares that placement with the keyframe's departure rather than its PTS. A malformed frame, or an entry naming both carriages or also described as a rendition, fails the export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2ccb457 to
8ce97fa
Compare
|
Merge status: not merged yet. This needs a maintainer call.
TS validation isn't a required check. I recommend merging, and fixing the MP2 start hole as its own quest rather than rerunning until it goes green. (written by Claude Opus 5.5) |
|
Root cause of the TS validation failure ("TS full multiplex at its own rate", one missing MP2 frame at the start of the capture), confirmed by the maintainer: the TS export subscribes at the live edge with a zero Summary: export reads
Codex's clock-field finding is fixed. (written by Claude Opus 5.5) |
Problem
The TS importer is moving private PES (teletext, DVB subtitles, DVB AC-3, KLV, unknown private types) to one whole PES packet per frame, timestamped with its placement on the program clock (#5718, decided in the
ts-reliabilityepic). Export has to read that before the importer writes it, so main never publishes a catalog its exporter can't read. This completesquest/m1/ts-reliability/pes-export.md.Approach
pesPacket: { streamType }member on anmpegts.tracksentry, besideverbatim. Old exporters ignore the entry; they don't refuse the catalog.mpeg2tswriter rebuilds the PES header. The frame's timestamp is an arrival time, so it gets its own path,Schedule::push_placed:PES_packet_length, complete optional header where thestream_idhas one; a zero length only on a videostream_idor on 0xFD with a video stream type such as VC-1);verbatimandpesPacket;verbatimorpesPacketentry whose track is also a media rendition.Tracktype, the ignore rule,PesPacketin {{verbatim}}, {{rebuild}}, changelog -01.Tests (
export_test.rs,export.rsunit tests,catalog.rs):data_alignment_indicatorclear, private_stream_2 and padding, and sizes around one packet;just checkpasses locally (3253 moq-mux/workspace tests).Impact
moq_mux::container::ts::Trackgainspes_packet: Option<PesPacket>; new exportts::PesPacket { stream_type }withPesPacket::new. Both are#[non_exhaustive].mpegts.tracks.*.pesPacket.streamType. Backwards compatible: older consumers ignore the entry, so they drop the track.verbatimentry that is also a media rendition (the draft already forbade it).js/interprets thempegtssection.Decisions
Settled by the maintainer:
doc/lib/rs/moq-mux.md. Unchanged. Nothing a user does changes until the importer writespesPacket, andpes-importowns those lines.Alternatives
Track::push/Schedule::push_frameswith a decode deadline at the placement. That sends the PES a slot early, as an unbounded PID's units go, and fails padded output on the deadline.framingvalue instead of a member. The epic rejected it: published exporters would refuse the whole catalog.Follow-ups
pes-import: writepesPacket, deleteFraming::Pesand the AC-3 repack. Now unblocked.section-placement: sections can reuseSchedule::push_placedand the key-based tune-in rule.(written by Claude Opus 5.5)
🤖 Generated with Claude Code