Skip to content

Commit 66a4476

Browse files
authored
Merge pull request #8 from gwendalsimon/feat/m2ts-mpts
feat: add m2tsMpts transparent whole-multiplex carriage mode
2 parents 54657fb + 9822ca8 commit 66a4476

1 file changed

Lines changed: 95 additions & 29 deletions

File tree

draft-gregoire-moq-msfts.md

Lines changed: 95 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ Program Specific Information (PSI), and other transport-stream syntax remain
190190
inside the source packets.
191191

192192
A publisher SHOULD place an independently usable random access point at the
193-
first media Object of each MOQT Group. For video, this normally means that the
194-
Group begins at or before the transport-stream packets carrying a random access
195-
point and includes the PAT and PMT packets required for program demultiplexing.
196-
Codec-level initialization data is carried inside the elementary stream packets
197-
of the first video access unit and is therefore present whenever a random access
198-
point is included.
193+
first media Object of each MOQT Group. For single-program video tracks, this
194+
normally means that the Group begins at or before the transport-stream packets
195+
carrying a random access point and includes the PAT and PMT packets required
196+
for program demultiplexing. Codec-level initialization data is carried inside
197+
the elementary stream packets of the first video access unit and is therefore
198+
present whenever a random access point is included.
199199

200200
When `m2tsRandomAccess` ({{m2ts-random-access}}) is true, the first media Object
201201
in every Group MUST provide a valid random access starting point for the
@@ -235,11 +235,13 @@ assuming every Object has the declared size.
235235

236236
## Multi-Program Source Handling {#mpts}
237237

238-
An m2ts track SHOULD carry packets from at most one MPEG-2 program,
239-
producing a single-program transport stream. A publisher receiving a
240-
multi-program transport stream (MPTS) SHOULD produce a separate m2ts track
241-
for each program it wishes to offer, filtering the source packets so that
242-
each track contains only:
238+
When a publisher receives a multi-program transport stream (MPTS), it may
239+
either produce a separate m2ts track for each program by filtering the source,
240+
or carry the complete multiplex transparently by setting `m2tsMpts`
241+
({{m2ts-mpts}}) to true.
242+
243+
A publisher producing per-program tracks SHOULD filter the source packets so
244+
that each track contains only:
243245

244246
* Null packets with Packet Identifier (PID) 0x1FFF, which MAY be removed or
245247
retained at the publisher's discretion.
@@ -256,13 +258,24 @@ required for descrambling; conditional access integration is application-specifi
256258
and outside the scope of this document.
257259

258260
The `m2tsProgramNumber` field ({{m2ts-program-number}}) SHOULD be present on
259-
tracks derived from a multi-program source to identify the program carried.
260-
261-
When multiple tracks are derived from the same MPTS source, the publisher
262-
SHOULD use the MSF `altGroup` field if the programs are alternate renditions
263-
of the same content. Programs that are independent services SHOULD be
264-
published as separate tracks; whether to include them in the same catalog is
265-
application-specific.
261+
per-program tracks to identify the program carried. When multiple per-program
262+
tracks are derived from the same MPTS source, the publisher SHOULD use the MSF
263+
`altGroup` field if the programs are alternate renditions of the same content;
264+
programs that are independent services SHOULD be published as separate tracks.
265+
266+
A publisher MAY instead carry the complete multi-program transport stream
267+
without program selection or PID filtering, by setting `m2tsMpts`
268+
({{m2ts-mpts}}) to true. In this mode, all source packets from the multiplex
269+
are emitted without PAT rewrite. Because no per-program filtering occurs,
270+
MOQT serves only as a scalable transport layer; per-track program subscription,
271+
per-program catalog fields, and the subscriber join behavior defined in this
272+
document do not apply. When `m2tsMpts` is true, `m2tsProgramNumber`,
273+
`m2tsPmtPid`, and `m2tsPcrPid` MUST be absent.
274+
275+
Group boundary placement for `m2tsMpts` tracks depends on whether the publisher
276+
can identify random access points across the multiplex: if it can, it MAY align
277+
Group boundaries to those points and set `m2tsRandomAccess` to true; otherwise
278+
it SHOULD start a new Group after a fixed number of Objects.
266279

