Repository navigation
Add --per-program for SRT ingest - #61
Open
gwendalsimon wants to merge 2 commits into
Open
gwendalsimon wants to merge 2 commits into
gwendalsimon wants to merge 2 commits into
Conversation
The PSI scan of a single-program live source read at most 4096 packets, which is 154 ms at 40 Mbit/s. An encoder that sends a PAT every 476 ms, within the 500 ms of ETSI TR 101 290, then failed most starts with "No PAT found at the start of the source". * On a live source, wait for the PAT up to 1 s of PCR time (kPsiWindowPcr), then for its PMT up to 1 s after the PAT. * Cap the single-program live scan, which keeps what it reads, at 106,400 packets (2 s at 80 Mbit/s, about 20 MB). A source without a PCR stops at that cap. * A program of a multiplex (timed windows) now also waits up to 1 s after the PAT for its PMT, where it stopped 1 s after the first PCR. Its 600,000-packet cap and stall error are unchanged. * Keep the 4096-packet scan for seekable files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SRT ingest always forwarded the source unmodified. On a constant-rate contribution feed, the null packets can be a large share of the rate, for example 7.5 of 20 Mbit/s. Per-program carriage removes them and declares the source's rate in mpeg2tsMuxRate, so that a receiver can pad back to it. * --per-program opts SRT ingest into per-program carriage; without it, SRT ingest stays unmodified, as before. The decision is moq2ts::srtCarriage, with its own test. * --si, --retain-si, and --retain-null apply with it, and their "ignored" warning no longer appears. --per-program with --unmodified is refused, and --per-program without SRT ingest warns. * When the PAT of a live source stops listing the program, as during an encoder restart, the per-program track ends and a new session waits for a PAT that lists the program, without a deadline and keeping nothing until then, instead of the process exiting. It logs one line when it starts waiting. An interrupt during the wait is not an error, so the process exits 0. The wait's packet counters are 64-bit. * At open, per-program carriage now takes the first PAT that lists the program, not only the first PAT. A file whose first PAT lacks the program and a later one lists it now opens. * Tests: a constant-rate live source in per-program carriage (no null packet, PAT and PCR carried, the source's rate declared; nulls kept and no rate with --retain-null); an encoder restart of 0.6, 1.5, and 2.5 s, the last also without a PCR (no error, a second session that publishes); an interrupt during the wait (no error); and the wait's memory bound. Depends on the live PSI window (openmoq#59): per-program carriage needs the PMT, which a 4096-packet scan misses at high rates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
@gwendalsimon Holding this until the next MSFTS draft revision is out. |
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.
I added an opt-in
--per-programoption, so that SRT ingest can publish one program without its null packets. Unmodified carriage stays the default. On a constant-rate contribution feed, the nulls can take a large share of the rate. The catalog declares the source's rate inmpeg2tsMuxRate, so a receiver can pad back to it.With
--per-program, the--si,--retain-si, and--retain-nulloptions apply on SRT. When the PAT stops listing the program, as during an encoder restart, the track ends and a new session waits for the program instead of the process exiting.This PR depends on #59, because per-program carriage needs the PMT, which the old scan misses at high rates. I tested it in November 2026. New tests cover the nulls, the rate, the restart, and an interrupt during the wait. All 22 unit tests pass.
This change is