Skip to content

Commit 617f4ab

Browse files
authored
Merge pull request #2 from gwendalsimon/pr1-mpts-handling
add Multi-Program Transport Stream (MPTS) handling
2 parents 4025c5b + b1dc9f0 commit 617f4ab

1 file changed

Lines changed: 96 additions & 6 deletions

File tree

draft-gregoire-moq-msfts.md

Lines changed: 96 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ Random access point:
114114
: A point in the packet stream at which a receiver can begin decoding after
115115
receiving the applicable transport-stream tables and decoder initialization.
116116

117+
Single-program transport stream:
118+
: A transport stream whose Program Association Table lists exactly one
119+
program.
120+
121+
Multi-program transport stream:
122+
: A transport stream whose Program Association Table lists two or more
123+
programs.
124+
117125
# Scope
118126

119127
This specification defines:
@@ -208,6 +216,37 @@ packets per media Object. The final Object of a Group MAY contain fewer source
208216
packets. Receivers MUST use the actual Object payload length rather than
209217
assuming every Object has the declared size.
210218

219+
## Multi-Program Source Handling {#mpts}
220+
221+
An m2ts track SHOULD carry packets from at most one MPEG-2 program,
222+
producing a single-program transport stream. A publisher receiving a
223+
multi-program transport stream (MPTS) SHOULD produce a separate m2ts track
224+
for each program it wishes to offer, filtering the source packets so that
225+
each track contains only:
226+
227+
* Null packets (PID 0x1FFF), which MAY be removed or retained at the
228+
publisher's discretion.
229+
* Program Association Table packets (PID 0x0000), rewritten to list only the
230+
program present in this track.
231+
* Program Map Table packets for the selected program (whose PID is listed in
232+
the Program Association Table entry for that program).
233+
* All packets whose PID is listed in the Program Map Table of the selected
234+
program, including the PCR_PID and the PIDs of all elementary streams.
235+
236+
These rules apply to unscrambled transport stream sources. Publishers filtering scrambled
237+
transport streams MUST also retain conditional access table and entitlement
238+
message packets required for descrambling; conditional access handling is
239+
discussed in {{content-protection}}.
240+
241+
The `m2tsProgramNumber` field ({{m2ts-program-number}}) SHOULD be present on
242+
tracks derived from a multi-program source to identify the program carried.
243+
244+
When multiple tracks are derived from the same MPTS source, the publisher
245+
SHOULD use the MSF `altGroup` field if the programs are alternate renditions
246+
of the same content. Programs that are independent services SHOULD be
247+
published as separate tracks; whether to include them in the same catalog is
248+
application-specific.
249+
211250
# Catalog {#catalog}
212251

213252
An m2ts track is described by the MSF catalog {{MSF}}. The catalog track name,
@@ -253,9 +292,10 @@ advisory. Receivers MUST validate each Object using its actual payload length.
253292

254293
Required: Optional JSON Type: Number Location: Track Object
255294

256-
The MPEG-2 Transport Stream program number that the subscriber is expected to
257-
decode. If absent, subscribers MAY select a program using local policy or
258-
transport-stream signaling.
295+
The MPEG-2 Transport Stream program number carried by this track. When
296+
present, the track SHOULD carry packets from only that program (see
297+
{{mpts}}). When absent, a track MAY carry multiple programs and subscribers
298+
MAY select a program using local policy or transport-stream signaling.
259299

260300
## M2TS PMT PID {#m2ts-pmt-pid}
261301

@@ -269,9 +309,9 @@ Program Map Table carried in the transport stream.
269309

270310
Required: Optional JSON Type: Number Location: Track Object
271311

272-
The packet identifier carrying the Program Clock Reference for the selected
273-
program. This field is advisory and does not replace PCR signaling in the
274-
transport stream.
312+
The packet identifier carrying the Program Clock Reference for the program
313+
identified by `m2tsProgramNumber`. This field is advisory and does not
314+
replace PCR signaling in the transport stream.
275315

276316
## M2TS PSI Interval {#m2ts-psi-interval}
277317

@@ -395,6 +435,56 @@ The following examples are non-normative.
395435
}
396436
~~~
397437

438+
## Multi-Program Source — Two Programs from One MPTS {#example-mpts}
439+
440+
This example shows a catalog for a publisher that receives a 2-program
441+
transport stream and publishes each program as a separate m2ts track. The
442+
two tracks share a namespace but are independent services; `altGroup` is not
443+
used because the programs carry different content.
444+
445+
~~~ json
446+
{
447+
"version": 1,
448+
"generatedAt": 1746104606044,
449+
"tracks": [
450+
{
451+
"name": "program-1",
452+
"namespace": "live.example.com/mux/1",
453+
"packaging": "m2ts",
454+
"isLive": true,
455+
"targetLatency": 1000,
456+
"role": "video",
457+
"mimeType": "video/mp2t",
458+
"bitrate": 6000000,
459+
"m2tsPacketSize": 188,
460+
"m2tsPacketsPerObject": 64,
461+
"m2tsProgramNumber": 1,
462+
"m2tsPmtPid": 256,
463+
"m2tsPcrPid": 257,
464+
"m2tsPsiInterval": 100,
465+
"m2tsRandomAccess": true
466+
},
467+
{
468+
"name": "program-2",
469+
"namespace": "live.example.com/mux/1",
470+
"packaging": "m2ts",
471+
"isLive": true,
472+
"targetLatency": 1000,
473+
"role": "video",
474+
"mimeType": "video/mp2t",
475+
"bitrate": 4000000,
476+
"m2tsPacketSize": 188,
477+
"m2tsPacketsPerObject": 64,
478+
"m2tsProgramNumber": 2,
479+
"m2tsPmtPid": 512,
480+
"m2tsPcrPid": 513,
481+
"m2tsPsiInterval": 100,
482+
"m2tsRandomAccess": true
483+
}
484+
]
485+
}
486+
~~~
487+
398488
# Subscriber Processing {#subscriber-processing}
399489

400490
A subscriber obtains the catalog using the MSF catalog workflow and subscribes

0 commit comments

Comments
 (0)