267280
## PCR and Timing {#pcr-timing}
268281

@@ -315,6 +328,7 @@ Table 1 lists the m2ts-specific fields defined within a track object.
315328
| M2TS random access | m2tsRandomAccess | {{m2ts-random-access}} |
316329
| M2TS timestamp mode | m2tsTimestampMode | {{m2ts-timestamp-mode}} |
317330
| M2TS SCTE-35 PID | m2tsScte35Pid | {{m2ts-scte35-pid}} |
331+
| M2TS MPTS | m2tsMpts | {{m2ts-mpts}} |
318332
| Initialization data | initData | {{init-data}} |
319333

320334
## M2TS Packet Size {#m2ts-packet-size}
@@ -338,34 +352,40 @@ advisory. Receivers MUST validate each Object using its actual payload length.
338352
Required: Optional JSON Type: Number Location: Track Object
339353

340354
The MPEG-2 Transport Stream program number carried by this track. When
341-
present, the track SHOULD carry packets from only that program (see
342-
{{mpts}}). When absent, a track MAY carry multiple programs and subscribers
343-
MAY select a program using local policy or transport-stream signaling.
355+
present, the track SHOULD carry packets from only that program. When absent
356+
and `m2tsMpts` is not true, subscribers MAY select a program using local
357+
policy or transport-stream signaling. This field MUST be absent when
358+
`m2tsMpts` is true.
344359

345360
## M2TS PMT PID {#m2ts-pmt-pid}
346361

347362
Required: Optional JSON Type: Number Location: Track Object
348363

349364
The packet identifier carrying the Program Map Table for `m2tsProgramNumber`.
350365
This field is advisory and does not replace the Program Association Table or
351-
Program Map Table carried in the transport stream.
366+
Program Map Table carried in the transport stream. It MUST be absent when
367+
`m2tsMpts` is true.
352368

353369
## M2TS PCR PID {#m2ts-pcr-pid}
354370

355371
Required: Optional JSON Type: Number Location: Track Object
356372

357373
The packet identifier carrying the Program Clock Reference for the program
358374
identified by `m2tsProgramNumber`. This field is advisory and does not
359-
replace PCR signaling in the transport stream.
375+
replace PCR signaling in the transport stream. It MUST be absent when
376+
`m2tsMpts` is true.
360377

361378
## M2TS PSI Interval {#m2ts-psi-interval}
362379

363380
Required: Optional JSON Type: Number Location: Track Object
364381

365-
The maximum interval, in milliseconds, at which the publisher expects to repeat
366-
the Program Association Table and Program Map Table in the packet stream. When
367-
present, publishers SHOULD repeat PSI at an interval no larger than this value
368-
for live content. Subscribers MAY use this value to estimate join latency.
382+
The maximum interval, in milliseconds, at which the publisher expects the
383+
Program Association Table and Program Map Table to repeat in the packet stream.
384+
For single-program tracks, publishers SHOULD repeat PSI at an interval no
385+
larger than this value for live content. For `m2tsMpts` tracks, the publisher
386+
does not control PSI injection; when present, this field describes the source
387+
multiplex PSI repetition rate and is advisory only. Subscribers MAY use this
388+
value to estimate join latency in both modes.
369389

370390
## M2TS Random Access {#m2ts-random-access}
371391

@@ -396,6 +416,14 @@ descriptor. When present, receivers MAY use this value to locate splice events
396416
without parsing PMT. Publishers SHOULD include this field when the track carries
397417
SCTE-35 splice signaling.
398418

