├── .github └── workflows │ ├── auto-publish.yml │ └── check-pr.yml ├── .gitignore ├── .pr-preview.json ├── README.md ├── images ├── AccessUnitSplit_Example.png └── t-std.svg ├── index.bs └── requirements.txt /.github/workflows/auto-publish.yml: -------------------------------------------------------------------------------- 1 | name: Auto-Publish 2 | on: 3 | push: 4 | branches: [main] 5 | 6 | permissions: 7 | contents: read 8 | pages: write 9 | id-token: write 10 | 11 | jobs: 12 | main: 13 | name: Compile and deploy 14 | runs-on: ubuntu-24.04 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | - uses: actions/setup-python@v5 19 | with: 20 | python-version: 3.12 21 | cache: 'pip' 22 | - run: pip install -r requirements.txt 23 | 24 | - name: Run bikeshed 25 | run: | 26 | bikeshed --version 27 | bikeshed spec 28 | mkdir dist 29 | cp *.html dist 30 | cp -r images dist 31 | 32 | - name: Upload artifact 33 | uses: actions/upload-pages-artifact@v3 34 | with: 35 | path: ./dist 36 | 37 | - name: Deploy to GitHub Pages 38 | id: deployment 39 | uses: actions/deploy-pages@v4 40 | -------------------------------------------------------------------------------- /.github/workflows/check-pr.yml: -------------------------------------------------------------------------------- 1 | name: Check PR 2 | on: 3 | pull_request: 4 | 5 | jobs: 6 | main: 7 | name: Run checks for specification 8 | runs-on: ubuntu-24.04 9 | 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: actions/setup-python@v5 13 | with: 14 | python-version: 3.12 15 | cache: 'pip' 16 | - run: pip install -r requirements.txt 17 | 18 | - name: Run bikeshed 19 | run: | 20 | bikeshed --version 21 | bikeshed spec 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Generic 2 | .DS_Store 3 | index.html 4 | 5 | ### Python 6 | # Byte-compiled / optimized / DLL files 7 | __pycache__/ 8 | *.py[cod] 9 | *$py.class 10 | 11 | # C extensions 12 | *.so 13 | 14 | # Distribution / packaging 15 | .Python 16 | build/ 17 | develop-eggs/ 18 | dist/ 19 | downloads/ 20 | eggs/ 21 | .eggs/ 22 | lib/ 23 | lib64/ 24 | parts/ 25 | sdist/ 26 | var/ 27 | wheels/ 28 | share/python-wheels/ 29 | *.egg-info/ 30 | .installed.cfg 31 | *.egg 32 | MANIFEST 33 | 34 | # PyInstaller 35 | # Usually these files are written by a python script from a template 36 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 37 | *.manifest 38 | *.spec 39 | 40 | # Installer logs 41 | pip-log.txt 42 | pip-delete-this-directory.txt 43 | 44 | # Unit test / coverage reports 45 | htmlcov/ 46 | .tox/ 47 | .nox/ 48 | .coverage 49 | .coverage.* 50 | .cache 51 | nosetests.xml 52 | coverage.xml 53 | *.cover 54 | *.py,cover 55 | .hypothesis/ 56 | .pytest_cache/ 57 | cover/ 58 | 59 | # Translations 60 | *.mo 61 | *.pot 62 | 63 | # Django stuff: 64 | *.log 65 | local_settings.py 66 | db.sqlite3 67 | db.sqlite3-journal 68 | 69 | # Flask stuff: 70 | instance/ 71 | .webassets-cache 72 | 73 | # Scrapy stuff: 74 | .scrapy 75 | 76 | # Sphinx documentation 77 | docs/_build/ 78 | 79 | # PyBuilder 80 | .pybuilder/ 81 | target/ 82 | 83 | # Jupyter Notebook 84 | .ipynb_checkpoints 85 | 86 | # IPython 87 | profile_default/ 88 | ipython_config.py 89 | 90 | # pyenv 91 | # For a library or package, you might want to ignore these files since the code is 92 | # intended to run in multiple environments; otherwise, check them in: 93 | # .python-version 94 | 95 | # pipenv 96 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 97 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 98 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 99 | # install all needed dependencies. 100 | #Pipfile.lock 101 | 102 | # UV 103 | # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. 104 | # This is especially recommended for binary packages to ensure reproducibility, and is more 105 | # commonly ignored for libraries. 106 | #uv.lock 107 | 108 | # poetry 109 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 110 | # This is especially recommended for binary packages to ensure reproducibility, and is more 111 | # commonly ignored for libraries. 112 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 113 | #poetry.lock 114 | 115 | # pdm 116 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 117 | #pdm.lock 118 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 119 | # in version control. 120 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 121 | .pdm.toml 122 | .pdm-python 123 | .pdm-build/ 124 | 125 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 126 | __pypackages__/ 127 | 128 | # Celery stuff 129 | celerybeat-schedule 130 | celerybeat.pid 131 | 132 | # SageMath parsed files 133 | *.sage.py 134 | 135 | # Environments 136 | .env 137 | .venv 138 | env/ 139 | venv/ 140 | ENV/ 141 | env.bak/ 142 | venv.bak/ 143 | 144 | # Spyder project settings 145 | .spyderproject 146 | .spyproject 147 | 148 | # Rope project settings 149 | .ropeproject 150 | 151 | # mkdocs documentation 152 | /site 153 | 154 | # mypy 155 | .mypy_cache/ 156 | .dmypy.json 157 | dmypy.json 158 | 159 | # Pyre type checker 160 | .pyre/ 161 | 162 | # pytype static type analyzer 163 | .pytype/ 164 | 165 | # Cython debug symbols 166 | cython_debug/ 167 | 168 | # PyCharm 169 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 170 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 171 | # and can be added to the global gitignore or merged into this file. For a more nuclear 172 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 173 | #.idea/ 174 | 175 | # Ruff stuff: 176 | .ruff_cache/ 177 | 178 | # PyPI configuration file 179 | .pypirc -------------------------------------------------------------------------------- /.pr-preview.json: -------------------------------------------------------------------------------- 1 | { 2 | "src_file": "index.html", 3 | "type": "respec" 4 | } 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # av1-mpeg2-ts 2 | Official specification of the AOM group for the carriage of AV1 in MPEG-2 Transport Stream, written using Bikeshed format (https://speced.github.io/bikeshed/) -------------------------------------------------------------------------------- /images/AccessUnitSplit_Example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AOMediaCodec/av1-mpeg2-ts/8def60e931dc2683f89406592080af9ee5752251/images/AccessUnitSplit_Example.png -------------------------------------------------------------------------------- /images/t-std.svg: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 31 | 33 | 53 | 55 | 60 | 61 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 175 | 180 | 185 | 190 | 195 | 200 | 205 | 210 | 215 | 220 | 225 | 230 | 235 | 240 | 245 | 250 | 255 | 260 | 265 | 270 | 275 | 280 | 285 | 290 | 295 | 300 | 305 | 310 | 315 | 320 | 325 | 330 | 335 | 340 | 345 | 350 | 355 | 360 | 365 | 370 | 375 | 380 | 385 | 390 | 395 | 400 | 405 | 410 | 415 | 420 | 425 | 430 | 435 | 440 | 445 | 450 | 455 | 456 | 457 | -------------------------------------------------------------------------------- /index.bs: -------------------------------------------------------------------------------- 1 |
  2 | Group: AOM
  3 | Status: WGD
  4 | Text Macro: SPECVERSION v1.0.1
  5 | Title: Carriage of AV1 in MPEG-2 TS
  6 | URL: https://AOMediaCodec.github.io/av1-mpeg2-ts
  7 | Shortname: av1-mpeg2-ts
  8 | Editor: Kieran Kunhya
  9 | Editor: Thibaud Biatek
 10 | Abstract: This document specifies how to carry [[!AV1]] video elementary streams in the MPEG-2 Transport Stream format.
 11 | Date: 2021-10-04
 12 | Repository: AOMediaCodec/av1-mpeg2-ts
 13 | Inline Github Issues: full
 14 | Boilerplate: property-index no, issues-index no, copyright yes
 15 | Markup Shorthands: css no
 16 | 
17 | 18 |
 19 | {
 20 |   "MPEG-2-TS": {
 21 |     "title": "Information technology — Generic coding of moving pictures and associated audio information — Part 1: Systems",
 22 |     "href": "https://www.iso.org/standard/83239.html",
 23 |     "status": "Standard",
 24 |     "publisher": "ISO"
 25 |   },
 26 |   "ETSI-EN300468": {
 27 |     "title": "Digital Video Broadcasting (DVB); Specification for Service Information (SI) in DVB systems",
 28 |     "href": "https://www.etsi.org/deliver/etsi_en/300400_300499/300468/",
 29 |     "status": "Standard",
 30 |     "publisher": "ETSI"
 31 |   },
 32 |   "BT-1886": {
 33 |     "title": "Recommendation BT.1886 : Reference electro-optical transfer function for flat panel displays used in HDTV studio production",
 34 |     "href": "https://www.itu.int/rec/R-REC-BT.1886",
 35 |     "status": "Recommendation",
 36 |     "publisher": "ITU"
 37 |   },
 38 |   "BT-709": {
 39 |     "title": "Recommendation BT.709 : Parameter values for the HDTV standards for production and international programme exchange",
 40 |     "href": "https://www.itu.int/rec/R-REC-BT.709",
 41 |     "status": "Recommendation",
 42 |     "publisher": "ITU"
 43 |   },
 44 |   "BT-2020": {
 45 |     "title": "Recommendation BT.2020 : Parameter values for ultra-high definition television systems for production and international programme exchange",
 46 |     "href": "https://www.itu.int/rec/R-REC-BT.2020",
 47 |     "status": "Recommendation",
 48 |     "publisher": "ITU"
 49 |   }
 50 | }
 51 | 