419+
## M2TS MPTS {#m2ts-mpts}
420+
421+
Required: Optional JSON Type: Boolean Location: Track Object
422+
423+
When true, this track carries a multi-program transport stream without program
424+
selection or PID filtering. `m2tsProgramNumber`, `m2tsPmtPid`, and
425+
`m2tsPcrPid` MUST be absent when this field is true.
426+
399427
## Initialization Data {#init-data}
400428

401429
Required: Optional JSON Type: String Location: Track Object
@@ -411,6 +439,11 @@ reflect the new PAT and PMT before publishing subsequent Objects.
411439
Receivers MUST NOT assume that `initData` remains valid after a version change
412440
in transport-stream PSI; updated PSI in the media Objects takes precedence.
413441

442+
For `m2tsMpts` tracks, encoding `initData` requires extracting PAT and all
443+
program PMTs from the source multiplex. Publishers that do not inspect the
444+
source stream typically omit `initData`; subscribers will encounter PSI within
445+
one PSI repetition cycle regardless of Group boundaries.
446+
414447
# Catalog Examples {#catalog-examples}
415448

416449
The following examples are non-normative.
@@ -493,7 +526,7 @@ The following examples are non-normative.
493526
}
494527
~~~
495528

496-
## Multi-Program Source - Two Programs from One MPTS {#example-mpts}
529+
## Multi-Program Source - Per-Program Tracks {#example-mpts}
497530

498531
This example shows a catalog for a publisher that receives a 2-program
499532
transport stream and publishes each program as a separate m2ts track. The
@@ -543,6 +576,35 @@ used because the programs carry different content.
543576
}
544577
~~~
545578

579+
## Transparent MPTS Carriage {#example-mpts-transparent}
580+
581+
This example shows a catalog for a publisher that carries a complete
582+
multi-program transport stream without program selection, so no per-program
583+
catalog fields are present. The `m2tsPsiInterval` field is included as an
584+
advisory hint; its value is not normative for MPTS tracks.
585+
586+
~~~ json
587+
{
588+
"version": 1,
589+
"generatedAt": 1746104606044,
590+
"tracks": [
591+
{
592+
"name": "mux-1",
593+
"namespace": "live.example.com/mux/1",
594+
"packaging": "m2ts",
595+
"isLive": true,
596+
"targetLatency": 1000,
597+
"mimeType": "video/mp2t",
598+
"bitrate": 20000000,
599+
"m2tsPacketSize": 188,
600+
"m2tsPacketsPerObject": 64,
601+
"m2tsMpts": true,
602+
"m2tsPsiInterval": 100
603+
}
604+
]
605+
}
606+
~~~
607+
546608
## ABR Alternate Renditions - Two Bitrate Tracks {#example-abr}
547609

548610
This example shows a catalog for a live channel published at two bitrates as
@@ -622,7 +684,7 @@ one complete PSI repetition cycle before its target presentation time; when
622684
needed. A subscriber MAY use the MSF Media Timeline {{MSF}} to resolve this
623685
time bound to a concrete MOQT Group location for use with a Joining FETCH
624686
{{MoQTransport}}. A subscriber MUST NOT begin media presentation until it has
625-
received a valid PAT and PMT for the track.
687+
received a valid PAT and PMT for the program to be decoded.
626688

627689
# Relay Processing {#relay-processing}
628690

@@ -639,6 +701,10 @@ Object of the Group or through initialization data ({{init-data}}).
639701

640702
# Switching and Alternate Renditions {#switching}
641703

704+
Tracks with `m2tsMpts` set to true MUST NOT be included in an `altGroup`,
705+
because ABR switching semantics require per-program Group alignment and PCR
706+
continuity that transparent carriage does not guarantee.
707+
642708
Multiple m2ts tracks can be advertised as alternatives using the MSF `altGroup`
643709
field. Video tracks in the same alternate group MUST place Group boundaries at
644710
identical presentation positions; other tracks SHOULD align their Group

0 commit comments

Comments
 (0)