52 | 53 | 101 | 102 | # Introduction 103 | 104 | This document specifies how to carry [[!AV1]] video elementary streams in the MPEG-2 Transport Stream format [[MPEG-2-TS]]. It does not specify the presentation of AV1 streams in the context of a program stream. 105 | 106 | This document defines the carriage of AV1 in a single PID, assuming buffer model info from the first operating point. It may not be optimal for layered streams or streams with multiple operating points. Future versions may incorporate this capability. 107 | 108 | ## Modal verbs terminology 109 | In the present document "shall", "shall not", "should", "should not", "may", "need not", "will", "will not", "can" and "cannot" are to be interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions). 110 | 111 | ## Definition of mnemonics and syntax function 112 | In the present document the mnemonics, the syntax functions, and the syntax descriptors are to be interpreted as described in [[!MPEG-2-TS]]. The uimsbf and bslbf mnemonics are defined in Section 2.2.6 of [[!MPEG-2-TS]]. The nextbits() function is interpreted as in [[!MPEG-2-TS]]. 113 | 114 | # Identifying AV1 streams in MPEG-2 TS 115 | 116 | ## AV1 registration descriptor 117 | 118 | The presence of a Registration Descriptor, as defined in [[!MPEG-2-TS]], is mandatory with the format_identifier field set to 'AV01' (A-V-0-1). The Registration Descriptor shall be the first in the PMT loop and included before the AV1 video descriptor. 119 | 120 | ### Syntax 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 |
SyntaxNo. Of bitsMnemonic
registration_descriptor() {
descriptor_tag8uimsbf
descriptor_length8uimsbf
format_identifier32uimsbf
}
156 | 157 | ### Semantics 158 | 159 | descriptor_tag - This value shall be set to 0x05. 160 | 161 | descriptor_length - This value shall be set to 4. 162 | 163 | format_identifier - This value shall be set to 'AV01' (A-V-0-1). 164 | 165 | ## AV1 video descriptor 166 | 167 | The AV1 video descriptor provides basic information for identifying coding parameters, such as profile and level parameters of an AV1 video stream. The same data structure as AV1CodecConfigurationRecord in ISOBMFF is used to aid conversion between the two formats, EXCEPT that two of the reserved bits are used for HDR/WCG identification. The syntax and semantics for this descriptor appears in the table below and in the subsequent text. 168 | 169 | If an AV1 video descriptor is associated with an AV1 video stream, then this descriptor shall be conveyed in the descriptor loop for the respective elementary stream entry in the program map table. 170 | 171 | ### Syntax 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 |
SyntaxNo. Of bitsMnemonic
AV1_video_descriptor() {
descriptor_tag8uimsbf
descriptor_length8uimsbf
marker1bslbf
version7uimsbf
seq_profile3uimsbf
seq_level_idx_05uimsbf
seq_tier_01bslbf
high_bitdepth1bslbf
twelve_bit1bslbf
monochrome1bslbf
chroma_subsampling_x1bslbf
chroma_subsampling_y1bslbf
chroma_sample_position2uimsbf
hdr_wcg_idc2uimsbf
reserved_zeros1bslbf
initial_presentation_delay_present1bslbf
if (initial_presentation_delay_present) {
initial_presentation_delay_minus_one4uimsbf
} else {
reserved_zeros4uimsbf
}
}
297 | 298 | ### Semantics 299 | 300 | descriptor_tag - This value shall be set to 0x80. 301 | 302 | descriptor_length - This value shall be set to 4. 303 | 304 | marker - This value shall be set to 1. 305 | 306 | version - This field indicates the version of the AV1_video_descriptor. This value shall be set to 1. 307 | 308 | seq_profile, seq_level_idx_0 and high_bitdepth - These fields shall be coded according to the semantics defined in [[!AV1]]. If these fields are not coded in the Sequence Header OBU in the AV1 video stream, the inferred values are coded in the descriptor. 309 | 310 | seq_tier_0, twelve_bit, monochrome, chroma_subsampling_x, chroma_subsampling_y, chroma_sample_position - These fields shall be coded according to the same semantics when they are present. If they are not present, they will be coded using the value inferred by the semantics. 311 | 312 | hdr_wcg_idc - The value of this syntax element indicates the presence or absence of high dynamic range (HDR) and/or wide color gamut (WCG) video components in the associated PID according to the table below. HDR is defined to be video that has high dynamic range if the video stream EOTF is higher than the reference EOTF defined in [[!BT-1886]]. WCG is defined to be video that is coded using colour primaries with a colour gamut not contained within [[!BT-709]]. 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 |
hdr_wcg_idcDescription
0SDR, i.e., video is based on the reference EOTF defined in [BT-1886] with a color gamut that is contained within [BT-709] with a [BT-709] container
1WCG only, i.e., video color gamut in a [BT-2020] container that exceeds [BT-709]
2Both HDR and WCG are to be indicated in the stream
3No indication made regarding HDR/WCG or SDR characteristics of the stream
338 | 339 | reserved_zeros - Will be set to zeroes. 340 | 341 | initial_presentation_delay_present - Indicates initial_presentation_delay_minus_one field is present. 342 | 343 | initial_presentation_delay_minus_one - Ignored for [[!MPEG-2-TS]] use, included only to aid conversion to/from ISOBMFF. 344 | 345 | 346 | # Constraints on AV1 streams in MPEG-2 TS 347 | 348 | ## General constraints 349 | 350 | For AV1 video streams, the following constraints apply: 351 | * An AV1 video stream conforming to a profile defined in Annex A of [[!AV1]] shall be an element of an MPEG-2 program and the stream_type for this elementary stream shall be equal to 0x06 (MPEG-2 PES packets containing private data). 352 | * An AV1 video stream shall have the low overhead byte stream format as defined in [[!AV1]]. 353 | * The sequence_header_obu as specified in [[!AV1]], that are necessary for decoding an AV1 video stream shall be present within the elementary stream carrying that AV1 video stream. 354 | * An OBU may contain the *obu_size* field. For applications that need easy conversion to MP4, using the *obu_size* field is recommended. 355 | * OBU trailing bits should be limited to byte alignment and should not be used for padding. 356 | * Tile List OBUs shall not be used 357 | * Temporal Delimiters may be removed 358 | * Redundant Frame Headers and Padding OBUs may be used. 359 | 360 | In addition, a start code insertion and emulation prevention process shall be performed on the AV1 Bitstream prior to its PES encapsulation. This process is described in section 3.2. 361 | 362 | ## Start-code based format 363 | 364 | Prior to carriage into PES, the AV1 open_bitstream_unit() is encapsulated into ts_open_bitstream_unit(). This is required to provide direct access to OBU through a start-code mechanism inserted prior to each OBU. The following syntax describes how to retrieve the open_bitstream_unit() from the ts_open_bitstream_unit() (tsOBU). 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 |
SyntaxNo. Of bitsMnemonic
ts_open_bitstream_unit(NumBytesInTsObu) {
obu_start_code /* equal to 0x01 */24uimsbf
NumBytesInObu = 0
for( i = 2; i < NumBytesInTsObu; i++ ) {
if( i + 2 < NumBytesInTsObu && nextbits(24) == 0x000003 ) {
open_bitstream_unit[NumBytesInObu++]8uimsbf
open_bitstream_unit[NumBytesInObu++]8uimsbf
i += 2
emulation_prevention_three_byte /* equal to 0x03 */8uimsbf
} else
open_bitstream_unit[NumBytesInObu++]8uimsbf
}
435 | 436 | obu_start_code - This value shall be set to 0x000001. 437 | 438 | open_bitstream_unit[i] - i-th byte of the AV1 open bitstream unit (As defined in section 5.3 of [[!AV1]]). 439 | 440 | It is the responsability of the TS muxer to prevent start code emulation by escaping all the forbidden three-byte sequences using the emulation_prevention_three_byte (always equal to 0x03). The forbidden sequences are defined below. 441 | 442 | Within the ts_open_bitstream_unit() payload, the following three-byte sequences shall not occur at any byte-aligned position : 443 | * 0x000000 444 | * 0x000001 445 | * 0x000002 446 | 447 | Within the ts_open_bitstream_unit() payload, any four-byte sequence that starts with 0x000003 other than the following sequences shall not occur at any byte-aligned position : 448 | * 0x00000300 449 | * 0x00000301 450 | * 0x00000302 451 | * 0x00000303 452 | 453 | ## The AV1 Access Unit 454 | 455 | An AV1 Access Unit consists of all OBUs, including headers, between the end of the last OBU associated 456 | with the previous frame, and the end of the last OBU associated with the current frame. With this definition, an Access Unit sometimes maps with a Decodable Frame Group (DFG) as defined in Annex E of [[!AV1]] and some other times to a Temporal Unit (TU) as defined in [[!AV1]], or both, as illustrated in the figure below. An illustration is provided in the figure below for a group of pictures with frames predicted as follows : 457 | 458 | Practical example of an AV1 Access Unit split 459 |
460 |
Practical example of an AV1 Access Unit split
461 |
462 | 463 | ## Use of PES packets 464 | 465 | AV1 video encapsulated as defined in clause 4.2 is carried in PES packets as PES_packet_data_bytes, using the stream_id 0xBD (private_stream_id_1). 466 | 467 | A PES shall encapsulate one, and only one, AV1 access unit as defined in clause 4.3. All the PES shall have data_alignment_indicator set to 1. Usage of *data_stream_alignment_descriptor* is not specified and the only allowed *alignment_type* is 1 (Access unit level). 468 | 469 | The highest level that may occur in an AV1 video stream, as well as a profile and tier that the entire stream conforms to, shall be signalled using the AV1 video descriptor. 470 | 471 | ## Assignment of DTS and PTS 472 | 473 | For AV1 video stream multiplexed into [[!MPEG-2-TS]], the *decoder_model_info* may not be present. If the *decoder_model_info* is present, then the STD model shall match with the decoder model defined in Annex E of [[!AV1]]. 474 | 475 | For synchronization and STD management, PTSs and, when appropriate, DTSs are encoded in the header of the PES packet that carries the AV1 video stream data setting the PTS_DTS_flags to '01' or '11'. For PTS and DTS encoding, the constraints and semantics apply as defined in the PES Header and associated constraints on timestamp intervals. 476 | 477 | There are cases in AV1 bitstreams where information about a frame is sent multiple times. For example, first to be decoded, and subsequently to be displayed. In the case of a frame being decoded but not displayed, it is desired to assign a valid DTS but without need for a PTS. However, the MPEG2-TS specification prevents a DTS from being transmitted without a PTS. Hence, a PTS is always assigned for AV1 access units and its value is not relevant for frames being decoded but not displayed. 478 | 479 | To achieve consistency between the STD model and the buffer model defined in Annex E of [[!AV1]], the following PTS and DTS assignment rules shall be applied : 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 |
show_existing_frameshow_frameshowable_framePTSDTS
000ScheduledRemovalTiming[dfg]ScheduledRemovalTiming[dfg]
001ScheduledRemovalTiming[dfg]ScheduledRemovalTiming[dfg]
01n/aPresentationTime[frame]ScheduledRemovalTiming[dfg]
1n/an/aPresentationTime[frame]ScheduledRemovalTiming[dfg]
521 | 522 | Note : The ScheduleRemovalTiming[] and PresentationTime[] are defined in the Annex E of [[!AV1]]. 523 | 524 | ## Buffer considerations 525 | 526 | ### Buffer pool management 527 | 528 | Carriage of an AV1 video stream over [[!MPEG-2-TS]] does not impact the size of the Buffer Pool. 529 | 530 | For decoding of an AV1 video stream in the STD, the size of the Buffer Pool is as defined in [[!AV1]]. The Buffer Pool shall be managed as specified in Annex E of [[!AV1]]. 531 | 532 | A decoded AV1 access unit enters the Buffer Pool instantaneously upon decoding the AV1 access unit, hence at the Scheduled Removal Timing of the AV1 access unit. A decoded AV1 access unit is presented at the Presentation Time. 533 | 534 | If the AV1 video stream provides insufficient information to determine the Scheduled Removal Timing and the Presentation Time of AV1 access units, then these time instants shall be determined in the STD model from PTS and DTS timestamps as follows: 535 | 1. The Scheduled Removal Timing of AV1 access unit n is the instant in time indicated by DTS(n) where DTS(n) is the DTS value of AV1 access unit n. 536 | 2. The Presentation Time of AV1 access unit n is the instant in time indicated by PTS(n) where PTS(n) is the PTS value of AV1 access unit n. 537 | 538 | ### T-STD Extensions for AV1 539 | 540 | When there is an AV1 video stream in an [[!MPEG-2-TS]] program, the T-STD model as described in the section "Transport stream system target decoder" is extended as specified below. 541 | 542 | T-STD Extensions for AV1 543 |
544 |
T-STD Extensions for AV1
545 |
546 | 547 | #### TBn, MBn, EBn buffer management 548 | 549 | The following additional notations are used to describe the T-STD extensions and are illustrated in the figure above. 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 |
NotationDefinition
t(i)indicates the time in seconds at which the i-th byte of the transport stream enters the system target decoder
TBnis the transport buffer for elementary stream n
TBSis the size of the transport buffer TBn, measured in bytes
MBnis the multiplexing buffer for elementary stream n
MBSnis the size of the multiplexing buffer MBn, measured in bytes
EBnis the elementary stream buffer for the AV1 video stream
EBSnis the size of the multiplexing buffer MBn, measured in bytes
jis an index to the AV1 access unit of the AV1 video stream
An(j)is the j-th access unit of the AV1 video bitstream
tdn (j)is the decoding time of An(j), measured in seconds, in the system target decoder
Rxnis the transfer rate from the transport buffer TBn to the multiplex buffer MBn as specified below.
Rbxnis the transfer rate from the multiplex buffer MBn to the elementary stream buffer EBn as specified below
607 | 608 | The following apply: 609 | * There is exactly one transport buffer TBn for the received AV1 video stream where the size TBS is fixed to 512 bytes. 610 | * There is exactly one multiplexing buffer MBn for the AV1 video stream, where the size MBSn of the multiplexing buffer MB is constrained as follows: MBSn = BSmux + BSoh + 0.1 x BufferSize where BSoh, packet overhead buffering, is defined as: BS oh = (1/750) seconds × max{ 1100 × BitRate, 2 000 000 bit/s} and BSmux, additional mutliplex buffering, is defined as: BSmux = 0.004 seconds ×max{ 1100 × BitRate, 2 000 000 bit/s} BufferSize and BitRate are defined in Annex E of the [[!AV1]] 611 | * There is exactly one elementary stream buffer EBn for all the elementary streams in the set of received elementary streams associated by hierarchy descriptors, with a total size EBSn: EBSn = BufferSize 612 | * Transfer from TBn to MBn is applied as follows: When there is no data in TBn then Rxn is equal to zero. Otherwise: Rxn = 1.1 x BitRate 613 | * The leak method shall be used to transfer data from MBn to EBn as follows: Rbxn = 1.1 × BitRate 614 | * The removal of start-code and emulation prevention as defined in section 4.2 is instantaneously performed between MBn and EBn. 615 | 616 | If there is PES packet payload data in MBn, and buffer EBn is not full, the PES packet payload is transferred from MBn to EBn at a rate equal to Rbxn. If EBn is full, data are not removed from MBn. When a byte of data is transferred from MBn to EBn, all PES packet header bytes that are in MBn and precede that byte are instantaneously removed and discarded. When there is no PES packet payload data present in MBn, no data is removed from MBn. All data that enters MBn leaves it. All PES packet payload data bytes enter EBn instantaneously upon leaving MBn. 617 | 618 | #### STD delay 619 | 620 | The STD delay of any AV1 video through the system target decoders buffers TBn, MBn, and EBn shall be constrained by tdn(j) – t(i) ≤ 10 seconds for all j, and all bytes i in access unit An(j). 621 | 622 | #### Buffer management conditions 623 | 624 | Transport streams shall be constructed so that the following conditions for buffer management are satisfied: 625 | * Each TBn shall not overflow and shall be empty at least once every second. 626 | * Each MBn, EBn and Buffer Pool shall not overflow. 627 | * EBn shall not underflow, except when the Operating parameters info syntax has low_delay_mode_flag set to '1'. Underflow of EBn occurs for AV1 access unit An(j) when one or more bytes of An(j) are not present in EBn at the decoding time tdn(j). 628 | 629 | # Acknowledgements and previous authors 630 | 631 | A previous draft of this specification has been produced by VideoLAN, with inputs from different authors (Jean Baptiste Kempf, Kieran Kunhya, Adrien Maglo, Christophe Massiot, Mathieu Monnier and Mickael Raulet) from the following companies: ATEME, OpenHeadend, Open Broadcast Systems, Videolabs under the direction of VideoLAN. 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | about-time==4.2.1 2 | aiofiles==24.1.0 3 | aiohappyeyeballs==2.6.1 4 | aiohttp==3.11.11 5 | aiosignal==1.3.2 6 | alive-progress==3.2.0 7 | async-timeout==5.0.1 8 | attrs==25.3.0 9 | bikeshed==5.1.2 10 | certifi==2025.1.31 11 | charset-normalizer==3.4.1 12 | cssselect==1.2.0 13 | frozenlist==1.5.0 14 | grapheme==0.6.0 15 | html5lib==1.1 16 | idna==3.10 17 | isodate==0.7.2 18 | kdl-py==1.2.0 19 | lxml==5.3.0 20 | multidict==6.4.2 21 | pillow==11.1.0 22 | propcache==0.3.1 23 | Pygments==2.19.1 24 | requests==2.32.3 25 | result==0.17.0 26 | setuptools==75.8.0 27 | six==1.17.0 28 | tenacity==9.0.0 29 | typing_extensions==4.13.2 30 | urllib3==2.3.0 31 | webencodings==0.5.1 32 | widlparser==1.2.0 33 | yarl==1.19.0 34 | --------------------------------------------------------------------------------