1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
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
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
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
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
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
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
|
Internet Engineering Task Force (IETF) S. Lhomme
Request for Comments: 9559
Updates: 8794 M. Bunkus
Category: Standards Track
ISSN: 2070-1721 D. Rice
October 2024
Matroska Media Container Format Specification
Abstract
This document defines the Matroska audiovisual data container
structure, including definitions of its structural elements,
terminology, vocabulary, and application.
This document updates RFC 8794 to permit the use of a previously
reserved Extensible Binary Meta Language (EBML) Element ID.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 7841.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
https://www.rfc-editor.org/info/rfc9559.
Copyright Notice
Copyright (c) 2024 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Revised BSD License text as described in Section 4.e of the
Trust Legal Provisions and are provided without warranty as described
in the Revised BSD License.
Table of Contents
1. Introduction
2. Status of This Document
3. Notation and Conventions
4. Matroska Overview
4.1. Principles
4.2. Updates to RFC 8794
4.3. Added EBML Constraints
4.4. Design Rules
4.5. Data Layout
5. Matroska Schema
5.1. Segment Element
5.1.1. SeekHead Element
5.1.1.1. Seek Element
5.1.2. Info Element
5.1.2.1. SegmentUUID Element
5.1.2.2. SegmentFilename Element
5.1.2.3. PrevUUID Element
5.1.2.4. PrevFilename Element
5.1.2.5. NextUUID Element
5.1.2.6. NextFilename Element
5.1.2.7. SegmentFamily Element
5.1.2.8. ChapterTranslate Element
5.1.2.9. TimestampScale Element
5.1.2.10. Duration Element
5.1.2.11. DateUTC Element
5.1.2.12. Title Element
5.1.2.13. MuxingApp Element
5.1.2.14. WritingApp Element
5.1.3. Cluster Element
5.1.3.1. Timestamp Element
5.1.3.2. Position Element
5.1.3.3. PrevSize Element
5.1.3.4. SimpleBlock Element
5.1.3.5. BlockGroup Element
5.1.4. Tracks Element
5.1.4.1. TrackEntry Element
5.1.5. Cues Element
5.1.5.1. CuePoint Element
5.1.6. Attachments Element
5.1.6.1. AttachedFile Element
5.1.7. Chapters Element
5.1.7.1. EditionEntry Element
5.1.8. Tags Element
5.1.8.1. Tag Element
6. Matroska Element Ordering
6.1. Top-Level Elements
6.2. CRC-32
6.3. SeekHead
6.4. Cues (Index)
6.5. Info
6.6. Chapters Element
6.7. Attachments
6.8. Tags
7. Matroska Versioning
8. Stream Copy
9. DefaultDecodedFieldDuration
10. Cluster Blocks
10.1. Block Structure
10.2. SimpleBlock Structure
10.3. Block Lacing
10.3.1. No Lacing
10.3.2. Xiph Lacing
10.3.3. EBML Lacing
10.3.4. Fixed-size Lacing
10.3.5. Laced Frames Timestamp
10.4. Random Access Points
11. Timestamps
11.1. Timestamp Ticks
11.1.1. Matroska Ticks
11.1.2. Segment Ticks
11.1.3. Track Ticks
11.2. Block Timestamps
11.3. TimestampScale Rounding
12. Language Codes
13. Country Codes
14. Encryption
15. Image Presentation
15.1. Cropping
15.2. Rotation
16. Segment Position
16.1. Segment Position Exception
16.2. Example of Segment Position
17. Linked Segments
17.1. Hard Linking
17.2. Medium Linking
17.2.1. Linked-Duration
17.2.2. Linked-Edition
18. Track Flags
18.1. Default Flag
18.2. Forced Flag
18.3. Hearing-Impaired Flag
18.4. Visual-Impaired Flag
18.5. Descriptions Flag
18.6. Original Flag
18.7. Commentary Flag
18.8. Track Operation
18.9. Overlay Track
18.10. Multi-planar and 3D Videos
19. Default Track Selection
19.1. Audio Selection
19.2. Subtitle Selection
20. Chapters
20.1. EditionEntry
20.1.1. EditionFlagDefault
20.1.2. Default Edition
20.1.3. EditionFlagOrdered
20.1.3.1. Ordered-Edition and Matroska Segment Linking
20.2. ChapterAtom
20.2.1. ChapterTimeStart
20.2.2. ChapterTimeEnd
20.2.3. Nested Chapters
20.2.4. Nested Chapters in Ordered Chapters
20.2.5. ChapterFlagHidden
20.3. Menu Features
20.4. Physical Types
20.5. Chapter Examples
20.5.1. Example 1: Basic Chaptering
20.5.2. Example 2: Nested Chapters
20.5.2.1. The Micronauts "Bleep To Bleep"
21. Attachments
21.1. Cover Art
21.2. Font Files
22. Cues
22.1. Recommendations
23. Matroska Streaming
23.1. File Access
23.2. Livestreaming
24. Tags
24.1. Tags Precedence
24.2. Tag Levels
25. Implementation Recommendations
25.1. Cluster
25.2. SeekHead
25.3. Optimum Layouts
25.3.1. Optimum Layout for a Muxer
25.3.2. Optimum Layout after Editing Tags
25.3.3. Optimum Layout with Cues at the Front
25.3.4. Optimum Layout for Livestreaming
26. Security Considerations
27. IANA Considerations
27.1. Matroska Element IDs Registry
27.2. Matroska Compression Algorithms Registry
27.3. Matroska Encryption Algorithms Registry
27.4. Matroska AES Cipher Modes Registry
27.5. Matroska Content Encoding Scopes Registry
27.6. Matroska Content Encoding Types Registry
27.7. Matroska Stereo Modes Registry
27.8. Matroska Alpha Modes Registry
27.9. Matroska Display Units Registry
27.10. Matroska Horizontal Chroma Sitings Registry
27.11. Matroska Vertical Chroma Sitings Registry
27.12. Matroska Color Ranges Registry
27.13. Matroska Tags Target Types Registry
27.14. Matroska Chapter Codec IDs Registry
27.15. Matroska Projection Types Registry
27.16. Matroska Track Types Registry
27.17. Matroska Track Plane Types Registry
27.18. Media Types
27.18.1. For Files Containing Video Tracks
27.18.2. For Files Containing Audio Tracks with No Video
Tracks
27.18.3. For Files Containing a Stereoscopic Video Track
28. References
28.1. Normative References
28.2. Informative References
Appendix A. Historic Deprecated Elements
A.1. SilentTracks Element
A.2. SilentTrackNumber Element
A.3. BlockVirtual Element
A.4. ReferenceVirtual Element
A.5. Slices Element
A.6. TimeSlice Element
A.7. LaceNumber Element
A.8. FrameNumber Element
A.9. BlockAdditionID Element
A.10. Delay Element
A.11. SliceDuration Element
A.12. ReferenceFrame Element
A.13. ReferenceOffset Element
A.14. ReferenceTimestamp Element
A.15. EncryptedBlock Element
A.16. MinCache Element
A.17. MaxCache Element
A.18. TrackOffset Element
A.19. CodecSettings Element
A.20. CodecInfoURL Element
A.21. CodecDownloadURL Element
A.22. CodecDecodeAll Element
A.23. TrackOverlay Element
A.24. AspectRatioType Element
A.25. GammaValue Element
A.26. FrameRate Element
A.27. ChannelPositions Element
A.28. TrickTrackUID Element
A.29. TrickTrackSegmentUID Element
A.30. TrickTrackFlag Element
A.31. TrickMasterTrackUID Element
A.32. TrickMasterTrackSegmentUID Element
A.33. ContentSignature Element
A.34. ContentSigKeyID Element
A.35. ContentSigAlgo Element
A.36. ContentSigHashAlgo Element
A.37. CueRefCluster Element
A.38. CueRefNumber Element
A.39. CueRefCodecState Element
A.40. FileReferral Element
A.41. FileUsedStartTime Element
A.42. FileUsedEndTime Element
A.43. TagDefaultBogus Element
Authors' Addresses
1. Introduction
Matroska is an audiovisual data container format. It was derived
from a project called [MCF] but diverges from it significantly
because it is based on EBML (Extensible Binary Meta Language)
[RFC8794], a binary derivative of XML. EBML provides significant
advantages in terms of future format extensibility, without breaking
file support in parsers reading the previous versions.
To avoid any misunderstandings, it is essential to clarify exactly
what an audio/video container is:
* It is NOT a video or audio compression format (codec).
* It is an envelope in which there can be many audio, video, and
subtitles streams, allowing the user to store a complete movie or
CD in a single file.
Matroska is designed with the future in mind. It incorporates
features such as:
* Fast seeking in the file
* Chapter entries
* Full metadata (tags) support
* Selectable subtitle/audio/video streams
* Modularly expandable
* Error resilience (can recover playback even when the stream is
damaged)
* Streamable over the Internet and local networks (HTTP [RFC9110],
FTP [RFC0959], SMB [SMB-CIFS], etc.)
* Menus (like menus that DVDs have [DVD-Video])
2. Status of This Document
This document covers Matroska versions 1, 2, 3, and 4. Matroska
version 4 is the current version. Matroska versions 1 to 3 are no
longer maintained. No new elements are expected in files with
version numbers 1, 2, or 3.
3. Notation and Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
This document defines the following terms in order to define the
format and application of Matroska:
Matroska: A multimedia container format based on EBML (Extensible
Binary Meta Language).
Matroska Reader: A data parser that interprets the semantics of a
Matroska document and creates a way for programs to use Matroska.
Matroska Player: A Matroska Reader with the primary purpose of
playing audiovisual files, including Matroska documents.
Matroska Writer: A data writer that creates Matroska documents.
4. Matroska Overview
4.1. Principles
Matroska is a Document Type of EBML. This specification is dependent
on the EBML specification [RFC8794]. For an understanding of
Matroska's EBML Schema, see in particular the sections of the EBML
specification that cover EBML Element Types (Section 7), EBML Schema
(Section 11.1), and EBML Structure (Section 3).
4.2. Updates to RFC 8794
Because of an oversight, [RFC8794] reserved EBML ID 0x80, which is
used by deployed Matroska implementations. For this reason, this
specification updates [RFC8794] to make 0x80 a legal EBML ID.
Additionally, this specification makes the following updates:
* Section 17.1 of [RFC8794] (per Erratum ID #7189 [Err7189])
OLD:
| One-octet Element IDs MUST be between 0x81 and 0xFE. These items
| are valuable because they are short, and they need to be used for
| commonly repeated elements. Element IDs are to be allocated
| within this range according to the "RFC Required" policy
| [RFC8126].
|
| The following one-octet Element IDs are RESERVED: 0xFF and 0x80.
NEW:
| One-octet Element IDs MUST be between 0x80 and 0xFE. These items
| are valuable because they are short, and they need to be used for
| commonly repeated elements. Element IDs are to be allocated
| within this range according to the "RFC Required" policy
| [RFC8126].
|
| The following one-octet Element ID is RESERVED: 0xFF.
* Section 5 of [RFC8794] (per Erratum ID #7191 [Err7191])
OLD:
+=========================+================+=================+
| Element ID Octet Length | Range of Valid | Number of Valid |
| | Element IDs | Element IDs |
+=========================+================+=================+
| 1 | 0x81 - 0xFE | 126 |
+-------------------------+----------------+-----------------+
NEW:
+=========================+================+=================+
| Element ID Octet Length | Range of Valid | Number of Valid |
| | Element IDs | Element IDs |
+=========================+================+=================+
| 1 | 0x80 - 0xFE | 127 |
+-------------------------+----------------+-----------------+
4.3. Added EBML Constraints
As an EBML Document Type, Matroska adds the following constraints to
the EBML specification [RFC8794]:
* The docType of the EBML Header MUST be "matroska".
* The EBMLMaxIDLength of the EBML Header MUST be 4.
* The EBMLMaxSizeLength of the EBML Header MUST be between 1 and 8,
inclusive.
4.4. Design Rules
The Root Element and all Top-Level Elements MUST use 4 octets for
their EBML Element ID -- i.e., Segment and direct children of
Segment.
Legacy EBML/Matroska parsers did not handle Empty Elements properly;
elements were present in the file but had a length of 0. They always
assumed the value was 0 for integers/dates or 0x0p+0, the textual
expression of floats using the format in [ISO9899], no matter the
default value of the element that should have been used instead.
Therefore, Matroska Writers MUST NOT use EBML Empty Elements if the
element has a default value that is not 0 for integers/dates and
0x0p+0 for floats.
When adding new elements to Matroska, these rules apply:
* A non-mandatory integer/date Element MUST NOT have a default value
other than 0.
* A non-mandatory float Element MUST NOT have a default value other
than 0x0p+0.
* A non-mandatory string Element MUST NOT have a default value, as
empty strings cannot be defined in the XML Schema.
4.5. Data Layout
A Matroska file MUST be composed of at least one EBML Document using
the Matroska Document Type. Each EBML Document MUST start with an
EBML Header and MUST be followed by the EBML Root Element, defined as
Segment in Matroska. Matroska defines several Top-Level Elements
that may occur within the Segment.
As an example, a simple Matroska file consisting of a single EBML
Document could be represented like this:
* EBML Header
* Segment
A more complex Matroska file consisting of an EBML Stream (consisting
of two EBML Documents) could be represented like this:
* EBML Header
* Segment
* EBML Header
* Segment
The following diagram represents a simple Matroska file, comprised of
an EBML Document with an EBML Header, a Segment element (the Root
Element), and all eight Matroska Top-Level Elements. In the diagrams
in this section, horizontal spacing expresses a parent-child
relationship between Matroska elements (e.g., the Info element is
contained within the Segment element), whereas vertical alignment
represents the storage order within the file.
+-------------+
| EBML Header |
+---------------------------+
| Segment | SeekHead |
| |-------------|
| | Info |
| |-------------|
| | Tracks |
| |-------------|
| | Chapters |
| |-------------|
| | Cluster |
| |-------------|
| | Cues |
| |-------------|
| | Attachments |
| |-------------|
| | Tags |
+---------------------------+
Figure 1: Basic Layout of a Matroska File
The Matroska EBML Schema defines eight Top-Level Elements:
* SeekHead (Section 6.3)
* Info (Section 6.5)
* Tracks (Section 18)
* Chapters (Section 20)
* Cluster (Section 10)
* Cues (Section 22)
* Attachments (Section 21)
* Tags (Section 6.8)
The SeekHead element (also known as MetaSeek) contains an index of
Top-Level Elements locations within the Segment. Use of the SeekHead
element is RECOMMENDED. Without a SeekHead element, a Matroska
parser would have to search the entire file to find all of the other
Top-Level Elements. This is due to Matroska's flexible ordering
requirements; for instance, it is acceptable for the Chapters element
to be stored after the Cluster element(s).
+--------------------------------+
| SeekHead | Seek | SeekID |
| | |--------------|
| | | SeekPosition |
+--------------------------------+
Figure 2: Representation of a SeekHead Element
The Info element contains vital information for identifying the whole
Segment. This includes the title for the Segment, a randomly
generated unique identifier (UID), and the UID(s) of any linked
Segment elements.
+-------------------------+
| Info | SegmentUUID |
| |------------------|
| | SegmentFilename |
| |------------------|
| | PrevUUID |
| |------------------|
| | PrevFilename |
| |------------------|
| | NextUUID |
| |------------------|
| | NextFilename |
| |------------------|
| | SegmentFamily |
| |------------------|
| | ChapterTranslate |
| |------------------|
| | TimestampScale |
| |------------------|
| | Duration |
| |------------------|
| | DateUTC |
| |------------------|
| | Title |
| |------------------|
| | MuxingApp |
| |------------------|
| | WritingApp |
|-------------------------|
Figure 3: Representation of an Info Element and Its Child Elements
The Tracks element defines the technical details for each track and
can store the name, number, UID, language, and type (audio, video,
subtitles, etc.) of each track. For example, the Tracks element MAY
store information about the resolution of a video track or sample
rate of an audio track.
The Tracks element MUST identify all the data needed by the codec to
decode the data of the specified track. However, the data required
is contingent on the codec used for the track. For example, a Track
element for uncompressed audio only requires the audio bit rate to be
present. A codec such as AC-3 would require that the CodecID element
be present for all tracks, as it is the primary way to identify which
codec to use to decode the track.
+------------------------------------+
| Tracks | TrackEntry | TrackNumber |
| | |--------------|
| | | TrackUID |
| | |--------------|
| | | TrackType |
| | |--------------|
| | | Name |
| | |--------------|
| | | Language |
| | |--------------|
| | | CodecID |
| | |--------------|
| | | CodecPrivate |
| | |--------------|
| | | CodecName |
| | |----------------------------------+
| | | Video | FlagInterlaced |
| | | |-------------------|
| | | | FieldOrder |
| | | |-------------------|
| | | | StereoMode |
| | | |-------------------|
| | | | AlphaMode |
| | | |-------------------|
| | | | PixelWidth |
| | | |-------------------|
| | | | PixelHeight |
| | | |-------------------|
| | | | DisplayWidth |
| | | |-------------------|
| | | | DisplayHeight |
| | | |-------------------|
| | | | AspectRatioType |
| | | |-------------------|
| | | | Colour |
| | |----------------------------------|
| | | Audio | SamplingFrequency |
| | | |-------------------|
| | | | Channels |
| | | |-------------------|
| | | | BitDepth |
|--------------------------------------------------------|
Figure 4: Representation of the Tracks Element and a Selection of Its
Descendant Elements
The Chapters element lists all of the chapters. Chapters are a way
to set predefined points to jump to in video or audio.
+-----------------------------------------+
| Chapters | Edition | EditionUID |
| | Entry |--------------------|
| | | EditionFlagDefault |
| | |--------------------|
| | | EditionFlagOrdered |
| | |---------------------------------+
| | | ChapterAtom | ChapterUID |
| | | |-------------------|
| | | | ChapterStringUID |
| | | |-------------------|
| | | | ChapterTimeStart |
| | | |-------------------|
| | | | ChapterTimeEnd |
| | | |-------------------|
| | | | ChapterFlagHidden |
| | | |-------------------------------+
| | | | ChapterDisplay | ChapString |
| | | | |--------------|
| | | | | ChapLanguage |
+------------------------------------------------------------------+
Figure 5: Representation of the Chapters Element and a Selection
of Its Descendant Elements
Cluster elements contain the content for each track, e.g., video
frames. A Matroska file SHOULD contain at least one Cluster element.
In the rare case it doesn't, there should be a method for Segments to
link together, possibly using Chapters; see Section 17.
The Cluster element helps to break up SimpleBlock or BlockGroup
elements and helps with seeking and error protection. Every Cluster
element MUST contain a Timestamp element. This SHOULD be the
Timestamp element used to play the first Block in the Cluster
element, unless a different value is needed to accommodate for more
Blocks; see Section 11.2.
Cluster elements contain one or more Block element, such as
BlockGroup or SimpleBlock elements. In some situations, a Cluster
element MAY contain no Block element, for example, in a live
recording when no data has been collected.
A BlockGroup element MAY contain a Block of data and any information
relating directly to that Block.
+--------------------------+
| Cluster | Timestamp |
| |----------------|
| | Position |
| |----------------|
| | PrevSize |
| |----------------|
| | SimpleBlock |
| |----------------|
| | BlockGroup |
+--------------------------+
Figure 6: Representation of a Cluster Element and Its Immediate
Child Elements
+----------------------------------+
| Block | Portion of | Data Type |
| | a Block | - Bit Flag |
| |--------------------------+
| | Header | TrackNumber |
| | |-------------|
| | | Timestamp |
| | |-------------|
| | | Flags |
| | | - Gap |
| | | - Lacing |
| | | - Reserved |
| |--------------------------|
| | Optional | FrameSize |
| |--------------------------|
| | Data | Frame |
+----------------------------------+
Figure 7: Representation of the Block Element Structure
Each Cluster MUST contain exactly one Timestamp element. The
Timestamp element value MUST be stored once per Cluster. The
Timestamp element in the Cluster is relative to the entire Segment.
The Timestamp element SHOULD be the first element in the Cluster it
belongs to or the second element if that Cluster contains a CRC-32
element (Section 6.2).
Additionally, the Block contains an offset that, when added to the
Cluster's Timestamp element value, yields the Block's effective
timestamp. Therefore, the timestamp in the Block itself is relative
to the Timestamp element in the Cluster. For example, if the
Timestamp element in the Cluster is set to 10 seconds and a Block in
that Cluster is supposed to be played 12 seconds into the clip, the
timestamp in the Block would be set to 2 seconds.
The ReferenceBlock in the BlockGroup is used instead of the basic
"P-frame"/"B-frame" description. Instead of simply saying that this
Block depends on the Block directly before or directly after, the
Timestamp of the necessary Block is used. Because there can be as
many ReferenceBlock elements as necessary for a Block, it allows for
some extremely complex referencing.
The Cues element is used to seek when playing back a file by
providing a temporal index for some of the Tracks. It is similar to
the SeekHead element but is used for seeking to a specific time when
playing back the file. It is possible to seek without this element,
but it is much more difficult because a Matroska Reader would have to
"hunt and peck" through the file to look for the correct timestamp.
The Cues element SHOULD contain at least one CuePoint element. Each
CuePoint element stores the position of the Cluster that contains the
BlockGroup or SimpleBlock element. The timestamp is stored in the
CueTime element, and the location is stored in the CueTrackPositions
element.
The Cues element is flexible. For instance, the Cues element can be
used to index every single timestamp of every Block or they can be
indexed selectively.
+-------------------------------------+
| Cues | CuePoint | CueTime |
| | |-------------------|
| | | CueTrackPositions |
| |------------------------------|
| | CuePoint | CueTime |
| | |-------------------|
| | | CueTrackPositions |
+-------------------------------------+
Figure 8: Representation of a Cues Element and Two Levels of Its
Descendant Elements
The Attachments element is for attaching files to a Matroska file,
such as pictures, fonts, web pages, etc.
+------------------------------------------------+
| Attachments | AttachedFile | FileDescription |
| | |-------------------|
| | | FileName |
| | |-------------------|
| | | FileMediaType |
| | |-------------------|
| | | FileData |
| | |-------------------|
| | | FileUID |
+------------------------------------------------+
Figure 9: Representation of an Attachments Element
The Tags element contains metadata that describes the Segment and
potentially its Tracks, Chapters, and Attachments. Each Track or
Chapter that those tags applies to has its UID listed in the Tags.
The Tags contain all extra information about the file: scriptwriters,
singers, actors, directors, titles, edition, price, dates, genre,
comments, etc. Tags can contain their values in multiple languages.
For example, a movie's "TITLE" tag value might contain both the
original English title as well as the German title.
+-------------------------------------------+
| Tags | Tag | Targets | TargetTypeValue |
| | | |------------------|
| | | | TargetType |
| | | |------------------|
| | | | TagTrackUID |
| | | |------------------|
| | | | TagEditionUID |
| | | |------------------|
| | | | TagChapterUID |
| | | |------------------|
| | | | TagAttachmentUID |
| | |------------------------------|
| | | SimpleTag | TagName |
| | | |------------------|
| | | | TagLanguage |
| | | |------------------|
| | | | TagDefault |
| | | |------------------|
| | | | TagString |
| | | |------------------|
| | | | TagBinary |
| | | |------------------|
| | | | SimpleTag |
+-------------------------------------------+
Figure 10: Representation of a Tags Element and Three Levels of
Its Children Elements
5. Matroska Schema
This specification includes an EBML Schema that defines the elements
and structure of Matroska using the EBML Schema elements and
attributes defined in Section 11.1 of [RFC8794].
Attributes using their default value (like minOccurs, minver, etc.)
or attributes with undefined values (like length, maxver, etc.) are
omitted.
The definitions for each Matroska element are provided below.
5.1. Segment Element
id / type: 0x18538067 / master
unknownsizeallowed: True
path: \Segment
minOccurs / maxOccurs: 1 / 1
definition: The Root Element that contains all other Top-Level
Elements; see Section 4.5.
5.1.1. SeekHead Element
id / type: 0x114D9B74 / master
path: \Segment\SeekHead
maxOccurs: 2
definition: Contains seeking information of Top-Level Elements; see
Section 4.5.
5.1.1.1. Seek Element
id / type: 0x4DBB / master
path: \Segment\SeekHead\Seek
minOccurs: 1
definition: Contains a single seek entry to an EBML Element.
5.1.1.1.1. SeekID Element
id / type: 0x53AB / binary
length: 4
path: \Segment\SeekHead\Seek\SeekID
minOccurs / maxOccurs: 1 / 1
definition: The binary EBML ID of a Top-Level Element.
5.1.1.1.2. SeekPosition Element
id / type: 0x53AC / uinteger
path: \Segment\SeekHead\Seek\SeekPosition
minOccurs / maxOccurs: 1 / 1
definition: The Segment Position (Section 16) of a Top-Level
Element.
5.1.2. Info Element
id / type: 0x1549A966 / master
path: \Segment\Info
minOccurs / maxOccurs: 1 / 1
recurring: True
definition: Contains general information about the Segment.
5.1.2.1. SegmentUUID Element
id / type: 0x73A4 / binary
length: 16
path: \Segment\Info\SegmentUUID
maxOccurs: 1
definition: A randomly generated UID that identifies the Segment
amongst many others (128 bits). It is equivalent to a Universally
Unique Identifier (UUID) v4 [RFC9562] with all bits randomly (or
pseudorandomly) chosen. An actual UUID v4 value, where some bits
are not random, MAY also be used.
usage notes: If the Segment is a part of a Linked Segment, then this
element is REQUIRED. The value of the UID MUST contain at least
one bit set to 1.
5.1.2.2. SegmentFilename Element
id / type: 0x7384 / utf-8
path: \Segment\Info\SegmentFilename
maxOccurs: 1
definition: A filename corresponding to this Segment.
5.1.2.3. PrevUUID Element
id / type: 0x3CB923 / binary
length: 16
path: \Segment\Info\PrevUUID
maxOccurs: 1
definition: An ID that identifies the previous Segment of a Linked
Segment.
usage notes: If the Segment is a part of a Linked Segment that uses
Hard Linking (Section 17.1), then either the PrevUUID or the
NextUUID element is REQUIRED. If a Segment contains a PrevUUID
but not a NextUUID, then it MAY be considered as the last Segment
of the Linked Segment. The PrevUUID MUST NOT be equal to the
SegmentUUID.
5.1.2.4. PrevFilename Element
id / type: 0x3C83AB / utf-8
path: \Segment\Info\PrevFilename
maxOccurs: 1
definition: A filename corresponding to the file of the previous
Linked Segment.
usage notes: Provision of the previous filename is for display
convenience, but PrevUUID SHOULD be considered authoritative for
identifying the previous Segment in a Linked Segment.
5.1.2.5. NextUUID Element
id / type: 0x3EB923 / binary
length: 16
path: \Segment\Info\NextUUID
maxOccurs: 1
definition: An ID that identifies the next Segment of a Linked
Segment.
usage notes: If the Segment is a part of a Linked Segment that uses
Hard Linking (Section 17.1), then either the PrevUUID or the
NextUUID element is REQUIRED. If a Segment contains a NextUUID
but not a PrevUUID, then it MAY be considered as the first Segment
of the Linked Segment. The NextUUID MUST NOT be equal to the
SegmentUUID.
5.1.2.6. NextFilename Element
id / type: 0x3E83BB / utf-8
path: \Segment\Info\NextFilename
maxOccurs: 1
definition: A filename corresponding to the file of the next Linked
Segment.
usage notes: Provision of the next filename is for display
convenience, but NextUUID SHOULD be considered authoritative for
identifying the Next Segment.
5.1.2.7. SegmentFamily Element
id / type: 0x4444 / binary
length: 16
path: \Segment\Info\SegmentFamily
definition: A UID that all Segments of a Linked Segment MUST share
(128 bits). It is equivalent to a UUID v4 [RFC9562] with all bits
randomly (or pseudorandomly) chosen. An actual UUID v4 value,
where some bits are not random, MAY also be used.
usage notes: If the Segment Info contains a ChapterTranslate
element, this element is REQUIRED.
5.1.2.8. ChapterTranslate Element
id / type: 0x6924 / master
path: \Segment\Info\ChapterTranslate
definition: The mapping between this Segment and a segment value in
the given Chapter Codec.
rationale: Chapter Codecs may need to address different segments,
but they may not know of the way to identify such segments when
stored in Matroska. This element and its child elements add a way
to map the internal segments known to the Chapter Codec to the
SegmentUUIDs in Matroska. This allows remuxing a file with
Chapter Codec without changing the content of the codec data, just
the Segment mapping.
5.1.2.8.1. ChapterTranslateID Element
id / type: 0x69A5 / binary
path: \Segment\Info\ChapterTranslate\ChapterTranslateID
minOccurs / maxOccurs: 1 / 1
definition: The binary value used to represent this Segment in the
chapter codec data. The format depends on the ChapProcessCodecID
used; see Section 5.1.7.1.4.15.
5.1.2.8.2. ChapterTranslateCodec Element
id / type: 0x69BF / uinteger
path: \Segment\Info\ChapterTranslate\ChapterTranslateCodec
minOccurs / maxOccurs: 1 / 1
definition: Applies to the chapter codec of the given chapter
edition(s); see Section 5.1.7.1.4.15.
defined values: See Table 31. Additional values can be registered
in the "Matroska Chapter Codec IDs" registry defined in
Section 27.14.
5.1.2.8.3. ChapterTranslateEditionUID Element
id / type: 0x69FC / uinteger
path: \Segment\Info\ChapterTranslate\ChapterTranslateEditionUID
definition: Specifies a chapter edition UID to which this
ChapterTranslate applies.
usage notes: When no ChapterTranslateEditionUID is specified in the
ChapterTranslate, the ChapterTranslate applies to all chapter
editions found in the Segment using the given
ChapterTranslateCodec.
5.1.2.9. TimestampScale Element
id / type / default: 0x2AD7B1 / uinteger / 1000000
range: not 0 (1-18446744073709551615)
path: \Segment\Info\TimestampScale
minOccurs / maxOccurs: 1 / 1
definition: Base unit for Segment Ticks and Track Ticks, in
nanoseconds. A TimestampScale value of 1000000 means scaled
timestamps in the Segment are expressed in milliseconds; see
Section 11 on how to interpret timestamps.
5.1.2.10. Duration Element
id / type: 0x4489 / float
range: > 0x0p+0
path: \Segment\Info\Duration
maxOccurs: 1
definition: Duration of the Segment, expressed in Segment Ticks,
which are based on TimestampScale; see Section 11.1.
5.1.2.11. DateUTC Element
id / type: 0x4461 / date
path: \Segment\Info\DateUTC
maxOccurs: 1
definition: The date and time that the Segment was created by the
muxing application or library.
5.1.2.12. Title Element
id / type: 0x7BA9 / utf-8
path: \Segment\Info\Title
maxOccurs: 1
definition: General name of the Segment.
5.1.2.13. MuxingApp Element
id / type: 0x4D80 / utf-8
path: \Segment\Info\MuxingApp
minOccurs / maxOccurs: 1 / 1
definition: Muxing application or library (example: "libmatroska-
0.4.3").
usage notes: Include the full name of the application or library
followed by the version number.
5.1.2.14. WritingApp Element
id / type: 0x5741 / utf-8
path: \Segment\Info\WritingApp
minOccurs / maxOccurs: 1 / 1
definition: Writing application (example: "mkvmerge-0.3.3").
usage notes: Include the full name of the application followed by
the version number.
5.1.3. Cluster Element
id / type: 0x1F43B675 / master
unknownsizeallowed: True
path: \Segment\Cluster
definition: The Top-Level Element containing the (monolithic) Block
structure.
5.1.3.1. Timestamp Element
id / type: 0xE7 / uinteger
path: \Segment\Cluster\Timestamp
minOccurs / maxOccurs: 1 / 1
definition: Absolute timestamp of the cluster, expressed in Segment
Ticks, which are based on TimestampScale; see Section 11.1.
usage notes: This element SHOULD be the first child element of the
Cluster it belongs to or the second if that Cluster contains a
CRC-32 element (Section 6.2).
5.1.3.2. Position Element
id / type: 0xA7 / uinteger
path: \Segment\Cluster\Position
maxOccurs: 1
maxver: 4
definition: The Segment Position of the Cluster in the Segment (0 in
live streams). It might help to resynchronize the offset on
damaged streams.
5.1.3.3. PrevSize Element
id / type: 0xAB / uinteger
path: \Segment\Cluster\PrevSize
maxOccurs: 1
definition: Size of the previous Cluster, in octets. Can be useful
for backward playing.
5.1.3.4. SimpleBlock Element
id / type: 0xA3 / binary
path: \Segment\Cluster\SimpleBlock
minver: 2
definition: Similar to Block (see Section 10.1) but without all the
extra information. Mostly used to reduce overhead when no extra
feature is needed; see Section 10.2 on SimpleBlock Structure.
5.1.3.5. BlockGroup Element
id / type: 0xA0 / master
path: \Segment\Cluster\BlockGroup
definition: Basic container of information containing a single Block
and information specific to that Block.
5.1.3.5.1. Block Element
id / type: 0xA1 / binary
path: \Segment\Cluster\BlockGroup\Block
minOccurs / maxOccurs: 1 / 1
definition: Block containing the actual data to be rendered and a
timestamp relative to the Cluster Timestamp; see Section 10.1 on
Block Structure.
5.1.3.5.2. BlockAdditions Element
id / type: 0x75A1 / master
path: \Segment\Cluster\BlockGroup\BlockAdditions
maxOccurs: 1
definition: Contains additional binary data to complete the Block
element; see Section 4.1.5 of [MatroskaCodec] for more
information. An EBML parser that has no knowledge of the Block
structure could still see and use/skip these data.
5.1.3.5.2.1. BlockMore Element
id / type: 0xA6 / master
path: \Segment\Cluster\BlockGroup\BlockAdditions\BlockMore
minOccurs: 1
definition: Contains the BlockAdditional and some parameters.
5.1.3.5.2.2. BlockAdditional Element
id / type: 0xA5 / binary
path: \Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAddi
tional
minOccurs / maxOccurs: 1 / 1
definition: Interpreted by the codec as it wishes (using the
BlockAddID).
5.1.3.5.2.3. BlockAddID Element
id / type / default: 0xEE / uinteger / 1
range: not 0 (1-18446744073709551615)
path: \Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAddI
D
minOccurs / maxOccurs: 1 / 1
definition: An ID that identifies how to interpret the
BlockAdditional data; see Section 4.1.5 of [MatroskaCodec] for
more information. A value of 1 indicates that the BlockAdditional
data is defined by the codec. Any other value indicates that the
BlockAdditional data should be handled according to the
BlockAddIDType that is located in the TrackEntry.
usage notes: Each BlockAddID value MUST be unique between all
BlockMore elements found in a BlockAdditions element. To keep
MaxBlockAdditionID as low as possible, small values SHOULD be
used.
5.1.3.5.3. BlockDuration Element
id / type: 0x9B / uinteger
path: \Segment\Cluster\BlockGroup\BlockDuration
minOccurs / maxOccurs: See Table 1 / 1
definition: The duration of the Block, expressed in Track Ticks; see
Section 11.1. The BlockDuration element can be useful at the end
of a Track to define the duration of the last frame (as there is
no subsequent Block available) or when there is a break in a track
like for subtitle tracks.
notes: See Table 1.
+===========+==================================================+
| attribute | note |
+===========+==================================================+
| minOccurs | BlockDuration MUST be set (minOccurs=1) if the |
| | associated TrackEntry stores a DefaultDuration |
| | value. |
+-----------+--------------------------------------------------+
| default | If a value is not present and no DefaultDuration |
| | is defined, the value is assumed to be the |
| | difference between the timestamp of this Block |
| | and the timestamp of the next Block in "display" |
| | order (not coding order). |
+-----------+--------------------------------------------------+
Table 1: BlockDuration Implementation Notes
5.1.3.5.4. ReferencePriority Element
id / type / default: 0xFA / uinteger / 0
path: \Segment\Cluster\BlockGroup\ReferencePriority
minOccurs / maxOccurs: 1 / 1
definition: This frame is referenced and has the specified cache
priority. In the cache, only a frame of the same or higher
priority can replace this frame. A value of 0 means the frame is
not referenced.
5.1.3.5.5. ReferenceBlock Element
id / type: 0xFB / integer
path: \Segment\Cluster\BlockGroup\ReferenceBlock
definition: A timestamp value, relative to the timestamp of the
Block in this BlockGroup, expressed in Track Ticks; see
Section 11.1. This is used to reference other frames necessary to
decode this frame. The relative value SHOULD correspond to a
valid Block that this Block depends on. Historically, Matroska
Writers didn't write the actual Block(s) that this Block depends
on, but they did write _some_ Block(s) in the past.
The value "0" MAY also be used to signify that this Block cannot be
decoded on its own, but the necessary reference Block(s) is unknown.
In this case, other ReferenceBlock elements MUST NOT be found in the
same BlockGroup. If the BlockGroup doesn't have a ReferenceBlock
element, then the Block it contains can be decoded without using any
other Block data.
5.1.3.5.6. CodecState Element
id / type: 0xA4 / binary
path: \Segment\Cluster\BlockGroup\CodecState
maxOccurs: 1
minver: 2
definition: The new codec state to use. Data interpretation is
private to the codec. This information SHOULD always be
referenced by a seek entry.
5.1.3.5.7. DiscardPadding Element
id / type: 0x75A2 / integer
path: \Segment\Cluster\BlockGroup\DiscardPadding
maxOccurs: 1
minver: 4
definition: Duration of the silent data added to the Block,
expressed in Matroska Ticks -- i.e., in nanoseconds; see
Section 11.1 (padding at the end of the Block for positive values
and at the beginning of the Block for negative values). The
duration of DiscardPadding is not calculated in the duration of
the TrackEntry and SHOULD be discarded during playback.
5.1.4. Tracks Element
id / type: 0x1654AE6B / master
path: \Segment\Tracks
maxOccurs: 1
recurring: True
definition: A Top-Level Element of information with many tracks
described.
5.1.4.1. TrackEntry Element
id / type: 0xAE / master
path: \Segment\Tracks\TrackEntry
minOccurs: 1
definition: Describes a track with all elements.
5.1.4.1.1. TrackNumber Element
id / type: 0xD7 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\TrackNumber
minOccurs / maxOccurs: 1 / 1
definition: The track number as used in the Block Header.
5.1.4.1.2. TrackUID Element
id / type: 0x73C5 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\TrackUID
minOccurs / maxOccurs: 1 / 1
definition: A UID that identifies the Track.
stream copy: True (Section 8)
5.1.4.1.3. TrackType Element
id / type: 0x83 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\TrackType
minOccurs / maxOccurs: 1 / 1
definition: The TrackType defines the type of each frame found in
the Track. The value SHOULD be stored on 1 octet.
defined values: See Table 2. Additional values can be registered in
the "Matroska Track Types" registry defined in Section 27.16.
stream copy: True (Section 8)
+=======+==========+==========================================+
| value | label | contents of each frame |
+=======+==========+==========================================+
| 1 | video | An image. |
+-------+----------+------------------------------------------+
| 2 | audio | Audio samples. |
+-------+----------+------------------------------------------+
| 3 | complex | A mix of different other TrackType. The |
| | | codec needs to define how the Matroska |
| | | Player should interpret such data. |
+-------+----------+------------------------------------------+
| 16 | logo | An image to be rendered over the video |
| | | track(s). |
+-------+----------+------------------------------------------+
| 17 | subtitle | Subtitle or closed caption data to be |
| | | rendered over the video track(s). |
+-------+----------+------------------------------------------+
| 18 | buttons | Interactive button(s) to be rendered |
| | | over the video track(s). |
+-------+----------+------------------------------------------+
| 32 | control | Metadata used to control the player of |
| | | the Matroska Player. |
+-------+----------+------------------------------------------+
| 33 | metadata | Timed metadata that can be passed on to |
| | | the Matroska Player. |
+-------+----------+------------------------------------------+
Table 2: TrackType Values
5.1.4.1.4. FlagEnabled Element
id / type / default: 0xB9 / uinteger / 1
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagEnabled
minOccurs / maxOccurs: 1 / 1
minver: 2
definition: Set to 1 if the track is usable. It is possible to turn
a track that is not usable into a usable track using chapter
codecs or control tracks.
5.1.4.1.5. FlagDefault Element
id / type / default: 0x88 / uinteger / 1
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagDefault
minOccurs / maxOccurs: 1 / 1
definition: Set to 1 if the track (audio, video, or subtitles) is
eligible for automatic selection by the player; see Section 19 for
more details.
5.1.4.1.6. FlagForced Element
id / type / default: 0x55AA / uinteger / 0
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagForced
minOccurs / maxOccurs: 1 / 1
definition: Applies only to subtitles. Set to 1 if the track is
eligible for automatic selection by the player if it matches the
user's language preference, even if the user's preferences would
not normally enable subtitles with the selected audio track; this
can be used for tracks containing only translations of audio in
foreign languages or on-screen text. See Section 19 for more
details.
5.1.4.1.7. FlagHearingImpaired Element
id / type: 0x55AB / uinteger
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagHearingImpaired
maxOccurs: 1
minver: 4
definition: Set to 1 if and only if the track is suitable for users
with hearing impairments.
5.1.4.1.8. FlagVisualImpaired Element
id / type: 0x55AC / uinteger
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagVisualImpaired
maxOccurs: 1
minver: 4
definition: Set to 1 if and only if the track is suitable for users
with visual impairments.
5.1.4.1.9. FlagTextDescriptions Element
id / type: 0x55AD / uinteger
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagTextDescriptions
maxOccurs: 1
minver: 4
definition: Set to 1 if and only if the track contains textual
descriptions of video content.
5.1.4.1.10. FlagOriginal Element
id / type: 0x55AE / uinteger
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagOriginal
maxOccurs: 1
minver: 4
definition: Set to 1 if and only if the track is in the content's
original language.
5.1.4.1.11. FlagCommentary Element
id / type: 0x55AF / uinteger
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagCommentary
maxOccurs: 1
minver: 4
definition: Set to 1 if and only if the track contains commentary.
5.1.4.1.12. FlagLacing Element
id / type / default: 0x9C / uinteger / 1
range: 0-1
path: \Segment\Tracks\TrackEntry\FlagLacing
minOccurs / maxOccurs: 1 / 1
definition: Set to 1 if the track MAY contain blocks that use
lacing. When set to 0, all blocks MUST have their lacing flags
set to "no lacing"; see Section 10.3 on 'Block' Lacing.
5.1.4.1.13. DefaultDuration Element
id / type: 0x23E383 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\DefaultDuration
maxOccurs: 1
definition: Number of nanoseconds per frame, expressed in Matroska
Ticks -- i.e., in nanoseconds; see Section 11.1 ("frame" in the
Matroska sense -- one element put into a (Simple)Block).
stream copy: True (Section 8)
5.1.4.1.14. DefaultDecodedFieldDuration Element
id / type: 0x234E7A / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\DefaultDecodedFieldDuration
maxOccurs: 1
minver: 4
definition: The period between two successive fields at the output
of the decoding process, expressed in Matroska Ticks -- i.e., in
nanoseconds; see Section 11.1. See Section 9 for more
information.
stream copy: True (Section 8)
5.1.4.1.15. TrackTimestampScale Element
id / type / default: 0x23314F / float / 0x1p+0
range: > 0x0p+0
path: \Segment\Tracks\TrackEntry\TrackTimestampScale
minOccurs / maxOccurs: 1 / 1
maxver: 3
definition: The scale to apply on this track to work at normal speed
in relation with other tracks (mostly used to adjust video speed
when the audio length differs).
stream copy: True (Section 8)
5.1.4.1.16. MaxBlockAdditionID Element
id / type / default: 0x55EE / uinteger / 0
path: \Segment\Tracks\TrackEntry\MaxBlockAdditionID
minOccurs / maxOccurs: 1 / 1
definition: The maximum value of BlockAddID (Section 5.1.3.5.2.3).
A value of 0 means there is no BlockAdditions (Section 5.1.3.5.2)
for this track.
5.1.4.1.17. BlockAdditionMapping Element
id / type: 0x41E4 / master
path: \Segment\Tracks\TrackEntry\BlockAdditionMapping
minver: 4
definition: Contains elements that extend the track format by adding
content either to each frame, with BlockAddID
(Section 5.1.3.5.2.3), or to the track as a whole with
BlockAddIDExtraData.
5.1.4.1.17.1. BlockAddIDValue Element
id / type: 0x41F0 / uinteger
range: >=2
path: \Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDValu
e
maxOccurs: 1
minver: 4
definition: If the track format extension needs content beside
frames, the value refers to the BlockAddID (Section 5.1.3.5.2.3)
value being described.
usage notes: To keep MaxBlockAdditionID as low as possible, small
values SHOULD be used.
5.1.4.1.17.2. BlockAddIDName Element
id / type: 0x41A4 / string
path: \Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDName
maxOccurs: 1
minver: 4
definition: A human-friendly name describing the type of
BlockAdditional data, as defined by the associated Block
Additional Mapping.
5.1.4.1.17.3. BlockAddIDType Element
id / type / default: 0x41E7 / uinteger / 0
path: \Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDType
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: Stores the registered identifier of the Block Additional
Mapping to define how the BlockAdditional data should be handled.
usage notes: If BlockAddIDType is 0, the BlockAddIDValue and
corresponding BlockAddID values MUST be 1.
5.1.4.1.17.4. BlockAddIDExtraData Element
id / type: 0x41ED / binary
path: \Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDExtr
aData
maxOccurs: 1
minver: 4
definition: Extra binary data that the BlockAddIDType can use to
interpret the BlockAdditional data. The interpretation of the
binary data depends on the BlockAddIDType value and the
corresponding Block Additional Mapping.
5.1.4.1.18. Name Element
id / type: 0x536E / utf-8
path: \Segment\Tracks\TrackEntry\Name
maxOccurs: 1
definition: A human-readable track name.
5.1.4.1.19. Language Element
id / type / default: 0x22B59C / string / eng
path: \Segment\Tracks\TrackEntry\Language
minOccurs / maxOccurs: 1 / 1
definition: The language of the track, in the Matroska languages
form; see Section 12 on language codes. This element MUST be
ignored if the LanguageBCP47 element is used in the same
TrackEntry.
5.1.4.1.20. LanguageBCP47 Element
id / type: 0x22B59D / string
path: \Segment\Tracks\TrackEntry\LanguageBCP47
maxOccurs: 1
minver: 4
definition: The language of the track, in the form defined in
[RFC5646]; see Section 12 on language codes. If this element is
used, then any Language elements used in the same TrackEntry MUST
be ignored.
5.1.4.1.21. CodecID Element
id / type: 0x86 / string
path: \Segment\Tracks\TrackEntry\CodecID
minOccurs / maxOccurs: 1 / 1
definition: An ID corresponding to the codec; see [MatroskaCodec]
for more info.
stream copy: True (Section 8)
5.1.4.1.22. CodecPrivate Element
id / type: 0x63A2 / binary
path: \Segment\Tracks\TrackEntry\CodecPrivate
maxOccurs: 1
definition: Private data only known to the codec.
stream copy: True (Section 8)
5.1.4.1.23. CodecName Element
id / type: 0x258688 / utf-8
path: \Segment\Tracks\TrackEntry\CodecName
maxOccurs: 1
definition: A human-readable string specifying the codec.
5.1.4.1.24. AttachmentLink Element
id / type: 0x7446 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\AttachmentLink
maxOccurs: 1
maxver: 3
definition: The UID of an attachment that is used by this codec.
usage notes: The value MUST match the FileUID value of an attachment
found in this Segment.
5.1.4.1.25. CodecDelay Element
id / type / default: 0x56AA / uinteger / 0
path: \Segment\Tracks\TrackEntry\CodecDelay
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: The built-in delay for the codec, expressed in Matroska
Ticks -- i.e., in nanoseconds; see Section 11.1. It represents
the number of codec samples that will be discarded by the decoder
during playback. This timestamp value MUST be subtracted from
each frame timestamp in order to get the timestamp that will be
actually played. The value SHOULD be small so the muxing of
tracks with the same actual timestamp are in the same Cluster.
stream copy: True (Section 8)
5.1.4.1.26. SeekPreRoll Element
id / type / default: 0x56BB / uinteger / 0
path: \Segment\Tracks\TrackEntry\SeekPreRoll
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: After a discontinuity, the duration of the data that the
decoder MUST decode before the decoded data is valid, expressed in
Matroska Ticks -- i.e., in nanoseconds; see Section 11.1.
stream copy: True (Section 8)
5.1.4.1.27. TrackTranslate Element
id / type: 0x6624 / master
path: \Segment\Tracks\TrackEntry\TrackTranslate
definition: The mapping between this TrackEntry and a track value in
the given Chapter Codec.
rationale: Chapter Codecs may need to address content in a specific
track, but they may not know of the way to identify tracks in
Matroska. This element and its child elements add a way to map
the internal tracks known to the Chapter Codec to the track IDs in
Matroska. This allows remuxing a file with Chapter Codec without
changing the content of the codec data, just the track mapping.
5.1.4.1.27.1. TrackTranslateTrackID Element
id / type: 0x66A5 / binary
path: \Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateTrackI
D
minOccurs / maxOccurs: 1 / 1
definition: The binary value used to represent this TrackEntry in
the chapter codec data. The format depends on the
ChapProcessCodecID used; see Section 5.1.7.1.4.15.
5.1.4.1.27.2. TrackTranslateCodec Element
id / type: 0x66BF / uinteger
path: \Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateCodec
minOccurs / maxOccurs: 1 / 1
definition: Applies to the chapter codec of the given chapter
edition(s); see Section 5.1.7.1.4.15.
defined values: See Table 31. Additional values can be registered
in the "Matroska Chapter Codec IDs" registry defined in
Section 27.14.
5.1.4.1.27.3. TrackTranslateEditionUID Element
id / type: 0x66FC / uinteger
path: \Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateEditio
nUID
definition: Specifies a chapter edition UID to which this
TrackTranslate applies.
usage notes: When no TrackTranslateEditionUID is specified in the
TrackTranslate, the TrackTranslate applies to all chapter editions
found in the Segment using the given TrackTranslateCodec.
5.1.4.1.28. Video Element
id / type: 0xE0 / master
path: \Segment\Tracks\TrackEntry\Video
maxOccurs: 1
definition: Video settings.
5.1.4.1.28.1. FlagInterlaced Element
id / type / default: 0x9A / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\FlagInterlaced
minOccurs / maxOccurs: 1 / 1
minver: 2
definition: Specifies whether the video frames in this track are
interlaced.
restrictions: See Table 3.
stream copy: True (Section 8)
+=======+==============+==========================+
| value | label | definition |
+=======+==============+==========================+
| 0 | undetermined | Unknown status. This |
| | | value SHOULD be avoided. |
+-------+--------------+--------------------------+
| 1 | interlaced | Interlaced frames. |
+-------+--------------+--------------------------+
| 2 | progressive | No interlacing. |
+-------+--------------+--------------------------+
Table 3: FlagInterlaced Values
5.1.4.1.28.2. FieldOrder Element
id / type / default: 0x9D / uinteger / 2
path: \Segment\Tracks\TrackEntry\Video\FieldOrder
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: Specifies the field ordering of video frames in this
track.
restrictions: See Table 4.
usage notes: If FlagInterlaced is not set to 1, this element MUST be
ignored.
stream copy: True (Section 8)
+=======+===============+=========================================+
| value | label | definition |
+=======+===============+=========================================+
| 0 | progressive | Interlaced frames. This value SHOULD |
| | | be avoided; setting FlagInterlaced to 2 |
| | | is sufficient. |
+-------+---------------+-----------------------------------------+
| 1 | tff | Top field displayed first. Top field |
| | | stored first. |
+-------+---------------+-----------------------------------------+
| 2 | undetermined | Unknown field order. This value SHOULD |
| | | be avoided. |
+-------+---------------+-----------------------------------------+
| 6 | bff | Bottom field displayed first. Bottom |
| | | field stored first. |
+-------+---------------+-----------------------------------------+
| 9 | tff | Top field displayed first. Fields are |
| | (interleaved) | interleaved in storage with the top |
| | | line of the top field stored first. |
+-------+---------------+-----------------------------------------+
| 14 | bff | Bottom field displayed first. Fields |
| | (interleaved) | are interleaved in storage with the top |
| | | line of the top field stored first. |
+-------+---------------+-----------------------------------------+
Table 4: FieldOrder Values
5.1.4.1.28.3. StereoMode Element
id / type / default: 0x53B8 / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\StereoMode
minOccurs / maxOccurs: 1 / 1
minver: 3
definition: Stereo-3D video mode. See Section 18.10 for more
details.
defined values: See Table 5. Additional values can be registered in
the "Matroska Stereo Modes" registry defined in Section 27.7.
stream copy: True (Section 8)
+=======+===================================================+
| value | label |
+=======+===================================================+
| 0 | mono |
+-------+---------------------------------------------------+
| 1 | side by side (left eye first) |
+-------+---------------------------------------------------+
| 2 | top - bottom (right eye is first) |
+-------+---------------------------------------------------+
| 3 | top - bottom (left eye is first) |
+-------+---------------------------------------------------+
| 4 | checkboard (right eye is first) |
+-------+---------------------------------------------------+
| 5 | checkboard (left eye is first) |
+-------+---------------------------------------------------+
| 6 | row interleaved (right eye is first) |
+-------+---------------------------------------------------+
| 7 | row interleaved (left eye is first) |
+-------+---------------------------------------------------+
| 8 | column interleaved (right eye is first) |
+-------+---------------------------------------------------+
| 9 | column interleaved (left eye is first) |
+-------+---------------------------------------------------+
| 10 | anaglyph (cyan/red) |
+-------+---------------------------------------------------+
| 11 | side by side (right eye first) |
+-------+---------------------------------------------------+
| 12 | anaglyph (green/magenta) |
+-------+---------------------------------------------------+
| 13 | both eyes laced in one Block (left eye is first) |
+-------+---------------------------------------------------+
| 14 | both eyes laced in one Block (right eye is first) |
+-------+---------------------------------------------------+
Table 5: StereoMode Values
5.1.4.1.28.4. AlphaMode Element
id / type / default: 0x53C0 / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\AlphaMode
minOccurs / maxOccurs: 1 / 1
minver: 3
definition: Indicates whether the BlockAdditional element with
BlockAddID of "1" contains Alpha data as defined by the Codec
Mapping for the CodecID. Undefined values (i.e., values other
than 0 or 1) SHOULD NOT be used, as the behavior of known
implementations is different.
defined values: See Table 6. Additional values can be registered in
the "Matroska Alpha Modes" registry defined in Section 27.8.
stream copy: True (Section 8)
+=======+=========+============================================+
| value | label | definition |
+=======+=========+============================================+
| 0 | none | The BlockAdditional element with |
| | | BlockAddID of "1" does not exist or SHOULD |
| | | NOT be considered as containing such data. |
+-------+---------+--------------------------------------------+
| 1 | present | The BlockAdditional element with |
| | | BlockAddID of "1" contains alpha channel |
| | | data. |
+-------+---------+--------------------------------------------+
Table 6: AlphaMode Values
5.1.4.1.28.5. OldStereoMode Element
id / type: 0x53B9 / uinteger
path: \Segment\Tracks\TrackEntry\Video\OldStereoMode
maxOccurs: 1
maxver: 2
definition: Bogus StereoMode value used in old versions of
[libmatroska].
restrictions: See Table 7.
usage notes: This element MUST NOT be used. It was an incorrect
value used in libmatroska up to 0.9.0.
+=======+===========+
| value | label |
+=======+===========+
| 0 | mono |
+-------+-----------+
| 1 | right eye |
+-------+-----------+
| 2 | left eye |
+-------+-----------+
| 3 | both eyes |
+-------+-----------+
Table 7: OldStereoMode
Values
5.1.4.1.28.6. PixelWidth Element
id / type: 0xB0 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\Video\PixelWidth
minOccurs / maxOccurs: 1 / 1
definition: Width of the encoded video frames in pixels.
stream copy: True (Section 8)
5.1.4.1.28.7. PixelHeight Element
id / type: 0xBA / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\Video\PixelHeight
minOccurs / maxOccurs: 1 / 1
definition: Height of the encoded video frames in pixels.
stream copy: True (Section 8)
5.1.4.1.28.8. PixelCropBottom Element
id / type / default: 0x54AA / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\PixelCropBottom
minOccurs / maxOccurs: 1 / 1
definition: The number of video pixels to remove at the bottom of
the image.
stream copy: True (Section 8)
5.1.4.1.28.9. PixelCropTop Element
id / type / default: 0x54BB / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\PixelCropTop
minOccurs / maxOccurs: 1 / 1
definition: The number of video pixels to remove at the top of the
image.
stream copy: True (Section 8)
5.1.4.1.28.10. PixelCropLeft Element
id / type / default: 0x54CC / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\PixelCropLeft
minOccurs / maxOccurs: 1 / 1
definition: The number of video pixels to remove on the left of the
image.
stream copy: True (Section 8)
5.1.4.1.28.11. PixelCropRight Element
id / type / default: 0x54DD / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\PixelCropRight
minOccurs / maxOccurs: 1 / 1
definition: The number of video pixels to remove on the right of the
image.
stream copy: True (Section 8)
5.1.4.1.28.12. DisplayWidth Element
id / type: 0x54B0 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\Video\DisplayWidth
maxOccurs: 1
definition: Width of the video frames to display. Applies to the
video frame after cropping (PixelCrop* Elements).
notes: See Table 8.
stream copy: True (Section 8)
+===========+==================================================+
| attribute | note |
+===========+==================================================+
| default | If the DisplayUnit of the same TrackEntry is 0, |
| | then the default value for DisplayWidth is equal |
| | to PixelWidth - PixelCropLeft - PixelCropRight; |
| | else, there is no default value. |
+-----------+--------------------------------------------------+
Table 8: DisplayWidth Implementation Notes
5.1.4.1.28.13. DisplayHeight Element
id / type: 0x54BA / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\Video\DisplayHeight
maxOccurs: 1
definition: Height of the video frames to display. Applies to the
video frame after cropping (PixelCrop* Elements).
notes: See Table 9.
stream copy: True (Section 8)
+===========+===================================================+
| attribute | note |
+===========+===================================================+
| default | If the DisplayUnit of the same TrackEntry is 0, |
| | then the default value for DisplayHeight is equal |
| | to PixelHeight - PixelCropTop - PixelCropBottom; |
| | else, there is no default value. |
+-----------+---------------------------------------------------+
Table 9: DisplayHeight Implementation Notes
5.1.4.1.28.14. DisplayUnit Element
id / type / default: 0x54B2 / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\DisplayUnit
minOccurs / maxOccurs: 1 / 1
definition: How DisplayWidth and DisplayHeight are interpreted.
defined values: See Table 10. Additional values can be registered
in the "Matroska Display Units" registry defined in Section 27.9.
+=======+======================+
| value | label |
+=======+======================+
| 0 | pixels |
+-------+----------------------+
| 1 | centimeters |
+-------+----------------------+
| 2 | inches |
+-------+----------------------+
| 3 | display aspect ratio |
+-------+----------------------+
| 4 | unknown |
+-------+----------------------+
Table 10: DisplayUnit Values
5.1.4.1.28.15. UncompressedFourCC Element
id / type: 0x2EB524 / binary
length: 4
path: \Segment\Tracks\TrackEntry\Video\UncompressedFourCC
minOccurs / maxOccurs: See Table 11 / 1
definition: Specifies the uncompressed pixel format used for the
Track's data as a FourCC. This value is similar in scope to the
biCompression value of AVI's BITMAPINFO [AVIFormat]. There is
neither a definitive list of FourCC values nor an official
registry. Some common values for YUV pixel formats can be found
at [MSYUV8], [MSYUV16], and [FourCC-YUV]. Some common values for
uncompressed RGB pixel formats can be found at [MSRGB] and
[FourCC-RGB].
notes: See Table 11.
stream copy: True (Section 8)
+===========+==============================================+
| attribute | note |
+===========+==============================================+
| minOccurs | UncompressedFourCC MUST be set (minOccurs=1) |
| | in TrackEntry when the CodecID element of |
| | the TrackEntry is set to "V_UNCOMPRESSED". |
+-----------+----------------------------------------------+
Table 11: UncompressedFourCC Implementation Notes
5.1.4.1.28.16. Colour Element
id / type: 0x55B0 / master
path: \Segment\Tracks\TrackEntry\Video\Colour
maxOccurs: 1
minver: 4
definition: Settings describing the color format.
stream copy: True (Section 8)
5.1.4.1.28.17. MatrixCoefficients Element
id / type / default: 0x55B1 / uinteger / 2
path: \Segment\Tracks\TrackEntry\Video\Colour\MatrixCoefficients
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: The Matrix Coefficients of the video used to derive luma
and chroma values from red, green, and blue color primaries. For
clarity, the value and meanings for MatrixCoefficients are adopted
from Table 4 of [ITU-H.273].
restrictions: See Table 12.
stream copy: True (Section 8)
+=======+=======================================+
| value | label |
+=======+=======================================+
| 0 | Identity |
+-------+---------------------------------------+
| 1 | ITU-R BT.709 |
+-------+---------------------------------------+
| 2 | unspecified |
+-------+---------------------------------------+
| 3 | reserved |
+-------+---------------------------------------+
| 4 | US FCC 73.682 |
+-------+---------------------------------------+
| 5 | ITU-R BT.470BG |
+-------+---------------------------------------+
| 6 | SMPTE 170M |
+-------+---------------------------------------+
| 7 | SMPTE 240M |
+-------+---------------------------------------+
| 8 | YCoCg |
+-------+---------------------------------------+
| 9 | BT2020 Non-constant Luminance |
+-------+---------------------------------------+
| 10 | BT2020 Constant Luminance |
+-------+---------------------------------------+
| 11 | SMPTE ST 2085 |
+-------+---------------------------------------+
| 12 | Chroma-derived Non-constant Luminance |
+-------+---------------------------------------+
| 13 | Chroma-derived Constant Luminance |
+-------+---------------------------------------+
| 14 | ITU-R BT.2100-0 |
+-------+---------------------------------------+
Table 12: MatrixCoefficients Values
5.1.4.1.28.18. BitsPerChannel Element
id / type / default: 0x55B2 / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\Colour\BitsPerChannel
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: Number of decoded bits per channel. A value of 0
indicates that the BitsPerChannel is unspecified.
stream copy: True (Section 8)
5.1.4.1.28.19. ChromaSubsamplingHorz Element
id / type: 0x55B3 / uinteger
path: \Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingHorz
maxOccurs: 1
minver: 4
definition: The number of pixels to remove in the Cr and Cb channels
for every pixel not removed horizontally. Example: For video with
4:2:0 chroma subsampling, the ChromaSubsamplingHorz SHOULD be set
to 1.
stream copy: True (Section 8)
5.1.4.1.28.20. ChromaSubsamplingVert Element
id / type: 0x55B4 / uinteger
path: \Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingVert
maxOccurs: 1
minver: 4
definition: The number of pixels to remove in the Cr and Cb channels
for every pixel not removed vertically. Example: For video with
4:2:0 chroma subsampling, the ChromaSubsamplingVert SHOULD be set
to 1.
stream copy: True (Section 8)
5.1.4.1.28.21. CbSubsamplingHorz Element
id / type: 0x55B5 / uinteger
path: \Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingHorz
maxOccurs: 1
minver: 4
definition: The number of pixels to remove in the Cb channel for
every pixel not removed horizontally. This is additive with
ChromaSubsamplingHorz. Example: For video with 4:2:1 chroma
subsampling, the ChromaSubsamplingHorz SHOULD be set to 1, and
CbSubsamplingHorz SHOULD be set to 1.
stream copy: True (Section 8)
5.1.4.1.28.22. CbSubsamplingVert Element
id / type: 0x55B6 / uinteger
path: \Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingVert
maxOccurs: 1
minver: 4
definition: The number of pixels to remove in the Cb channel for
every pixel not removed vertically. This is additive with
ChromaSubsamplingVert.
stream copy: True (Section 8)
5.1.4.1.28.23. ChromaSitingHorz Element
id / type / default: 0x55B7 / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingHorz
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: How chroma is subsampled horizontally.
defined values: See Table 13. Additional values can be registered
in the "Matroska Horizontal Chroma Sitings" registry defined in
Section 27.10.
stream copy: True (Section 8)
+=======+=================+
| value | label |
+=======+=================+
| 0 | unspecified |
+-------+-----------------+
| 1 | left collocated |
+-------+-----------------+
| 2 | half |
+-------+-----------------+
Table 13:
ChromaSitingHorz Values
5.1.4.1.28.24. ChromaSitingVert Element
id / type / default: 0x55B8 / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingVert
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: How chroma is subsampled vertically.
defined values: See Table 14. Additional values can be registered
in the "Matroska Vertical Chroma Sitings" registry defined in
Section 27.11.
stream copy: True (Section 8)
+=======+================+
| value | label |
+=======+================+
| 0 | unspecified |
+-------+----------------+
| 1 | top collocated |
+-------+----------------+
| 2 | half |
+-------+----------------+
Table 14:
ChromaSitingVert
Values
5.1.4.1.28.25. Color Range Element
id / type / default: 0x55B9 / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\Colour\Range
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: Clipping of the color ranges.
defined values: See Table 15. Additional values can be registered
in the "Matroska Color Ranges" registry defined in Section 27.12.
stream copy: True (Section 8)
+=======+=========================================================+
| value | label |
+=======+=========================================================+
| 0 | unspecified |
+-------+---------------------------------------------------------+
| 1 | broadcast range |
+-------+---------------------------------------------------------+
| 2 | full range (no clipping) |
+-------+---------------------------------------------------------+
| 3 | defined by MatrixCoefficients / TransferCharacteristics |
+-------+---------------------------------------------------------+
Table 15: Range Values
5.1.4.1.28.26. TransferCharacteristics Element
id / type / default: 0x55BA / uinteger / 2
path: \Segment\Tracks\TrackEntry\Video\Colour\TransferCharacteristic
s
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: The transfer characteristics of the video. For clarity,
the value and meanings for TransferCharacteristics are adopted
from Table 3 of [ITU-H.273].
restrictions: See Table 16.
stream copy: True (Section 8)
+=======+=======================================+
| value | label |
+=======+=======================================+
| 0 | reserved |
+-------+---------------------------------------+
| 1 | ITU-R BT.709 |
+-------+---------------------------------------+
| 2 | unspecified |
+-------+---------------------------------------+
| 3 | reserved2 |
+-------+---------------------------------------+
| 4 | Gamma 2.2 curve - BT.470M |
+-------+---------------------------------------+
| 5 | Gamma 2.8 curve - BT.470BG |
+-------+---------------------------------------+
| 6 | SMPTE 170M |
+-------+---------------------------------------+
| 7 | SMPTE 240M |
+-------+---------------------------------------+
| 8 | Linear |
+-------+---------------------------------------+
| 9 | Log |
+-------+---------------------------------------+
| 10 | Log Sqrt |
+-------+---------------------------------------+
| 11 | IEC 61966-2-4 |
+-------+---------------------------------------+
| 12 | ITU-R BT.1361 Extended Colour Gamut |
+-------+---------------------------------------+
| 13 | IEC 61966-2-1 |
+-------+---------------------------------------+
| 14 | ITU-R BT.2020 10 bit |
+-------+---------------------------------------+
| 15 | ITU-R BT.2020 12 bit |
+-------+---------------------------------------+
| 16 | ITU-R BT.2100 Perceptual Quantization |
+-------+---------------------------------------+
| 17 | SMPTE ST 428-1 |
+-------+---------------------------------------+
| 18 | ARIB STD-B67 (HLG) |
+-------+---------------------------------------+
Table 16: TransferCharacteristics Values
5.1.4.1.28.27. Primaries Element
id / type / default: 0x55BB / uinteger / 2
path: \Segment\Tracks\TrackEntry\Video\Colour\Primaries
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: The color primaries of the video. For clarity, the
value and meanings for Primaries are adopted from Table 2 of
[ITU-H.273].
restrictions: See Table 17.
stream copy: True (Section 8)
+=======+========================================+
| value | label |
+=======+========================================+
| 0 | reserved |
+-------+----------------------------------------+
| 1 | ITU-R BT.709 |
+-------+----------------------------------------+
| 2 | unspecified |
+-------+----------------------------------------+
| 3 | reserved2 |
+-------+----------------------------------------+
| 4 | ITU-R BT.470M |
+-------+----------------------------------------+
| 5 | ITU-R BT.470BG - BT.601 625 |
+-------+----------------------------------------+
| 6 | ITU-R BT.601 525 - SMPTE 170M |
+-------+----------------------------------------+
| 7 | SMPTE 240M |
+-------+----------------------------------------+
| 8 | FILM |
+-------+----------------------------------------+
| 9 | ITU-R BT.2020 |
+-------+----------------------------------------+
| 10 | SMPTE ST 428-1 |
+-------+----------------------------------------+
| 11 | SMPTE RP 432-2 |
+-------+----------------------------------------+
| 12 | SMPTE EG 432-2 |
+-------+----------------------------------------+
| 22 | EBU Tech. 3213-E - JEDEC P22 phosphors |
+-------+----------------------------------------+
Table 17: Primaries Values
5.1.4.1.28.28. MaxCLL Element
id / type: 0x55BC / uinteger
path: \Segment\Tracks\TrackEntry\Video\Colour\MaxCLL
maxOccurs: 1
minver: 4
definition: Maximum brightness of a single pixel (Maximum Content
Light Level) in candelas per square meter (cd/m^2).
stream copy: True (Section 8)
5.1.4.1.28.29. MaxFALL Element
id / type: 0x55BD / uinteger
path: \Segment\Tracks\TrackEntry\Video\Colour\MaxFALL
maxOccurs: 1
minver: 4
definition: Maximum brightness of a single full frame (Maximum
Frame-Average Light Level) in candelas per square meter (cd/m^2).
stream copy: True (Section 8)
5.1.4.1.28.30. MasteringMetadata Element
id / type: 0x55D0 / master
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata
maxOccurs: 1
minver: 4
definition: SMPTE 2086 mastering data.
stream copy: True (Section 8)
5.1.4.1.28.31. PrimaryRChromaticityX Element
id / type: 0x55D1 / float
range: 0x0p+0-0x1p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Prim
aryRChromaticityX
maxOccurs: 1
minver: 4
definition: Red X chromaticity coordinate, as defined by [CIE-1931].
stream copy: True (Section 8)
5.1.4.1.28.32. PrimaryRChromaticityY Element
id / type: 0x55D2 / float
range: 0x0p+0-0x1p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Prim
aryRChromaticityY
maxOccurs: 1
minver: 4
definition: Red Y chromaticity coordinate, as defined by [CIE-1931].
stream copy: True (Section 8)
5.1.4.1.28.33. PrimaryGChromaticityX Element
id / type: 0x55D3 / float
range: 0x0p+0-0x1p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Prim
aryGChromaticityX
maxOccurs: 1
minver: 4
definition: Green X chromaticity coordinate, as defined by
[CIE-1931].
stream copy: True (Section 8)
5.1.4.1.28.34. PrimaryGChromaticityY Element
id / type: 0x55D4 / float
range: 0x0p+0-0x1p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Prim
aryGChromaticityY
maxOccurs: 1
minver: 4
definition: Green Y chromaticity coordinate, as defined by
[CIE-1931].
stream copy: True (Section 8)
5.1.4.1.28.35. PrimaryBChromaticityX Element
id / type: 0x55D5 / float
range: 0x0p+0-0x1p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Prim
aryBChromaticityX
maxOccurs: 1
minver: 4
definition: Blue X chromaticity coordinate, as defined by
[CIE-1931].
stream copy: True (Section 8)
5.1.4.1.28.36. PrimaryBChromaticityY Element
id / type: 0x55D6 / float
range: 0x0p+0-0x1p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Prim
aryBChromaticityY
maxOccurs: 1
minver: 4
definition: Blue Y chromaticity coordinate, as defined by
[CIE-1931].
stream copy: True (Section 8)
5.1.4.1.28.37. WhitePointChromaticityX Element
id / type: 0x55D7 / float
range: 0x0p+0-0x1p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Whit
ePointChromaticityX
maxOccurs: 1
minver: 4
definition: White X chromaticity coordinate, as defined by
[CIE-1931].
stream copy: True (Section 8)
5.1.4.1.28.38. WhitePointChromaticityY Element
id / type: 0x55D8 / float
range: 0x0p+0-0x1p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Whit
ePointChromaticityY
maxOccurs: 1
minver: 4
definition: White Y chromaticity coordinate, as defined by
[CIE-1931].
stream copy: True (Section 8)
5.1.4.1.28.39. LuminanceMax Element
id / type: 0x55D9 / float
range: >= 0x0p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Lumi
nanceMax
maxOccurs: 1
minver: 4
definition: Maximum luminance. Represented in candelas per square
meter (cd/m^2).
stream copy: True (Section 8)
5.1.4.1.28.40. LuminanceMin Element
id / type: 0x55DA / float
range: >= 0x0p+0
path: \Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Lumi
nanceMin
maxOccurs: 1
minver: 4
definition: Minimum luminance. Represented in candelas per square
meter (cd/m^2).
stream copy: True (Section 8)
5.1.4.1.28.41. Projection Element
id / type: 0x7670 / master
path: \Segment\Tracks\TrackEntry\Video\Projection
maxOccurs: 1
minver: 4
definition: Describes the video projection details. Used to render
spherical or VR videos or to flip videos horizontally or
vertically.
stream copy: True (Section 8)
5.1.4.1.28.42. ProjectionType Element
id / type / default: 0x7671 / uinteger / 0
path: \Segment\Tracks\TrackEntry\Video\Projection\ProjectionType
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: Describes the projection used for this video track.
defined values: See Table 18. Additional values can be registered
in the "Matroska Projection Types" registry defined in
Section 27.15.
stream copy: True (Section 8)
+=======+=================+
| value | label |
+=======+=================+
| 0 | rectangular |
+-------+-----------------+
| 1 | equirectangular |
+-------+-----------------+
| 2 | cubemap |
+-------+-----------------+
| 3 | mesh |
+-------+-----------------+
Table 18:
ProjectionType Values
5.1.4.1.28.43. ProjectionPrivate Element
id / type: 0x7672 / binary
path: \Segment\Tracks\TrackEntry\Video\Projection\ProjectionPrivate
maxOccurs: 1
minver: 4
definition: Private data that only applies to a specific projection.
* If ProjectionType equals 0 (rectangular), then this element MUST
NOT be present.
* If ProjectionType equals 1 (equirectangular), then this element
MUST be present and contain the same binary data that would be
stored inside an ISOBMFF Equirectangular Projection Box ("equi").
* If ProjectionType equals 2 (cubemap), then this element MUST be
present and contain the same binary data that would be stored
inside an ISOBMFF Cubemap Projection Box ("cbmp").
* If ProjectionType equals 3 (mesh), then this element MUST be
present and contain the same binary data that would be stored
inside an ISOBMFF Mesh Projection Box ("mshp").
usage notes: ISOBMFF box size and FourCC fields are not included in
the binary data, but the FullBox version and flag fields are.
This is to avoid redundant framing information while preserving
versioning and semantics between the two container formats.
stream copy: True (Section 8)
5.1.4.1.28.44. ProjectionPoseYaw Element
id / type / default: 0x7673 / float / 0x0p+0
range: >= -0xB4p+0, <= 0xB4p+0
path: \Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseYaw
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: Specifies a yaw rotation to the projection. Value
represents a clockwise rotation, in degrees, around the up vector.
This rotation must be applied before any ProjectionPosePitch or
ProjectionPoseRoll rotations. The value of this element MUST be
in the -180 to 180 degree range, both inclusive.
Setting ProjectionPoseYaw to 180 or -180 degrees with
ProjectionPoseRoll and ProjectionPosePitch set to 0 degrees flips the
image horizontally.
stream copy: True (Section 8)
5.1.4.1.28.45. ProjectionPosePitch Element
id / type / default: 0x7674 / float / 0x0p+0
range: >= -0x5Ap+0, <= 0x5Ap+0
path: \Segment\Tracks\TrackEntry\Video\Projection\ProjectionPosePitc
h
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: Specifies a pitch rotation to the projection. Value
represents a counter-clockwise rotation, in degrees, around the
right vector. This rotation must be applied after the
ProjectionPoseYaw rotation and before the ProjectionPoseRoll
rotation. The value of this element MUST be in the -90 to 90
degree range, both inclusive.
stream copy: True (Section 8)
5.1.4.1.28.46. ProjectionPoseRoll Element
id / type / default: 0x7675 / float / 0x0p+0
range: >= -0xB4p+0, <= 0xB4p+0
path: \Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseRoll
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: Specifies a roll rotation to the projection. Value
represents a counter-clockwise rotation, in degrees, around the
forward vector. This rotation must be applied after the
ProjectionPoseYaw and ProjectionPosePitch rotations. The value of
this element MUST be in the -180 to 180 degree range, both
inclusive. Setting ProjectionPoseRoll to 180 or -180 degrees and
ProjectionPoseYaw to 180 or -180 degrees with ProjectionPosePitch
set to 0 degrees flips the image vertically. Setting
ProjectionPoseRoll to 180 or -180 degrees with ProjectionPoseYaw
and ProjectionPosePitch set to 0 degrees flips the image
horizontally and vertically.
stream copy: True (Section 8)
5.1.4.1.29. Audio Element
id / type: 0xE1 / master
path: \Segment\Tracks\TrackEntry\Audio
maxOccurs: 1
definition: Audio settings.
5.1.4.1.29.1. SamplingFrequency Element
id / type / default: 0xB5 / float / 0x1.f4p+12
range: > 0x0p+0
path: \Segment\Tracks\TrackEntry\Audio\SamplingFrequency
minOccurs / maxOccurs: 1 / 1
definition: Sampling frequency in Hz.
stream copy: True (Section 8)
5.1.4.1.29.2. OutputSamplingFrequency Element
id / type: 0x78B5 / float
range: > 0x0p+0
path: \Segment\Tracks\TrackEntry\Audio\OutputSamplingFrequency
maxOccurs: 1
definition: Real output sampling frequency in Hz that is used for
Spectral Band Replication (SBR) techniques.
notes: See Table 19.
+===========+======================================================+
| attribute | note |
+===========+======================================================+
| default | The default value for OutputSamplingFrequency of the |
| | same TrackEntry is equal to the SamplingFrequency. |
+-----------+------------------------------------------------------+
Table 19: OutputSamplingFrequency Implementation Notes
5.1.4.1.29.3. Channels Element
id / type / default: 0x9F / uinteger / 1
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\Audio\Channels
minOccurs / maxOccurs: 1 / 1
definition: Numbers of channels in the track.
stream copy: True (Section 8)
5.1.4.1.29.4. BitDepth Element
id / type: 0x6264 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\Audio\BitDepth
maxOccurs: 1
definition: Bits per sample, mostly used for PCM.
stream copy: True (Section 8)
5.1.4.1.30. TrackOperation Element
id / type: 0xE2 / master
path: \Segment\Tracks\TrackEntry\TrackOperation
maxOccurs: 1
minver: 3
definition: Operation that needs to be applied on tracks to create
this virtual track. For more details, see Section 18.8.
stream copy: True (Section 8)
5.1.4.1.30.1. TrackCombinePlanes Element
id / type: 0xE3 / master
path: \Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes
maxOccurs: 1
minver: 3
definition: Contains the list of all video plane tracks that need to
be combined to create this 3D track.
stream copy: True (Section 8)
5.1.4.1.30.2. TrackPlane Element
id / type: 0xE4 / master
path: \Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\T
rackPlane
minOccurs: 1
minver: 3
definition: Contains a video plane track that needs to be combined
to create this 3D track.
stream copy: True (Section 8)
5.1.4.1.30.3. TrackPlaneUID Element
id / type: 0xE5 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\T
rackPlane\TrackPlaneUID
minOccurs / maxOccurs: 1 / 1
minver: 3
definition: The TrackUID number of the track representing the plane.
stream copy: True (Section 8)
5.1.4.1.30.4. TrackPlaneType Element
id / type: 0xE6 / uinteger
path: \Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\T
rackPlane\TrackPlaneType
minOccurs / maxOccurs: 1 / 1
minver: 3
definition: The kind of plane this track corresponds to.
defined values: See Table 20. Additional values can be registered
in the "Matroska Track Plane Types" registry defined in
Section 27.17.
stream copy: True (Section 8)
+=======+============+
| value | label |
+=======+============+
| 0 | left eye |
+-------+------------+
| 1 | right eye |
+-------+------------+
| 2 | background |
+-------+------------+
Table 20:
TrackPlaneType Values
5.1.4.1.30.5. TrackJoinBlocks Element
id / type: 0xE9 / master
path: \Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks
maxOccurs: 1
minver: 3
definition: Contains the list of all tracks whose Blocks need to be
combined to create this virtual track.
stream copy: True (Section 8)
5.1.4.1.30.6. TrackJoinUID Element
id / type: 0xED / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks\Trac
kJoinUID
minOccurs: 1
minver: 3
definition: The TrackUID number of a track whose blocks are used to
create this virtual track.
stream copy: True (Section 8)
5.1.4.1.31. ContentEncodings Element
id / type: 0x6D80 / master
path: \Segment\Tracks\TrackEntry\ContentEncodings
maxOccurs: 1
definition: Settings for several content encoding mechanisms like
compression or encryption.
stream copy: True (Section 8)
5.1.4.1.31.1. ContentEncoding Element
id / type: 0x6240 / master
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding
minOccurs: 1
definition: Settings for one content encoding like compression or
encryption.
stream copy: True (Section 8)
5.1.4.1.31.2. ContentEncodingOrder Element
id / type / default: 0x5031 / uinteger / 0
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncodingOrder
minOccurs / maxOccurs: 1 / 1
definition: Defines the order to apply each ContentEncoding of the
ContentEncodings. The decoder/demuxer MUST start with the
ContentEncoding with the highest ContentEncodingOrder and work its
way down to the ContentEncoding with the lowest
ContentEncodingOrder. This value MUST be unique for each
ContentEncoding found in the ContentEncodings of this TrackEntry.
stream copy: True (Section 8)
5.1.4.1.31.3. ContentEncodingScope Element
id / type / default: 0x5032 / uinteger / 1
range: not 0 (0x1-0x8000000000000000)
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncodingScope
minOccurs / maxOccurs: 1 / 1
definition: A bit field that describes which elements have been
modified in this way. Values (big-endian) can be OR'ed.
defined values: See Table 21. Additional values can be registered
in the "Matroska Content Encoding Scopes" registry defined in
Section 27.5.
stream copy: True (Section 8)
+=======+=========+============================================+
| value | label | definition |
+=======+=========+============================================+
| 0x1 | Block | All frame contents, excluding lacing data. |
+-------+---------+--------------------------------------------+
| 0x2 | Private | The track's CodecPrivate data. |
+-------+---------+--------------------------------------------+
| 0x4 | Next | The next ContentEncoding (next |
| | | ContentEncodingOrder; the data inside |
| | | ContentCompression and/or |
| | | ContentEncryption). This value SHOULD NOT |
| | | be used, as it's not supported by players. |
+-------+---------+--------------------------------------------+
Table 21: ContentEncodingScope Values
5.1.4.1.31.4. ContentEncodingType Element
id / type / default: 0x5033 / uinteger / 0
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncodingType
minOccurs / maxOccurs: 1 / 1
definition: A value describing the kind of transformation that is
applied.
defined values: See Table 22. Additional values can be registered
in the "Matroska Content Encoding Types" registry defined in
Section 27.6.
stream copy: True (Section 8)
+=======+=============+
| value | label |
+=======+=============+
| 0 | Compression |
+-------+-------------+
| 1 | Encryption |
+-------+-------------+
Table 22:
ContentEncodingType
Values
5.1.4.1.31.5. ContentCompression Element
id / type: 0x5034 / master
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentCompression
maxOccurs: 1
definition: Settings describing the compression used. This element
MUST be present if the value of ContentEncodingType is 0 and
absent otherwise. Each block MUST be decompressable, even if no
previous block is available in order to not prevent seeking.
stream copy: True (Section 8)
5.1.4.1.31.6. ContentCompAlgo Element
id / type / default: 0x4254 / uinteger / 0
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentCompression\ContentCompAlgo
minOccurs / maxOccurs: 1 / 1
definition: The compression algorithm used.
defined values: See Table 23. Additional values can be registered
in the "Matroska Compression Algorithms" registry defined in
Section 27.2.
usage notes: Compression method "1" (bzlib) and "2" (lzo1x) lack
proper documentation on the format, which limits implementation
possibilities. Due to licensing conflicts on commonly available
libraries' compression methods, "2" (lzo1x) does not offer
widespread interoperability. A Matroska Writer SHOULD NOT use
these compression methods by default. A Matroska Reader MAY
support methods "1" and "2" and SHOULD support other methods.
stream copy: True (Section 8)
+=======+===========+========================================+
| value | label | definition |
+=======+===========+========================================+
| 0 | zlib | zlib compression [RFC1950]. |
+-------+-----------+----------------------------------------+
| 1 | bzlib | bzip2 compression [BZIP2] SHOULD NOT |
| | | be used; see usage notes. |
+-------+-----------+----------------------------------------+
| 2 | lzo1x | Lempel-Ziv-Oberhumer compression [LZO] |
| | | SHOULD NOT be used; see usage notes. |
+-------+-----------+----------------------------------------+
| 3 | Header | Octets in ContentCompSettings |
| | Stripping | (Section 5.1.4.1.31.7) have been |
| | | stripped from each frame. |
+-------+-----------+----------------------------------------+
Table 23: ContentCompAlgo Values
5.1.4.1.31.7. ContentCompSettings Element
id / type: 0x4255 / binary
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentCompression\ContentCompSettings
maxOccurs: 1
definition: Settings that might be needed by the decompressor. For
Header Stripping (ContentCompAlgo=3), the bytes that were removed
from the beginning of each frame of the track.
stream copy: True (Section 8)
5.1.4.1.31.8. ContentEncryption Element
id / type: 0x5035 / master
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption
maxOccurs: 1
definition: Settings describing the encryption used. This element
MUST be present if the value of ContentEncodingType is 1
(encryption) and MUST be ignored otherwise. A Matroska Player MAY
support encryption.
stream copy: True (Section 8)
5.1.4.1.31.9. ContentEncAlgo Element
id / type / default: 0x47E1 / uinteger / 0
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption\ContentEncAlgo
minOccurs / maxOccurs: 1 / 1
definition: The encryption algorithm used.
defined values: See Table 24. Additional values can be registered
in the "Matroska Encryption Algorithms" registry defined in
Section 27.3.
stream copy: True (Section 8)
+=======+===========+============================================+
| value | label | definition |
+=======+===========+============================================+
| 0 | Not | The data are not encrypted. |
| | encrypted | |
+-------+-----------+--------------------------------------------+
| 1 | DES | Data Encryption Standard (DES) [FIPS46-3]. |
| | | This value SHOULD be avoided. |
+-------+-----------+--------------------------------------------+
| 2 | 3DES | Triple Data Encryption Algorithm |
| | | [SP800-67]. This value SHOULD be avoided. |
+-------+-----------+--------------------------------------------+
| 3 | Twofish | Twofish Encryption Algorithm [Twofish]. |
+-------+-----------+--------------------------------------------+
| 4 | Blowfish | Blowfish Encryption Algorithm [Blowfish]. |
| | | This value SHOULD be avoided. |
+-------+-----------+--------------------------------------------+
| 5 | AES | Advanced Encryption Standard (AES) |
| | | [FIPS197]. |
+-------+-----------+--------------------------------------------+
Table 24: ContentEncAlgo Values
5.1.4.1.31.10. ContentEncKeyID Element
id / type: 0x47E2 / binary
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption\ContentEncKeyID
maxOccurs: 1
definition: For public key algorithms, the ID of the public key that
the data was encrypted with.
stream copy: True (Section 8)
5.1.4.1.31.11. ContentEncAESSettings Element
id / type: 0x47E7 / master
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption\ContentEncAESSettings
maxOccurs: 1
minver: 4
definition: Settings describing the encryption algorithm used.
notes: See Table 25.
stream copy: True (Section 8)
+===========+=================================================+
| attribute | note |
+===========+=================================================+
| maxOccurs | ContentEncAESSettings MUST NOT be set |
| | (maxOccurs=0) if ContentEncAlgo is not AES (5). |
+-----------+-------------------------------------------------+
Table 25: ContentEncAESSettings Implementation Notes
5.1.4.1.31.12. AESSettingsCipherMode Element
id / type: 0x47E8 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption\ContentEncAESSettings\AESSettingsCipherMode
minOccurs / maxOccurs: 1 / 1
minver: 4
definition: The AES cipher mode used in the encryption.
defined values: See Table 26. Additional values can be registered
in the "Matroska AES Cipher Modes" registry defined in
Section 27.4.
notes: See Table 27.
stream copy: True (Section 8)
+=======+=========+===================================+
| value | label | definition |
+=======+=========+===================================+
| 1 | AES-CTR | Counter [SP800-38A] |
+-------+---------+-----------------------------------+
| 2 | AES-CBC | Cipher Block Chaining [SP800-38A] |
+-------+---------+-----------------------------------+
Table 26: AESSettingsCipherMode Values
+===========+=================================================+
| attribute | note |
+===========+=================================================+
| maxOccurs | AESSettingsCipherMode MUST NOT be set |
| | (maxOccurs=0) if ContentEncAlgo is not AES (5). |
+-----------+-------------------------------------------------+
Table 27: AESSettingsCipherMode Implementation Notes
5.1.5. Cues Element
id / type: 0x1C53BB6B / master
path: \Segment\Cues
minOccurs / maxOccurs: See Table 28 / 1
definition: A Top-Level Element to speed seeking access. All
entries are local to the Segment.
notes: See Table 28.
+===========+====================================================+
| attribute | note |
+===========+====================================================+
| minOccurs | This element SHOULD be set when the Segment is not |
| | transmitted as a live stream; see Section 23.2. |
+-----------+----------------------------------------------------+
Table 28: Cues Implementation Notes
5.1.5.1. CuePoint Element
id / type: 0xBB / master
path: \Segment\Cues\CuePoint
minOccurs: 1
definition: Contains all information relative to a seek point in the
Segment.
5.1.5.1.1. CueTime Element
id / type: 0xB3 / uinteger
path: \Segment\Cues\CuePoint\CueTime
minOccurs / maxOccurs: 1 / 1
definition: Absolute timestamp of the seek point, expressed in
Segment Ticks, which are based on TimestampScale; see
Section 11.1.
5.1.5.1.2. CueTrackPositions Element
id / type: 0xB7 / master
path: \Segment\Cues\CuePoint\CueTrackPositions
minOccurs: 1
definition: Contains positions for different tracks corresponding to
the timestamp.
5.1.5.1.2.1. CueTrack Element
id / type: 0xF7 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Cues\CuePoint\CueTrackPositions\CueTrack
minOccurs / maxOccurs: 1 / 1
definition: The track for which a position is given.
5.1.5.1.2.2. CueClusterPosition Element
id / type: 0xF1 / uinteger
path: \Segment\Cues\CuePoint\CueTrackPositions\CueClusterPosition
minOccurs / maxOccurs: 1 / 1
definition: The Segment Position (Section 16) of the Cluster
containing the associated Block.
5.1.5.1.2.3. CueRelativePosition Element
id / type: 0xF0 / uinteger
path: \Segment\Cues\CuePoint\CueTrackPositions\CueRelativePosition
maxOccurs: 1
minver: 4
definition: The relative position inside the Cluster of the
referenced SimpleBlock or BlockGroup with 0 being the first
possible position for an element inside that Cluster.
5.1.5.1.2.4. CueDuration Element
id / type: 0xB2 / uinteger
path: \Segment\Cues\CuePoint\CueTrackPositions\CueDuration
maxOccurs: 1
minver: 4
definition: The duration of the block, expressed in Segment Ticks,
which are based on TimestampScale; see Section 11.1. If missing,
the track's DefaultDuration does not apply and no duration
information is available in terms of the cues.
5.1.5.1.2.5. CueBlockNumber Element
id / type: 0x5378 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Cues\CuePoint\CueTrackPositions\CueBlockNumber
maxOccurs: 1
definition: Number of the Block in the specified Cluster.
5.1.5.1.2.6. CueCodecState Element
id / type / default: 0xEA / uinteger / 0
path: \Segment\Cues\CuePoint\CueTrackPositions\CueCodecState
minOccurs / maxOccurs: 1 / 1
minver: 2
definition: The Segment Position (Section 16) of the Codec State
corresponding to this Cues element. 0 means that the data is taken
from the initial TrackEntry.
5.1.5.1.2.7. CueReference Element
id / type: 0xDB / master
path: \Segment\Cues\CuePoint\CueTrackPositions\CueReference
minver: 2
definition: The Clusters containing the referenced Blocks.
5.1.5.1.2.8. CueRefTime Element
id / type: 0x96 / uinteger
path: \Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefTi
me
minOccurs / maxOccurs: 1 / 1
minver: 2
definition: Timestamp of the referenced Block, expressed in Segment
Ticks which is based on TimestampScale; see Section 11.1.
5.1.6. Attachments Element
id / type: 0x1941A469 / master
path: \Segment\Attachments
maxOccurs: 1
definition: Contains attached files.
5.1.6.1. AttachedFile Element
id / type: 0x61A7 / master
path: \Segment\Attachments\AttachedFile
minOccurs: 1
definition: An attached file.
5.1.6.1.1. FileDescription Element
id / type: 0x467E / utf-8
path: \Segment\Attachments\AttachedFile\FileDescription
maxOccurs: 1
definition: A human-friendly name for the attached file.
5.1.6.1.2. FileName Element
id / type: 0x466E / utf-8
path: \Segment\Attachments\AttachedFile\FileName
minOccurs / maxOccurs: 1 / 1
definition: Filename of the attached file.
5.1.6.1.3. FileMediaType Element
id / type: 0x4660 / string
path: \Segment\Attachments\AttachedFile\FileMediaType
minOccurs / maxOccurs: 1 / 1
definition: Media type of the file following the format described in
[RFC6838].
stream copy: True (Section 8)
5.1.6.1.4. FileData Element
id / type: 0x465C / binary
path: \Segment\Attachments\AttachedFile\FileData
minOccurs / maxOccurs: 1 / 1
definition: The data of the file.
stream copy: True (Section 8)
5.1.6.1.5. FileUID Element
id / type: 0x46AE / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Attachments\AttachedFile\FileUID
minOccurs / maxOccurs: 1 / 1
definition: UID representing the file, as random as possible.
stream copy: True (Section 8)
5.1.7. Chapters Element
id / type: 0x1043A770 / master
path: \Segment\Chapters
maxOccurs: 1
recurring: True
definition: A system to define basic menus and partition data. For
more detailed information, see Section 20.
5.1.7.1. EditionEntry Element
id / type: 0x45B9 / master
path: \Segment\Chapters\EditionEntry
minOccurs: 1
definition: Contains all information about a Segment edition.
5.1.7.1.1. EditionUID Element
id / type: 0x45BC / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Chapters\EditionEntry\EditionUID
maxOccurs: 1
definition: A UID that identifies the edition. It's useful for
tagging an edition.
stream copy: True (Section 8)
5.1.7.1.2. EditionFlagDefault Element
id / type / default: 0x45DB / uinteger / 0
range: 0-1
path: \Segment\Chapters\EditionEntry\EditionFlagDefault
minOccurs / maxOccurs: 1 / 1
definition: Set to 1 if the edition SHOULD be used as the default
one.
5.1.7.1.3. EditionFlagOrdered Element
id / type / default: 0x45DD / uinteger / 0
range: 0-1
path: \Segment\Chapters\EditionEntry\EditionFlagOrdered
minOccurs / maxOccurs: 1 / 1
definition: Set to 1 if the chapters can be defined multiple times
and the order to play them is enforced; see Section 20.1.3.
5.1.7.1.4. ChapterAtom Element
id / type: 0xB6 / master
path: \Segment\Chapters\EditionEntry\+ChapterAtom
minOccurs: 1
recursive: True
definition: Contains the atom information to use as the chapter atom
(applies to all tracks).
5.1.7.1.4.1. ChapterUID Element
id / type: 0x73C4 / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterUID
minOccurs / maxOccurs: 1 / 1
definition: A UID that identifies the Chapter.
stream copy: True (Section 8)
5.1.7.1.4.2. ChapterStringUID Element
id / type: 0x5654 / utf-8
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterStringUID
maxOccurs: 1
minver: 3
definition: A unique string ID that identifies the Chapter. For
example, it is used as the storage for cue identifier values
[WebVTT].
5.1.7.1.4.3. ChapterTimeStart Element
id / type: 0x91 / uinteger
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTimeStart
minOccurs / maxOccurs: 1 / 1
definition: Timestamp of the start of Chapter, expressed in Matroska
Ticks -- i.e., in nanoseconds; see Section 11.1.
5.1.7.1.4.4. ChapterTimeEnd Element
id / type: 0x92 / uinteger
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTimeEnd
minOccurs / maxOccurs: See Table 29 / 1
definition: Timestamp of the end of Chapter (timestamp excluded),
expressed in Matroska Ticks -- i.e., in nanoseconds; see
Section 11.1. The value MUST be greater than or equal to the
ChapterTimeStart of the same ChapterAtom.
usage notes: With the ChapterTimeEnd timestamp value being excluded,
it MUST take into account the duration of the last frame it
includes, especially for the ChapterAtom using the last frames of
the Segment.
notes: See Table 29.
+===========+====================================================+
| attribute | note |
+===========+====================================================+
| minOccurs | ChapterTimeEnd MUST be set (minOccurs=1) if the |
| | Edition is an ordered edition; see Section 20.1.3. |
| | If it's a Parent Chapter, see Section 20.2.3. |
+-----------+----------------------------------------------------+
Table 29: ChapterTimeEnd Implementation Notes
5.1.7.1.4.5. ChapterFlagHidden Element
id / type / default: 0x98 / uinteger / 0
range: 0-1
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterFlagHidden
minOccurs / maxOccurs: 1 / 1
definition: Set to 1 if a chapter is hidden. Hidden chapters SHOULD
NOT be available to the user interface (but still be available to
Control Tracks; see Section 20.2.5 on Chapter flags).
5.1.7.1.4.6. ChapterSegmentUUID Element
id / type: 0x6E67 / binary
length: 16
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterSegmentUUID
minOccurs / maxOccurs: See Table 30 / 1
definition: The SegmentUUID of another Segment to play during this
chapter.
usage notes: The value MUST NOT be the SegmentUUID value of the
Segment it belongs to.
notes: See Table 30.
+===========+==============================================+
| attribute | note |
+===========+==============================================+
| minOccurs | ChapterSegmentUUID MUST be set (minOccurs=1) |
| | if ChapterSegmentEditionUID is used; see |
| | Section 17.2 on Medium-Linking Segments. |
+-----------+----------------------------------------------+
Table 30: ChapterSegmentUUID Implementation Notes
5.1.7.1.4.7. ChapterSegmentEditionUID Element
id / type: 0x6EBC / uinteger
range: not 0 (1-18446744073709551615)
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterSegmentEdit
ionUID
maxOccurs: 1
definition: The EditionUID to play from the Segment linked in
ChapterSegmentUUID. If ChapterSegmentEditionUID is undeclared,
then no Edition of the Linked Segment is used; see Section 17.2 on
Medium-Linking Segments.
5.1.7.1.4.8. ChapterPhysicalEquiv Element
id / type: 0x63C3 / uinteger
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterPhysicalEqu
iv
maxOccurs: 1
definition: Specifies the physical equivalent of this ChapterAtom,
e.g., "DVD" (60) or "SIDE" (50); see Section 20.4 for a complete
list of values.
5.1.7.1.4.9. ChapterDisplay Element
id / type: 0x80 / master
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay
definition: Contains all possible strings to use for the chapter
display.
5.1.7.1.4.10. ChapString Element
id / type: 0x85 / utf-8
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\Cha
pString
minOccurs / maxOccurs: 1 / 1
definition: Contains the string to use as the chapter atom.
5.1.7.1.4.11. ChapLanguage Element
id / type / default: 0x437C / string / eng
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\Cha
pLanguage
minOccurs: 1
definition: A language corresponding to the string, in the Matroska
languages form; see Section 12 on language codes. This element
MUST be ignored if a ChapLanguageBCP47 element is used within the
same ChapterDisplay element.
5.1.7.1.4.12. ChapLanguageBCP47 Element
id / type: 0x437D / string
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\Cha
pLanguageBCP47
minver: 4
definition: A language corresponding to the ChapString, in the form
defined in [RFC5646]; see Section 12 on language codes. If a
ChapLanguageBCP47 element is used, then any ChapLanguage and
ChapCountry elements used in the same ChapterDisplay MUST be
ignored.
5.1.7.1.4.13. ChapCountry Element
id / type: 0x437E / string
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\Cha
pCountry
definition: A country corresponding to the string, in the Matroska
countries form; see Section 13 on country codes. This element
MUST be ignored if a ChapLanguageBCP47 element is used within the
same ChapterDisplay element.
5.1.7.1.4.14. ChapProcess Element
id / type: 0x6944 / master
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess
definition: Contains all the commands associated with the Atom.
5.1.7.1.4.15. ChapProcessCodecID Element
id / type / default: 0x6955 / uinteger / 0
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapPr
ocessCodecID
minOccurs / maxOccurs: 1 / 1
definition: Contains the type of the codec used for processing.
defined values: See Table 31. Additional values can be registered
in the "Matroska Chapter Codec IDs" registry defined in
Section 27.14.
+=======+=================+============================+
| value | label | definition |
+=======+=================+============================+
| 0 | Matroska Script | Chapter commands using the |
| | | Matroska Script codec. |
+-------+-----------------+----------------------------+
| 1 | DVD-menu | Chapter commands using the |
| | | DVD-like codec. |
+-------+-----------------+----------------------------+
Table 31: ChapProcessCodecID Values
5.1.7.1.4.16. ChapProcessPrivate Element
id / type: 0x450D / binary
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapPr
ocessPrivate
maxOccurs: 1
definition: Optional data attached to the ChapProcessCodecID
information. For ChapProcessCodecID = 1, it is the "DVD level"
equivalent; see Section 20.3 on DVD menus.
5.1.7.1.4.17. ChapProcessCommand Element
id / type: 0x6911 / master
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapPr
ocessCommand
definition: Contains all the commands associated with the Atom.
5.1.7.1.4.18. ChapProcessTime Element
id / type: 0x6922 / uinteger
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapPr
ocessCommand\ChapProcessTime
minOccurs / maxOccurs: 1 / 1
definition: Defines when the process command SHOULD be handled.
restrictions: See Table 32.
+=======+===============================+
| value | label |
+=======+===============================+
| 0 | during the whole chapter |
+-------+-------------------------------+
| 1 | before starting playback |
+-------+-------------------------------+
| 2 | after playback of the chapter |
+-------+-------------------------------+
Table 32: ChapProcessTime Values
5.1.7.1.4.19. ChapProcessData Element
id / type: 0x6933 / binary
path: \Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapPr
ocessCommand\ChapProcessData
minOccurs / maxOccurs: 1 / 1
definition: Contains the command information. The data SHOULD be
interpreted depending on the ChapProcessCodecID value. For
ChapProcessCodecID = 1, the data correspond to the binary DVD cell
pre/post commands; see Section 20.3 on DVD menus.
5.1.8. Tags Element
id / type: 0x1254C367 / master
path: \Segment\Tags
definition: Element containing metadata describing Tracks, Editions,
Chapters, Attachments, or the Segment as a whole. A list of valid
tags can be found in [MatroskaTags].
5.1.8.1. Tag Element
id / type: 0x7373 / master
path: \Segment\Tags\Tag
minOccurs: 1
definition: A single metadata descriptor.
5.1.8.1.1. Targets Element
id / type: 0x63C0 / master
path: \Segment\Tags\Tag\Targets
minOccurs / maxOccurs: 1 / 1
definition: Specifies which other elements the metadata represented
by the tag value applies to. If empty or omitted, then the tag
value describes everything in the Segment.
5.1.8.1.1.1. TargetTypeValue Element
id / type / default: 0x68CA / uinteger / 50
range: not 0 (1-18446744073709551615)
path: \Segment\Tags\Tag\Targets\TargetTypeValue
minOccurs / maxOccurs: 1 / 1
definition: A number to indicate the logical level of the target.
defined values: See Table 33. Additional values can be registered
in the "Matroska Tags Target Types" registry defined in
Section 27.13.
usage notes: The TargetTypeValue values are meant to be compared.
Higher values MUST correspond to a logical level that contains the
lower logical level TargetTypeValue values.
+=======+==========================+================================+
| value | label | definition |
+=======+==========================+================================+
| 70 | COLLECTION | The highest hierarchical level |
| | | that tags can describe. |
+-------+--------------------------+--------------------------------+
| 60 | EDITION / ISSUE / | A list of lower levels grouped |
| | VOLUME / OPUS / | together. |
| | SEASON / SEQUEL | |
+-------+--------------------------+--------------------------------+
| 50 | ALBUM / OPERA / | The most common grouping level |
| | CONCERT / MOVIE / | of music and video (e.g., an |
| | EPISODE | episode for TV series). |
+-------+--------------------------+--------------------------------+
| 40 | PART / SESSION | When an album or episode has |
| | | different logical parts. |
+-------+--------------------------+--------------------------------+
| 30 | TRACK / SONG / | The common parts of an album |
| | CHAPTER | or movie. |
+-------+--------------------------+--------------------------------+
| 20 | SUBTRACK / | Corresponds to parts of a |
| | MOVEMENT / SCENE | track for audio, such as a |
| | | movement or scene in a movie. |
+-------+--------------------------+--------------------------------+
| 10 | SHOT | The lowest hierarchy found in |
| | | music or movies. |
+-------+--------------------------+--------------------------------+
Table 33: TargetTypeValue Values
5.1.8.1.1.2. TargetType Element
id / type: 0x63CA / string
path: \Segment\Tags\Tag\Targets\TargetType
maxOccurs: 1
definition: An informational string that can be used to display the
logical level of the target, such as "ALBUM", "TRACK", "MOVIE",
"CHAPTER", etc.
restrictions: See Table 34.
+============+====================+
| value | label |
+============+====================+
| COLLECTION | TargetTypeValue 70 |
+------------+--------------------+
| EDITION | TargetTypeValue 60 |
+------------+--------------------+
| ISSUE | TargetTypeValue 60 |
+------------+--------------------+
| VOLUME | TargetTypeValue 60 |
+------------+--------------------+
| OPUS | TargetTypeValue 60 |
+------------+--------------------+
| SEASON | TargetTypeValue 60 |
+------------+--------------------+
| SEQUEL | TargetTypeValue 60 |
+------------+--------------------+
| ALBUM | TargetTypeValue 50 |
+------------+--------------------+
| OPERA | TargetTypeValue 50 |
+------------+--------------------+
| CONCERT | TargetTypeValue 50 |
+------------+--------------------+
| MOVIE | TargetTypeValue 50 |
+------------+--------------------+
| EPISODE | TargetTypeValue 50 |
+------------+--------------------+
| PART | TargetTypeValue 40 |
+------------+--------------------+
| SESSION | TargetTypeValue 40 |
+------------+--------------------+
| TRACK | TargetTypeValue 30 |
+------------+--------------------+
| SONG | TargetTypeValue 30 |
+------------+--------------------+
| CHAPTER | TargetTypeValue 30 |
+------------+--------------------+
| SUBTRACK | TargetTypeValue 20 |
+------------+--------------------+
| MOVEMENT | TargetTypeValue 20 |
+------------+--------------------+
| SCENE | TargetTypeValue 20 |
+------------+--------------------+
| SHOT | TargetTypeValue 10 |
+------------+--------------------+
Table 34: TargetType Values
5.1.8.1.1.3. TagTrackUID Element
id / type / default: 0x63C5 / uinteger / 0
path: \Segment\Tags\Tag\Targets\TagTrackUID
definition: A UID that identifies the Track(s) that the tags belong
to.
usage notes: If the value is 0 at this level, the tags apply to all
tracks in the Segment. If set to any other value, it MUST match
the TrackUID value of a track found in this Segment.
5.1.8.1.1.4. TagEditionUID Element
id / type / default: 0x63C9 / uinteger / 0
path: \Segment\Tags\Tag\Targets\TagEditionUID
definition: A UID that identifies the EditionEntry(s) that the tags
belong to.
usage notes: If the value is 0 at this level, the tags apply to all
editions in the Segment. If set to any other value, it MUST match
the EditionUID value of an edition found in this Segment.
5.1.8.1.1.5. TagChapterUID Element
id / type / default: 0x63C4 / uinteger / 0
path: \Segment\Tags\Tag\Targets\TagChapterUID
definition: A UID that identifies the Chapter(s) that the tags
belong to.
usage notes: If the value is 0 at this level, the tags apply to all
chapters in the Segment. If set to any other value, it MUST match
the ChapterUID value of a chapter found in this Segment.
5.1.8.1.1.6. TagAttachmentUID Element
id / type / default: 0x63C6 / uinteger / 0
path: \Segment\Tags\Tag\Targets\TagAttachmentUID
definition: A UID that identifies the Attachment(s) that the tags
belong to.
usage notes: If the value is 0 at this level, the tags apply to all
the attachments in the Segment. If set to any other value, it
MUST match the FileUID value of an attachment found in this
Segment.
5.1.8.1.2. SimpleTag Element
id / type: 0x67C8 / master
path: \Segment\Tags\Tag\+SimpleTag
minOccurs: 1
recursive: True
definition: Contains general information about the target.
5.1.8.1.2.1. TagName Element
id / type: 0x45A3 / utf-8
path: \Segment\Tags\Tag\+SimpleTag\TagName
minOccurs / maxOccurs: 1 / 1
definition: The name of the tag value that is going to be stored.
5.1.8.1.2.2. TagLanguage Element
id / type / default: 0x447A / string / und
path: \Segment\Tags\Tag\+SimpleTag\TagLanguage
minOccurs / maxOccurs: 1 / 1
definition: Specifies the language of the specified tag in the
Matroska languages form; see Section 12 on language codes. This
element MUST be ignored if the TagLanguageBCP47 element is used
within the same SimpleTag element.
5.1.8.1.2.3. TagLanguageBCP47 Element
id / type: 0x447B / string
path: \Segment\Tags\Tag\+SimpleTag\TagLanguageBCP47
maxOccurs: 1
minver: 4
definition: The language used in the TagString, in the form defined
in [RFC5646]; see Section 12 on language codes. If this element
is used, then any TagLanguage elements used in the same SimpleTag
MUST be ignored.
5.1.8.1.2.4. TagDefault Element
id / type / default: 0x4484 / uinteger / 1
range: 0-1
path: \Segment\Tags\Tag\+SimpleTag\TagDefault
minOccurs / maxOccurs: 1 / 1
definition: A boolean value to indicate if this is the default/
original language to use for the given tag.
5.1.8.1.2.5. TagString Element
id / type: 0x4487 / utf-8
path: \Segment\Tags\Tag\+SimpleTag\TagString
maxOccurs: 1
definition: The tag value.
5.1.8.1.2.6. TagBinary Element
id / type: 0x4485 / binary
path: \Segment\Tags\Tag\+SimpleTag\TagBinary
maxOccurs: 1
definition: The tag value if it is binary. Note that this cannot be
used in the same SimpleTag as TagString.
6. Matroska Element Ordering
With the exceptions of the EBML Header and the CRC-32 element, the
EBML specification [RFC8794] does not require any particular storage
order for elements. However, this specification defines mandates and
recommendations for ordering certain elements to facilitate better
playback, seeking, and editing efficiency. This section describes
and offers rationale for ordering requirements and recommendations
for Matroska.
6.1. Top-Level Elements
The Info element is the only REQUIRED Top-Level Element in a Matroska
file. To be playable, Matroska MUST also contain at least one Tracks
element and Cluster element. The first Info element and the first
Tracks element either MUST be stored before the first Cluster element
or SHALL both be referenced by a SeekHead element occurring before
the first Cluster element.
All Top-Level Elements MUST use a 4-octet EBML Element ID.
When using Medium Linking, chapters are used to reference other
Segments to play in a given order (see Section 17.2). A Segment
containing these Linked Chapters does not require a Tracks element or
a Cluster element.
It is possible to edit a Matroska file after it has been created.
For example, chapters, tags, or attachments can be added. When new
Top-Level Elements are added to a Matroska file, the SeekHead
element(s) MUST be updated so that the SeekHead element(s) itemizes
the identity and position of all Top-Level Elements.
Editing, removing, or adding elements to a Matroska file often
requires that some existing elements be voided or extended.
Transforming the existing elements into Void elements as padding can
be used as a method to avoid moving large amounts of data around.
6.2. CRC-32
As noted by the EBML specification [RFC8794], if a CRC-32 element is
used, then the CRC-32 element MUST be the first ordered element
within its Parent Element.
In Matroska, all Top-Level Elements of an EBML Document SHOULD
include a CRC-32 element as their first Child Element. The Segment
element, which is the Root Element, SHOULD NOT have a CRC-32 element.
6.3. SeekHead
If used, the first SeekHead element MUST be the first non-CRC-32
Child element of the Segment element. If a second SeekHead element
is used, then the first SeekHead element MUST reference the identity
and position of the second SeekHead element.
Additionally, the second SeekHead element MUST only reference Cluster
elements and not any other Top-Level Element already contained within
the first SeekHead element.
The second SeekHead element MAY be stored in any order relative to
the other Top-Level Elements. Whether one or two SeekHead elements
are used, the SeekHead element(s) MUST collectively reference the
identity and position of all Top-Level Elements except for the first
SeekHead element.
6.4. Cues (Index)
The Cues element is RECOMMENDED to optimize seeking access in
Matroska. It is programmatically simpler to add the Cues element
after all Cluster elements have been written because this does not
require a prediction of how much space to reserve before writing the
Cluster elements. However, storing the Cues element before the
Cluster elements can provide some seeking advantages. If the Cues
element is present, then it SHOULD either be stored before the first
Cluster element or be referenced by a SeekHead element.
6.5. Info
The first Info element SHOULD occur before the first Tracks element
and first Cluster element except when referenced by a SeekHead
element.
6.6. Chapters Element
The Chapters element SHOULD be placed before the Cluster element(s).
The Chapters element can be used during playback even if the user
does not need to seek. It immediately gives the user information
about what section is being read and what other sections are
available.
In the case of Ordered Chapters, it is RECOMMENDED to evaluate the
logical linking before playing. The Chapters element SHOULD be
placed before the first Tracks element and after the first Info
element.
6.7. Attachments
The Attachments element is not intended to be used by default when
playing the file but could contain information relevant to the
content, such as cover art or fonts. Cover art is useful even before
the file is played, and fonts could be needed before playback starts
for the initialization of subtitles. The Attachments element MAY be
placed before the first Cluster element; however, if the Attachments
element is likely to be edited, then it SHOULD be placed after the
last Cluster element.
6.8. Tags
The Tags element is most subject to changes after the file was
originally created. For easier editing, the Tags element can be
placed at the end of the Segment element, even after the Attachments
element. On the other hand, it is inconvenient to have to seek in
the Segment for tags, especially for network streams; thus, it's
better if the Tags element is found early in the stream. When
editing the Tags element, the original Tags element at the beginning
can be overwritten with a Void element and a new Tags element written
at the end of the Segment element. The file and Segment sizes will
only marginally change.
7. Matroska Versioning
Matroska is based on the principle that a reading application does
not have to support 100% of the specifications in order to be able to
play the file. Therefore, a Matroska file contains version
indicators that tell a reading application what to expect.
It is possible and valid to have the version fields indicate that the
file contains Matroska elements from a higher specification version
number while signaling that a reading application MUST only support a
lower version number properly in order to play it back (possibly with
a reduced feature set).
The EBML Header of each Matroska document informs the reading
application on what version of Matroska to expect. The elements
within the EBML Header with jurisdiction over this information are
DocTypeVersion and DocTypeReadVersion.
DocTypeVersion MUST be equal to or greater than the highest Matroska
version number of any element present in the Matroska file. For
example, a file using the SimpleBlock element (Section 5.1.3.4) MUST
have a DocTypeVersion equal to or greater than 2. A file containing
CueRelativePosition elements (Section 5.1.5.1.2.3) MUST have a
DocTypeVersion equal to or greater than 4.
The DocTypeReadVersion MUST contain the minimum version number that a
reading application can minimally support in order to play the file
back -- optionally with a reduced feature set. For example, if a
file contains only elements of version 2 or lower except for
CueRelativePosition (which is a version 4 Matroska element), then
DocTypeReadVersion SHOULD still be set to 2 and not 4 because
evaluating CueRelativePosition is not necessary for standard playback
-- it makes seeking more precise if used.
A reading application supporting Matroska version V MUST NOT refuse
to read a file with DocReadTypeVersion equal to or lower than V, even
if DocTypeVersion is greater than V.
A reading application supporting at least Matroska version V and
reading a file whose DocTypeReadVersion field is equal to or lower
than V MUST skip Matroska/EBML elements it encounters but does not
know about if that unknown element fits into the size constraints set
by the current Parent Element.
8. Stream Copy
It is sometimes necessary to create a Matroska file from another
Matroska file, for example, to add subtitles in a language or to edit
out a portion of the content. Some values from the original Matroska
file need to be kept the same in the destination file. For example,
the SamplingFrequency of an audio track wouldn't change between the
two files. Some other values may change between the two files, for
example, the TrackNumber of an audio track when another track has
been added.
An element is marked with a property "stream copy: True" when the
values of that element need to be kept identical between the source
and destination files. If that property is not set, elements may or
may not keep the same value between the source and destination files.
9. DefaultDecodedFieldDuration
The DefaultDecodedFieldDuration element can signal to the displaying
application how often fields of a video sequence will be available
for displaying. It can be used for both interlaced and progressive
content.
If the video sequence is signaled as interlaced
(Section 5.1.4.1.28.1), then DefaultDecodedFieldDuration equals the
period between two successive fields at the output of the decoding
process. For video sequences signaled as progressive,
DefaultDecodedFieldDuration is half of the period between two
successive frames at the output of the decoding process.
These values are valid at the end of the decoding process before
post-processing (such as deinterlacing or inverse telecine) is
applied.
Examples:
* Blu-ray movie: 1000000000 ns/(48/1.001) = 20854167 ns
* PAL broadcast/DVD: 1000000000 ns/(50/1.000) = 20000000 ns
* N/ATSC broadcast: 1000000000 ns/(60/1.001) = 16683333 ns
* Hard-telecined DVD: 1000000000 ns/(60/1.001) = 16683333 ns (60
encoded interlaced fields per second)
* Soft-telecined DVD: 1000000000 ns/(60/1.001) = 16683333 ns (48
encoded interlaced fields per second, with "repeat_first_field =
1")
10. Cluster Blocks
Frames using references SHOULD be stored in "coding order" (i.e., the
references first and then the frames referencing them). A
consequence is that timestamps might not be consecutive. However, a
frame with a past timestamp MUST reference a frame already known;
otherwise, it is considered bad/void.
Matroska has two similar ways to store frames in a block:
* in a Block that is contained inside a BlockGroup
* in a SimpleBlock that is directly in the Cluster
The SimpleBlock is usually preferred unless some extra elements of
the BlockGroup need to be used. A Matroska Reader MUST support both
types of blocks.
Each block contains the same parts in the following order:
* a variable-length header
* the lacing information (optional)
* the consecutive frame(s)
The block header starts with the number of the Track it corresponds
to. The value MUST correspond to the TrackNumber (Section 5.1.4.1.1)
of a TrackEntry of the Segment.
The TrackNumber is coded using the Variable-Size Integer (VINT)
mechanism described in Section 4 of [RFC8794]. To save space, the
shortest VINT form SHOULD be used. The value can be coded using up
to 8 octets. This is the only element with a variable size in the
block header.
The timestamp is expressed in Track Ticks; see Section 11.1. The
value is stored as a signed value on 16 bits.
10.1. Block Structure
This section describes the binary data contained in the Block element
(Section 5.1.3.5.1). Bit 0 is the most significant bit.
As the TrackNumber size can vary between 1 and 8 octets, there are 8
different sizes for the Block header. The definitions for
TrackNumber sizes of 1 and 2 are provided; the other variants can be
deduced by extending the size of the TrackNumber by multiples of 8
bits.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |I|LAC|U|
| Track Number | Timestamp | Rsvrd |N|ING|N|
| | | |V| |U|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 11: Block Header with 1-Octet TrackNumber
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Track Number | Timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |I|LAC|U|
| Rsvrd |N|ING|N| ...
| |V| |U|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 12: Block Header with 2-Octet TrackNumber
where:
Track Number: 8, 16, 24, 32, 40, 48, or 56 bits. An EBML VINT-coded
track number.
Timestamp: 16 bits. Signed timestamp in Track Ticks.
Rsvrd: 4 bits. Reserved bits MUST be set to 0.
INV: 1 bit. Invisible; The codec SHOULD decode this frame but not
display it.
LACING: 2 bits. Uses lacing mode.
00b: no lacing (Section 10.3.1)
01b: Xiph lacing (Section 10.3.2)
11b: EBML lacing (Section 10.3.3)
10b: fixed-size lacing (Section 10.3.4)
UNU: 1 bit. Unused bit.
The remaining data in the Block corresponds to the lacing data and
frames usage as described in each respective lacing mode (see
Section 10.3).
10.2. SimpleBlock Structure
This section describes the binary data contained in the SimpleBlock
element (Section 5.1.3.4). Bit 0 is the most significant bit.
The SimpleBlock structure is inspired by the Block structure; see
Section 10.1. The main differences are the added Keyframe flag and
Discardable flag. Otherwise, everything is the same.
As the TrackNumber size can vary between 1 and 8 octets, there are 8
different sizes for the SimpleBlock header. The definitions for
TrackNumber sizes of 1 and 2 are provided; the other variants can be
deduced by extending the size of the TrackNumber by multiples of 8
bits.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | |K| |I|LAC|D|
| Track Number | Timestamp |E|Rsvrd|N|ING|I|
| | |Y| |V| |S|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 13: SimpleBlock Header with 1-Octet TrackNumber
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Track Number | Timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|K| |I|LAC|D|
|E|Rsvrd|N|ING|I| ...
|Y| |V| |S|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 14: SimpleBlock Header with 2-Octet TrackNumber
where:
Track Number: 8, 16, 24, 32, 40, 48, or 56 bits. An EBML VINT-coded
track number.
Timestamp: 16 bits. Signed timestamp in Track Ticks.
KEY: 1 bit. Keyframe; Set when the Block contains only keyframes.
Rsvrd: 3 bits. Reserved bits MUST be set to 0.
INV: 1 bit. Invisible; the codec SHOULD decode this frame but not
display it.
LACING: 2 bits. Uses lacing mode.
00b: no lacing (Section 10.3.1)
01b: Xiph lacing (Section 10.3.2)
11b: EBML lacing (Section 10.3.3)
10b: fixed-size lacing (Section 10.3.4)
DIS: 1 bit. Discardable; The frames of the Block can be discarded
during playing if needed.
The remaining data in the SimpleBlock corresponds to the lacing data
and frames usage as described in each respective lacing mode (see
Section 10.3).
10.3. Block Lacing
Lacing is a mechanism to save space when storing data. It is
typically used for small blocks of data (referred to as frames in
Matroska). It packs multiple frames into a single Block or
SimpleBlock.
Lacing MUST NOT be used to store a single frame in a Block or
SimpleBlock.
There are three types of lacing:
* Xiph, which is inspired by what is found in the Ogg container
[RFC3533]
* EBML, which is the same with sizes coded differently
* Fixed-size, where the size is not coded
When lacing is not used, i.e., to store a single frame, the lacing
bits (bits 5 and 6) of the Block or SimpleBlock MUST be set to zero.
For example, a user wants to store three frames of the same track.
The first frame is 800 octets long, the second is 500 octets long,
and the third is 1000 octets long. Because these frames are small,
they can be stored in a lace to save space.
It is possible to not use lacing at all and just store a single frame
without any extra data. When the FlagLacing (Section 5.1.4.1.12) is
set to 0, all blocks of that track MUST NOT use lacing.
10.3.1. No Lacing
When no lacing is used, the number of frames in the lace is omitted,
and only one frame can be stored in the Block. The LACING bits of
the Block Header flags are set to 00b.
The Block for an 800-octet frame is as follows:
+=============+=========+===================+
| Block Octet | Value | Description |
+=============+=========+===================+
| 4-803 | <frame> | Single frame data |
+-------------+---------+-------------------+
Table 35: No Lacing
When a Block contains a single frame, it MUST use this "no lacing"
mode.
10.3.2. Xiph Lacing
The Xiph lacing uses the same coding of size as found in the Ogg
container [RFC3533]. The LACING bits of the Block Header flags are
set to 01b.
The Block data with laced frames is stored as follows:
* Lacing Head on 1 Octet: Number of frames in the lace minus 1.
* Lacing size of each frame except the last one.
* Binary data of each frame consecutively.
The lacing size is split into 255 values, stored as unsigned octets
-- for example, 500 is coded 255;245 or [0xFF 0xF5]. A frame with a
size multiple of 255 is coded with a 0 at the end of the size -- for
example, 765 is coded 255;255;255;0 or [0xFF 0xFF 0xFF 0x00].
The size of the last frame is deduced from the size remaining in the
Block after the other frames.
Because large sizes result in large coding of the sizes, it is
RECOMMENDED to use Xiph lacing only with small frames.
In our example, the 800-, 500-, and 1000-octet frames are stored with
Xiph lacing in a Block as follows:
+==============+=====================+==========================+
| Block Octets | Value | Description |
+==============+=====================+==========================+
| 4 | 0x02 | Number of frames minus 1 |
+--------------+---------------------+--------------------------+
| 5-8 | 0xFF 0xFF 0xFF 0x23 | Size of the first frame |
| | | (255;255;255;35) |
+--------------+---------------------+--------------------------+
| 9-10 | 0xFF 0xF5 | Size of the second frame |
| | | (255;245) |
+--------------+---------------------+--------------------------+
| 11-810 | | First frame data |
+--------------+---------------------+--------------------------+
| 811-1310 | | Second frame data |
+--------------+---------------------+--------------------------+
| 1311-2310 | | Third frame data |
+--------------+---------------------+--------------------------+
Table 36: Xiph Lacing Example
The Block is 2311 octets, and the last frame starts at 1311, so we
can deduce that the size of the last frame is 2311 - 1311 = 1000.
10.3.3. EBML Lacing
The EBML lacing encodes the frame size with an EBML-like encoding
[RFC8794]. The LACING bits of the Block Header flags are set to 11b.
The Block data with laced frames is stored as follows:
* Lacing Head on 1 Octet: Number of frames in the lace minus 1.
* Lacing size of each frame except the last one.
* Binary data of each frame consecutively.
The first frame size is encoded as an EBML VINT value. The remaining
frame sizes are encoded as signed values using the difference between
the frame size and the previous frame size. These signed values are
encoded as VINT, with a mapping from signed to unsigned numbers.
Decoding the unsigned number stored in the VINT to a signed number is
done by subtracting 2^((7*n)-1)-1, where n is the octet size of the
VINT.
+===================================+======================+
| Bit Representation of Signed VINT | Possible Value Range |
+===================================+======================+
| 1xxx xxxx | 2^7 values from |
| | -(2^6-1) to 2^6 |
+-----------------------------------+----------------------+
| 01xx xxxx xxxx xxxx | 2^14 values from |
| | -(2^13-1) to 2^13 |
+-----------------------------------+----------------------+
| 001x xxxx xxxx xxxx xxxx xxxx | 2^21 values from |
| | -(2^20-1) to 2^20 |
+-----------------------------------+----------------------+
| 0001 xxxx xxxx xxxx xxxx xxxx | 2^28 values from |
| xxxx xxxx | -(2^27-1) to 2^27 |
+-----------------------------------+----------------------+
| 0000 1xxx xxxx xxxx xxxx xxxx | 2^35 values from |
| xxxx xxxx xxxx xxxx | -(2^34-1) to 2^34 |
+-----------------------------------+----------------------+
Table 37: EBML Lacing Signed VINT Bits Usage
In our example, the 800-, 500-, and 1000-octet frames are stored with
EBML lacing in a Block as follows:
+==============+===========+=====================================+
| Block Octets | Value | Description |
+==============+===========+=====================================+
| 4 | 0x02 | Number of frames minus 1 |
+--------------+-----------+-------------------------------------+
| 5-6 | 0x43 0x20 | Size of the first frame (800 = |
| | | 0x320 + 0x4000) |
+--------------+-----------+-------------------------------------+
| 7-8 | 0x5E 0xD3 | Size of the second frame (500 - 800 |
| | | = -300 = - 0x12C + 0x1FFF + 0x4000) |
+--------------+-----------+-------------------------------------+
| 8-807 | <frame1> | First frame data |
+--------------+-----------+-------------------------------------+
| 808-1307 | <frame2> | Second frame data |
+--------------+-----------+-------------------------------------+
| 1308-2307 | <frame3> | Third frame data |
+--------------+-----------+-------------------------------------+
Table 38: EBML Lacing Example
The Block is 2308 octets, and the last frame starts at 1308, so we
can deduce that the size of the last frame is 2308 - 1308 = 1000.
10.3.4. Fixed-size Lacing
Fixed-size lacing doesn't store the frame size; rather, it only
stores the number of frames in the lace. Each frame MUST have the
same size. The frame size of each frame is deduced from the total
size of the Block. The LACING bits of the Block Header flags are set
to 10b.
The Block data with laced frames is stored as follows:
* Lacing Head on 1 Octet: Number of frames in the lace minus 1.
* Binary data of each frame consecutively.
For example, for three frames that are 800 octets each:
+==============+==========+==========================+
| Block Octets | Value | Description |
+==============+==========+==========================+
| 4 | 0x02 | Number of frames minus 1 |
+--------------+----------+--------------------------+
| 5-804 | <frame1> | First frame data |
+--------------+----------+--------------------------+
| 805-1604 | <frame2> | Second frame data |
+--------------+----------+--------------------------+
| 1605-2404 | <frame3> | Third frame data |
+--------------+----------+--------------------------+
Table 39: Fixed-Size Lacing Example
This gives a Block of 2405 octets. When reading the Block, we find
that there are three frames (Octet 4). The data start at Octet 5, so
the size of each frame is (2405 - 5) / 3 = 800.
10.3.5. Laced Frames Timestamp
A Block only contains a single timestamp value. But when lacing is
used, it contains more than one frame. Each frame originally has its
own timestamp, or Presentation Timestamp (PTS). That timestamp
applies to the first frame in the lace.
In the lace, each frame after the first one has an underdetermined
timestamp. However, each of these frames MUST be contiguous -- i.e.,
the decoded data MUST NOT contain any gap between them. If there is
a gap in the stream, the frames around the gap MUST NOT be in the
same Block.
Lacing is only useful for small contiguous data to save space. This
is usually the case for audio tracks and not the case for video
(which use a lot of data) or subtitle tracks (which have long gaps).
For audio, there is usually a fixed output sampling frequency for the
whole track, so the decoder should be able to recover the timestamp
of each sample, knowing each output sample is contiguous with a fixed
frequency. For subtitles, this is usually not the case, so lacing
SHOULD NOT be used.
10.4. Random Access Points
Random Access Points (RAPs) are positions where the parser can seek
to and start playback without decoding what was before. In Matroska,
BlockGroups and SimpleBlocks can be RAPs. To seek to these elements,
it is still necessary to seek to the Cluster containing them, read
the Cluster Timestamp, and start playback from the BlockGroup or
SimpleBlock that is a RAP.
Because a Matroska File is usually composed of multiple tracks
playing at the same time -- video, audio, and subtitles -- to seek
properly to a RAP, each selected track must be taken into account.
Usually, all audio and subtitle BlockGroups or SimpleBlocks are RAPs.
They are independent of each other and can be played randomly.
On the other hand, video tracks often use references to previous and
future frames for better coding efficiency. Frames with such
references MUST either contain one or more ReferenceBlock elements in
their BlockGroup or MUST be marked as non-keyframe in a SimpleBlock;
see Section 10.2.
<Cluster>
<Timestamp>123456</Timestamp>
<BlockGroup>
<!-- References a Block 40 Track Ticks before this one -->
<ReferenceBlock>-40</ReferenceBlock>
<Block/>
</BlockGroup>
...
</Cluster>
Figure 15: BlockGroup with a Frame That References Another Frame,
with the EBML Tree Shown as XML
<Cluster>
<Timestamp>123456</Timestamp>
<SimpleBlock/> (octet 3 bit 0 not set)
...
</Cluster>
Figure 16: SimpleBlock with a Frame That References Another
Frame, with the EBML Tree Shown as XML
Frames that are RAPs (i.e., frames that don't depend on other frames)
MUST set the keyframe flag if they are in a SimpleBlock or their
parent BlockGroup MUST NOT contain a ReferenceBlock.
<Cluster>
<Timestamp>123456</Timestamp>
<BlockGroup>
<!-- No ReferenceBlock allowed in this BlockGroup -->
<Block/>
</BlockGroup>
...
</Cluster>
Figure 17: BlockGroup with a Frame That References No Other
Frame, with the EBML Tree Shown as XML
<Cluster>
<Timestamp>123456</Timestamp>
<SimpleBlock/> (octet 3 bit 0 set)
...
</Cluster>
Figure 18: SimpleBlock with a Frame That References No Other
Frame, with the EBML Tree Shown as XML
There may be cases where the use of BlockGroup is necessary, as the
frame may need a BlockDuration, BlockAdditions, CodecState, or
DiscardPadding element. For those cases, a SimpleBlock MUST NOT be
used; the reference information SHOULD be recovered for non-RAP
frames.
<Cluster>
<Timestamp>123456</Timestamp>
<SimpleBlock/> (octet 3 bit 0 not set)
...
</Cluster>
Figure 19: SimpleBlock with a Frame That References Another
Frame, with the EBML Tree Shown as XML
<Cluster>
<Timestamp>123456</Timestamp>
<BlockGroup>
<!-- ReferenceBlock value recovered based on the codec -->
<ReferenceBlock>-40</ReferenceBlock>
<BlockDuration>20</BlockDuration>
<Block/>
</BlockGroup>
...
</Cluster>
Figure 20: Same Frame That References Another Frame Put inside a
BlockGroup to Add BlockDuration, with the EBML Tree Shown as XML
When a frame in a BlockGroup is not a RAP, the BlockGroup MUST
contain at least a ReferenceBlock. The ReferenceBlocks MUST be used
in one of the following ways:
* each reference frame listed as a ReferenceBlock,
* some referenced frames listed as a ReferenceBlock, even if the
timestamp value is accurate, or
* one ReferenceBlock with the timestamp value "0" corresponding to a
self or unknown reference.
The lack of ReferenceBlock would mean such a frame is a RAP, and
seeking on that frame that actually depends on other frames may
create a bogus output or even crash.
<Cluster>
<Timestamp>123456</Timestamp>
<BlockGroup>
<!-- ReferenceBlock value not recovered from the codec -->
<ReferenceBlock>0</ReferenceBlock>
<BlockDuration>20</BlockDuration>
<Block/>
</BlockGroup>
...
</Cluster>
Figure 21: Same Frame That References Another Frame Put inside a
BlockGroup, but the Reference Could Not Be Recovered, with the
EBML Tree Shown as XML
<Cluster>
<Timestamp>123456</Timestamp>
<BlockGroup>
<!-- References a Block 80 Track Ticks before this one -->
<ReferenceBlock>-80</ReferenceBlock>
<!-- References a Block 40 Track Ticks after this one -->
<ReferenceBlock>40</ReferenceBlock>
<Block/>
</BlockGroup>
...
</Cluster>
Figure 22: BlockGroup with a Frame That References Two Other
Frames, with the EBML Tree Shown as XML
Intra-only video frames, such as the ones found in AV1 or VP9, can be
decoded without any other frame, but they don't reset the codec
state. Thus, seeking to these frames is not possible, as the next
frames may need frames that are not known from this seeking point.
Such intra-only frames MUST NOT be considered as keyframes, so the
keyframe flag MUST NOT be set in the SimpleBlock or a ReferenceBlock
MUST be used to signify the frame is not a RAP. The timestamp value
of the ReferenceBlock MUST be "0", meaning it's referencing itself.
<Cluster>
<Timestamp>123456</Timestamp>
<BlockGroup>
<!-- References itself to mark it should not be used as RAP -->
<ReferenceBlock>0</ReferenceBlock>
<Block/>
</BlockGroup>
...
</Cluster>
Figure 23: Intra-Only Frame (Not a RAP), with the EBML Tree Shown
as XML
Because a video SimpleBlock has less information on references than a
video BlockGroup, it is possible to remux a video track using
BlockGroup into a SimpleBlock, as long as it doesn't use any other
BlockGroup features than ReferenceBlock.
11. Timestamps
Historically, timestamps in Matroska were mistakenly called
timecodes. The Timestamp element was called Timecode, the
TimestampScale element was called TimecodeScale, the
TrackTimestampScale element was called TrackTimecodeScale, and the
ReferenceTimestamp element was called ReferenceTimeCode.
11.1. Timestamp Ticks
All timestamp values in Matroska are expressed in multiples of a
tick. They are usually stored as integers. There are three types of
ticks possible: Matroska Ticks, Segment Ticks, and Track Ticks.
11.1.1. Matroska Ticks
The timestamp value is stored directly in nanoseconds.
The elements storing values in Matroska Ticks/nanoseconds are:
* TrackEntry\DefaultDuration; defined in Section 5.1.4.1.13
* TrackEntry\DefaultDecodedFieldDuration; defined in
Section 5.1.4.1.14
* TrackEntry\SeekPreRoll; defined in Section 5.1.4.1.26
* TrackEntry\CodecDelay; defined in Section 5.1.4.1.25
* BlockGroup\DiscardPadding; defined in Section 5.1.3.5.7
* ChapterAtom\ChapterTimeStart; defined in Section 5.1.7.1.4.3
* ChapterAtom\ChapterTimeEnd; defined in Section 5.1.7.1.4.4
11.1.2. Segment Ticks
Elements in Segment Ticks involve the use of the TimestampScale
element of the Segment to get the timestamp in nanoseconds of the
element, with the following formula:
timestamp in nanosecond = element value * TimestampScale
This allows for storage of smaller integer values in the elements.
When using the default value of "1,000,000" for TimestampScale, one
Segment Tick represents one millisecond.
The elements storing values in Segment Ticks are:
* Cluster\Timestamp; defined in Section 5.1.3.1
* Info\Duration is stored as a floating-point, but the same formula
applies; defined in Section 5.1.2.10
* CuePoint\CueTime; defined in Section 5.1.5.1.1
* CuePoint\CueTrackPositions\CueDuration; defined in
Section 5.1.5.1.2.4
* CueReference\CueRefTime; defined in Section 5.1.5.1.1
11.1.3. Track Ticks
Elements in Track Ticks involve the use of the TimestampScale element
of the Segment and the TrackTimestampScale element of the Track to
get the timestamp in nanoseconds of the element, with the following
formula:
timestamp in nanoseconds =
element value * TrackTimestampScale * TimestampScale
This allows for storage of smaller integer values in the elements.
The resulting floating-point values of the timestamps are still
expressed in nanoseconds.
When using the default values of "1,000,000" for TimestampScale and
"1.0" for TrackTimestampScale, one Track Tick represents one
millisecond.
The elements storing values in Track Ticks are:
* Cluster\BlockGroup\Block and Cluster\SimpleBlock timestamps;
detailed in Section 11.2
* Cluster\BlockGroup\BlockDuration; defined in Section 5.1.3.5.3
* Cluster\BlockGroup\ReferenceBlock; defined in Section 5.1.3.5.5
When the TrackTimestampScale is interpreted as "1.0", Track Ticks are
equivalent to Segment Ticks and give an integer value in nanoseconds.
This is the most common case as TrackTimestampScale is usually
omitted.
A value of TrackTimestampScale other than "1.0" MAY be used to scale
the timestamps more in tune with each Track sampling frequency. For
historical reasons, a lot of Matroska Readers don't take the
TrackTimestampScale value into account. Thus, using a value other
than "1.0" might not work in many places.
11.2. Block Timestamps
A Block element and SimpleBlock element timestamp is the time when
the decoded data of the first frame in the Block/SimpleBlock MUST be
presented if the track of that Block/SimpleBlock is selected for
playback. This is also known as the Presentation Timestamp (PTS).
The Block element and SimpleBlock element store their timestamps as
signed integers, relative to the Cluster\Timestamp value of the
Cluster they are stored in. To get the timestamp of a Block or
SimpleBlock in nanoseconds, the following formula is used:
( Cluster\Timestamp + ( block timestamp * TrackTimestampScale ) ) *
TimestampScale
The Block element and SimpleBlock element store their timestamps as
16-bit signed integers, allowing a range from "-32768" to "+32767"
Track Ticks. Although these values can be negative, when added to
the Cluster\Timestamp, the resulting frame timestamp SHOULD NOT be
negative.
When a CodecDelay element is set, its value MUST be subtracted from
each Block timestamp of that track. To get the timestamp in
nanoseconds of the first frame in a Block or SimpleBlock, the formula
becomes:
( ( Cluster\Timestamp + ( block timestamp * TrackTimestampScale ) ) *
TimestampScale ) - CodecDelay
The resulting frame timestamp SHOULD NOT be negative.
During playback, when a frame has a negative timestamp, the content
MUST be decoded by the decoder but not played to the user.
11.3. TimestampScale Rounding
The default Track Tick duration is one millisecond.
The TimestampScale is a floating-point value that is usually "1.0".
But when it's not, the multiplied Block Timestamp is a floating-point
value in nanoseconds. The Matroska Reader SHOULD use the nearest
rounding value in nanoseconds to get the proper nanosecond timestamp
of a Block. This allows some clever TimestampScale values to have a
more refined timestamp precision per frame.
12. Language Codes
Matroska versions 1 through 3 use language codes that can be either
the three-letter bibliographic ISO 639-2 form [ISO639-2] (like "fre"
for French) or such a language code followed by a dash and a country
code for specialities in languages (like "fre-ca" for Canadian
French). The ISO 639-2 Language elements are Language element,
TagLanguage element, and ChapLanguage element.
Starting in Matroska version 4, the forms defined in either
[ISO639-2] or [RFC5646] MAY be used, although the form in [RFC5646]
is RECOMMENDED. The Language elements in the [RFC5646] form are
LanguageBCP47 element, TagLanguageBCP47 element, and
ChapLanguageBCP47 element. If both an [ISO639-2] Language element
and an [RFC5646] Language element are used within the same Parent
Element, then the Language element in the [ISO639-2] form MUST be
ignored and precedence given to the Language element in the [RFC5646]
form.
In this document, "BCP47" in element names refers specifically to
[RFC5646], which is part of BCP 47.
13. Country Codes
Country codes are the [RFC5646] two-letter region subtags, without
the UK exception.
14. Encryption
This Matroska specification provides no interoperable solution for
securing the data container with any assurances of confidentiality,
integrity, authenticity, or authorization. The ContentEncryption
element (Section 5.1.4.1.31.8) and associated sub-fields
(Section 5.1.4.1.31.9 to Section 5.1.4.1.31.12) are defined only for
the benefit of implementers to construct their own proprietary
solution or as the basis for further standardization activities. How
to use these fields to secure a Matroska data container is out of
scope, as are any related issues such as key management and
distribution.
A Matroska Reader who encounters containers that use the fields
defined in this section MUST rely on out-of-scope guidance to decode
the associated content.
Because encryption occurs within the Block element, it is possible to
manipulate encrypted streams without decrypting them. The streams
could potentially be copied, deleted, cut, appended, or any number of
other possible editing techniques without decryption. The data can
be used without having to expose it or go through the decrypting
process.
Encryption can also be layered within Matroska. This means that two
completely different types of encryption can be used, requiring two
separate keys to be able to decrypt a stream.
Encryption information is stored in the ContentEncodings element
under the ContentEncryption element.
For encryption systems sharing public/private keys, the creation of
the keys and the exchange of keys are not covered by this document.
They have to be handled by the system using Matroska.
The algorithms described in Table 24 support different modes of
operations and key sizes. The specification of these parameters is
required for a complete solution but is out of scope of this document
and left to the proprietary implementations using them or subsequent
profiles of this document.
The ContentEncodingScope element gives an idea of which part of the
track is encrypted, but each ContentEncAlgo element and its sub-
elements (like AESSettingsCipherMode) define exactly how the
encrypted track should be interpreted.
An example of an extension that builds upon these security-related
fields in this specification is [WebM-Enc]. It uses AES-CTR,
ContentEncAlgo = 5 (Section 5.1.4.1.31.9), and AESSettingsCipherMode
= 1 (Section 5.1.4.1.31.12).
A Matroska Writer MUST NOT use insecure cryptographic algorithms to
create new archives or streams, but a Matroska Reader MAY support
these algorithms to read previously made archives or streams.
15. Image Presentation
15.1. Cropping
The PixelCrop elements (PixelCropTop, PixelCropBottom,
PixelCropRight, and PixelCropLeft) indicate when, and by how much,
encoded video frames SHOULD be cropped for display. These elements
allow edges of the frame that are not intended for display (such as
the sprockets of a full-frame film scan or the Video ANCillary (VANC)
area of a digitized analog videotape) to be stored but hidden.
PixelCropTop and PixelCropBottom store an integer of how many rows of
pixels SHOULD be cropped from the top and bottom of the image,
respectively. PixelCropLeft and PixelCropRight store an integer of
how many columns of pixels SHOULD be cropped from the left and right
of the image, respectively.
For example, a pillar-boxed video that stores a 1440x1080 visual
image within the center of a padded 1920x1080 encoded image may set
both PixelCropLeft and PixelCropRight to "240", so a Matroska Player
should crop off 240 columns of pixels from the left and right of the
encoded image to present the image with the pillar-boxes hidden.
Cropping has to be performed before resizing and the display
dimensions given by DisplayWidth, DisplayHeight, and DisplayUnit
apply to the already-cropped image.
15.2. Rotation
The ProjectionPoseRoll element (Section 5.1.4.1.28.46) can be used to
indicate that the image from the associated video track SHOULD be
rotated for presentation. For instance, the following example of the
Projection element (Section 5.1.4.1.28.41) and the ProjectionPoseRoll
element represents a video track where the image SHOULD be presented
with a 90-degree counter-clockwise rotation, with the EBML tree shown
as XML:
<Projection>
<ProjectionPoseRoll>90</ProjectionPoseRoll>
</Projection>
Figure 24: Rotation Example
16. Segment Position
The Segment Position of an element refers to the position of the
first octet of the Element ID of that element, measured in octets,
from the beginning of the Element Data section of the containing
Segment element. In other words, the Segment Position of an element
is the distance in octets from the beginning of its containing
Segment element minus the size of the Element ID and Element Data
Size of that Segment element. The Segment Position of the first
Child Element of the Segment element is 0. An element that is not
stored within a Segment element, such as the elements of the EBML
Header, do not have a Segment Position.
16.1. Segment Position Exception
Elements that are defined to store a Segment Position MAY define
reserved values to indicate a special meaning.
16.2. Example of Segment Position
This table presents an example of Segment Position by showing a
hexadecimal representation of a very small Matroska file with labels
to show the offsets in octets. The file contains a Segment element
with an Element ID of "0x18538067" and a MuxingApp element with an
Element ID of "0x4D80".
0 1 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
0 |1A|45|DF|A3|8B|42|82|88|6D|61|74|72|6F|73|6B|61|
^ EBML Header
0 | |18|53|80|67|
^ Segment ID
20 |93|
^ Segment Data Size
20 | |15|49|A9|66|8E|4D|80|84|69|65|74|66|57|41|84|69|65|74|66|
^ Start of Segment data
20 | |4D|80|84|69|65|74|66|57|41|84|69|65|74|66|
^ MuxingApp start
In the above example, the Element ID of the Segment element is stored
at offset 16, the Element Data Size of the Segment element is stored
at offset 20, and the Element Data of the Segment element is stored
at offset 21.
The MuxingApp element is stored at offset 26. Since the Segment
Position of an element is calculated by subtracting the position of
the Element Data of the containing Segment element from the position
of that element, the Segment Position of the MuxingApp element in the
above example is "26 - 21" or "5".
17. Linked Segments
Matroska provides several methods to link two or more Segment
elements together to create a Linked Segment. A Linked Segment is a
set of multiple Segments linked together into a single presentation
by using Hard Linking or Medium Linking.
All Segments within a Linked Segment MUST have a SegmentUUID.
All Segments within a Linked Segment SHOULD be stored within the same
directory or be quickly accessible based on their SegmentUUID in
order to have a seamless transition between segments.
All Segments within a Linked Segment MAY set a SegmentFamily with a
common value to make it easier for a Matroska Player to know which
Segments are meant to be played together.
The SegmentFilename, PrevFilename, and NextFilename elements MAY also
give hints on the original filenames that were used when the Segment
links were created, in case some SegmentUUIDs are damaged.
17.1. Hard Linking
Hard Linking, also called "splitting", is the process of creating a
Linked Segment by linking multiple Segment elements using the
NextUUID and PrevUUID elements.
All Segments within a Hard Linked Segment MUST use the same Tracks
list and TimestampScale.
Within a Linked Segment, the timestamps of Block and SimpleBlock MUST
consecutively follow the timestamps of Block and SimpleBlock from the
previous Segment in linking order.
With Hard Linking, the chapters of any Segment within the Linked
Segment MUST only reference the current Segment. The NextUUID and
PrevUUID reference the respective SegmentUUID values of the next and
previous Segments.
The first Segment of a Linked Segment MUST NOT have a PrevUUID
element. The last Segment of a Linked Segment MUST NOT have a
NextUUID element.
For each node of the chain of Segments of a Linked Segment, at least
one Segment MUST reference the other Segment within the chain.
In a chain of Segments of a Linked Segment, the NextUUID always takes
precedence over the PrevUUID. Thus, if SegmentA has a NextUUID to
SegmentB and SegmentB has a PrevUUID to SegmentC, the link to use is
NextUUID between SegmentA and SegmentB, and SegmentC is not part of
the Linked Segment.
If SegmentB has a PrevUUID to SegmentA, but SegmentA has no NextUUID,
then the Matroska Player MAY consider these two Segments linked as
SegmentA followed by SegmentB.
As an example, three Segments can be Hard Linked as a Linked Segment
through cross-referencing each other with SegmentUUID, PrevUUID, and
NextUUID as shown in this table:
+==========+================+==================+==================+
|file name |SegmentUUID | PrevUUID | NextUUID |
+==========+================+==================+==================+
|start.mkv |71000c23cd310998| Invalid | a77b3598941cb803 |
| |53fbc94dd984a5dd| | eac0fcdafe44fac9 |
+----------+----------------+------------------+------------------+
|middle.mkv|a77b3598941cb803| 71000c23cd310998 | 6c92285fa6d3e827 |
| |eac0fcdafe44fac9| 53fbc94dd984a5dd | b198d120ea3ac674 |
+----------+----------------+------------------+------------------+
|end.mkv |6c92285fa6d3e827| a77b3598941cb803 | Invalid |
| |b198d120ea3ac674| eac0fcdafe44fac9 | |
+----------+----------------+------------------+------------------+
Table 40: Usual Hard Linking UIDs
An example where only the NextUUID element is used:
+============+==================+==========+==================+
| file name | SegmentUUID | PrevUUID | NextUUID |
+============+==================+==========+==================+
| start.mkv | 71000c23cd310998 | Invalid | a77b3598941cb803 |
| | 53fbc94dd984a5dd | | eac0fcdafe44fac9 |
+------------+------------------+----------+------------------+
| middle.mkv | a77b3598941cb803 | n/a | 6c92285fa6d3e827 |
| | eac0fcdafe44fac9 | | b198d120ea3ac674 |
+------------+------------------+----------+------------------+
| end.mkv | 6c92285fa6d3e827 | n/a | Invalid |
| | b198d120ea3ac674 | | |
+------------+------------------+----------+------------------+
Table 41: Hard Linking without PrevUUID
An example where only the PrevUUID element is used:
+============+==================+==================+==========+
| file name | SegmentUUID | PrevUUID | NextUUID |
+============+==================+==================+==========+
| start.mkv | 71000c23cd310998 | Invalid | n/a |
| | 53fbc94dd984a5dd | | |
+------------+------------------+------------------+----------+
| middle.mkv | a77b3598941cb803 | 71000c23cd310998 | n/a |
| | eac0fcdafe44fac9 | 53fbc94dd984a5dd | |
+------------+------------------+------------------+----------+
| end.mkv | 6c92285fa6d3e827 | a77b3598941cb803 | Invalid |
| | b198d120ea3ac674 | eac0fcdafe44fac9 | |
+------------+------------------+------------------+----------+
Table 42: Hard Linking without NextUUID
An example where only the middle.mkv is using the PrevUUID and
NextUUID elements:
+==========+================+==================+==================+
|file name |SegmentUUID | PrevUUID | NextUUID |
+==========+================+==================+==================+
|start.mkv |71000c23cd310998| Invalid | n/a |
| |53fbc94dd984a5dd| | |
+----------+----------------+------------------+------------------+
|middle.mkv|a77b3598941cb803| 71000c23cd310998 | 6c92285fa6d3e827 |
| |eac0fcdafe44fac9| 53fbc94dd984a5dd | b198d120ea3ac674 |
+----------+----------------+------------------+------------------+
|end.mkv |6c92285fa6d3e827| n/a | Invalid |
| |b198d120ea3ac674| | |
+----------+----------------+------------------+------------------+
Table 43: Hard Linking with Mixed UID Links
17.2. Medium Linking
Medium Linking creates relationships between Segments using Ordered
Chapters (Section 20.1.3) and the ChapterSegmentUUID element. A
Chapter Edition with Ordered Chapters MAY contain Chapters elements
that reference timestamp ranges from other Segments. The Segment
referenced by the Ordered Chapter via the ChapterSegmentUUID element
SHOULD be played as part of a Linked Segment.
The timestamps of Segment content referenced by Ordered Chapters MUST
be adjusted according to the cumulative duration of the previous
Ordered Chapters.
As an example, a file named intro.mkv could have a SegmentUUID of
"0xb16a58609fc7e60653a60c984fc11ead". Another file called
program.mkv could use a Chapter Edition that contains two Ordered
Chapters. The first chapter references the Segment of intro.mkv with
the use of a ChapterSegmentUUID, ChapterSegmentEditionUID,
ChapterTimeStart, and an optional ChapterTimeEnd element. The second
chapter references content within the Segment of program.mkv. A
Matroska Player SHOULD recognize the Linked Segment created by the
use of ChapterSegmentUUID in an enabled Edition and present the
reference content of the two Segments as a single presentation.
The ChapterSegmentUUID represents the Segment that holds the content
to play in place of the Linked Chapter. The ChapterSegmentUUID MUST
NOT be the SegmentUUID of its own Segment.
There are two ways to use a chapter link:
* Linked-Duration linking
* Linked-Edition linking
17.2.1. Linked-Duration
A Matroska Player MUST play the content of the Linked Segment from
the ChapterTimeStart until the ChapterTimeEnd timestamp in place of
the Linked Chapter.
ChapterTimeStart and ChapterTimeEnd represent timestamps in the
Linked Segment matching the value of ChapterSegmentUUID. Their
values MUST be in the range of the Linked Segment duration.
The ChapterTimeEnd value MUST be set when using Linked-Duration
chapter linking. ChapterSegmentEditionUID MUST NOT be set.
17.2.2. Linked-Edition
A Matroska Player MUST play the whole Linked Edition of the Linked
Segment in place of the Linked Chapter.
ChapterSegmentEditionUID represents a valid Edition from the Linked
Segment matching the value of ChapterSegmentUUID.
When using Linked-Edition chapter linking, ChapterTimeEnd is
OPTIONAL.
18. Track Flags
18.1. Default Flag
The Default flag is a hint for a Matroska Player indicating that a
given track SHOULD be eligible to be automatically selected as the
default track for a given language. If no tracks in a given language
have the Default flag set, then all tracks in that language are
eligible for automatic selection. This can be used to indicate that
a track provides "regular service" that is suitable for users with
default settings, as opposed to specialized services, such as
commentary, captions for users with hearing impairments, or
descriptive audio.
The Matroska Player MAY override the Default flag for any reason,
including user preferences to prefer tracks providing accessibility
services.
18.2. Forced Flag
The Forced flag tells the Matroska Player that it SHOULD display this
subtitle track, even if user preferences usually would not call for
any subtitles to be displayed alongside the audio track that is
currently selected. This can be used to indicate that a track
contains translations of on-screen text or dialogue spoken in a
different language than the track's primary language.
18.3. Hearing-Impaired Flag
The Hearing-Impaired flag tells the Matroska Player that it SHOULD
prefer this track when selecting a default track for a user with a
hearing impairment and that it MAY prefer to select a different track
when selecting a default track for a user that is not hearing
impaired.
18.4. Visual-Impaired Flag
The Visual-Impaired flag tells the Matroska Player that it SHOULD
prefer this track when selecting a default track for a user with a
visual impairment and that it MAY prefer to select a different track
when selecting a default track for a user that is not visually
impaired.
18.5. Descriptions Flag
The Descriptions flag tells the Matroska Player that this track is
suitable to play via a text-to-speech system for a user with a visual
impairment and that it SHOULD NOT automatically select this track
when selecting a default track for a user that is not visually
impaired.
18.6. Original Flag
The Original flag tells the Matroska Player that this track is in the
original language and that it SHOULD prefer this track if configured
to prefer original-language tracks of this track's type.
18.7. Commentary Flag
The Commentary flag tells the Matroska Player that this track
contains commentary on the content.
18.8. Track Operation
TrackOperation allows for the combination of multiple tracks to make
a virtual one. It uses two separate system to combine tracks. One
to create a 3D "composition" (left/right/background planes) and one
to simplify join two tracks together to make a single track.
A track created with TrackOperation is a proper track with a UID and
all its flags. However, the codec ID is meaningless because each
"sub" track needs to be decoded by its own decoder before the
"operation" is applied. The Cues elements corresponding to such a
virtual track SHOULD be the union of the Cues elements for each of
the tracks it's composed of (when the Cues are defined per track).
In the case of TrackJoinBlocks, the Block elements (from BlockGroup
and SimpleBlock) of all the tracks SHOULD be used as if they were
defined for this new virtual Track. When two Block elements have
overlapping start or end timestamps, it's up to the underlying system
to either drop some of these frames or render them the way they
overlap. This situation SHOULD be avoided when creating such tracks,
as you can never be sure of the end result on different platforms.
18.9. Overlay Track
An overlay track SHOULD be rendered in the same channel as the track
it's linked to. When content is found in such a track, it SHOULD be
played on the rendering channel instead of the original track.
18.10. Multi-planar and 3D Videos
There are two different ways to compress 3D videos: have each eye
track in a separate track and have one track have both eyes combined
inside (which is more efficient compression-wise). Matroska supports
both ways.
For the single-track variant, there is the StereoMode element, which
defines how planes are assembled in the track (mono or left-right
combined). Odd values of StereoMode means the left plane comes first
for more convenient reading. The pixel count of the track
(PixelWidth/PixelHeight) is the raw number of pixels (for example,
3840x1080 for full HD side by side), and the DisplayWidth/
DisplayHeight in pixels is the number of pixels for one plane
(1920x1080 for that full HD stream). Old stereo 3D movies were
displayed using anaglyph (cyan and red colors separated). For
compatibility with such movies, there is a value of the StereoMode
that corresponds to anaglyph.
There is also a "packed" mode (values 13 and 14) that consists of
packing two frames together in a Block that uses lacing. The first
frame is the left eye and the other frame is the right eye (or vice
versa). The frames SHOULD be decoded in that order and are possibly
dependent on each other (P and B frames).
For separate tracks, Matroska needs to define exactly which track
does what. TrackOperation with TrackCombinePlanes does that. For
more details, see Section 18.8 on how TrackOperation works.
The 3D support is still in infancy and may evolve to support more
features.
The StereoMode used to be part of Matroska v2, but it didn't meet the
requirement for multiple tracks. There was also a bug in
[libmatroska] prior to 0.9.0 that would save/read it as 0x53B9
instead of 0x53B8; see OldStereoMode (Section 5.1.4.1.28.5).
Matroska Readers MAY support these legacy files by checking Matroska
v2 or 0x53B9. The older values of StereoMode were 0 (mono), 1 (right
eye), 2 (left eye), and 3 (both eyes); these are the only values that
can be found in OldStereoMode. They are not compatible with the
StereoMode values found in Matroska v3 and above.
19. Default Track Selection
This section provides some example sets of Tracks and hypothetical
user settings, along with indications of which ones a similarly
configured Matroska Player SHOULD automatically select for playback
by default in such a situation. A player MAY provide additional
settings with more detailed controls for more nuanced scenarios.
These examples are provided as guidelines to illustrate the intended
usages of the various supported Track flags and their expected
behaviors.
Track names are shown in English for illustrative purposes; actual
files may have titles in the language of each track or provide titles
in multiple languages.
19.1. Audio Selection
Example track set:
+===+=====+====+======+========+=======+===============+===========+
|No.|Type |Lang|Layout|Original|Default|Other Flags |Name |
+===+=====+====+======+========+=======+===============+===========+
|1 |Video|und |N/A |N/A |N/A |None | |
+---+-----+----+------+--------+-------+---------------+-----------+
|2 |Audio|eng |5.1 |1 |1 |None | |
+---+-----+----+------+--------+-------+---------------+-----------+
|3 |Audio|eng |2.0 |1 |1 |None | |
+---+-----+----+------+--------+-------+---------------+-----------+
|4 |Audio|eng |2.0 |1 |0 |Visual-Impaired|Descriptive|
| | | | | | | |audio |
+---+-----+----+------+--------+-------+---------------+-----------+
|5 |Audio|esp |5.1 |0 |1 |None | |
+---+-----+----+------+--------+-------+---------------+-----------+
|6 |Audio|esp |2.0 |0 |0 |Visual-Impaired|Descriptive|
| | | | | | | |audio |
+---+-----+----+------+--------+-------+---------------+-----------+
|7 |Audio|eng |2.0 |1 |0 |Commentary |Director's |
| | | | | | | |Commentary |
+---+-----+----+------+--------+-------+---------------+-----------+
|8 |Audio|eng |2.0 |1 |0 |None |Karaoke |
+---+-----+----+------+--------+-------+---------------+-----------+
Table 44: Audio Tracks for Default Selection
The table above shows a file with seven audio tracks -- five in
English and two in Spanish.
The English tracks all have the Original flag, indicating that
English is the original content language.
Generally, the player will first consider the track languages. If
the player has an option to prefer original-language audio and the
user has enabled it, then it should prefer one of the tracks with the
Original flag. If the user has configured to specifically prefer
audio tracks in English or Spanish, the player should select one of
the tracks in the corresponding language. The player may also wish
to prefer a track with the Original flag if no tracks matching any of
the user's explicitly preferred languages are available.
Two of the tracks have the Visual-Impaired flag. If the player has
been configured to prefer such tracks, it should select one;
otherwise, it should avoid them if possible.
If selecting an English track, when other settings have left multiple
possible options, it may be useful to exclude the tracks that lack
the Default flag. Here, one provides descriptive service for
individuals with visual impairments (which has its own flag and may
be automatically selected by user configuration but is unsuitable for
users with default-configured players), one is a commentary track
(which has its own flag and the player may or may not have
specialized handling for), and the last contains karaoke versions of
the music that plays during the film (which is an unusual specialized
audio service that Matroska has no built-in support for indicating,
so it's indicated in the track name instead). By not setting the
Default flag on these specialized tracks, the file's author hints
that they should not be automatically selected by a default-
configured player.
Having narrowed its choices down, the example player now may have to
select between tracks 2 and 3. The only difference between these
tracks is their channel layouts: 2 is 5.1 surround, while 3 is
stereo. If the player is aware that the output device is a pair of
headphones or stereo speakers, it may wish to prefer the stereo mix
automatically. On the other hand, if it knows that the device is a
surround system, it may wish to prefer the surround mix.
If the player finishes analyzing all of the available audio tracks
and finds that more than one seem equally and maximally preferable,
it SHOULD default to the first of the group.
19.2. Subtitle Selection
Example track set:
+===+=========+====+========+=======+======+========+==============+
|No.|Type |Lang|Original|Default|Forced|Other | Name |
| | | | | | |Flags | |
+===+=========+====+========+=======+======+========+==============+
|1 |Video |und |N/A |N/A |N/A |None | |
+---+---------+----+--------+-------+------+--------+--------------+
|2 |Audio |fra |1 |1 |N/A |None | |
+---+---------+----+--------+-------+------+--------+--------------+
|3 |Audio |por |0 |1 |N/A |None | |
+---+---------+----+--------+-------+------+--------+--------------+
|4 |Subtitles|fra |1 |1 |0 |None | |
+---+---------+----+--------+-------+------+--------+--------------+
|5 |Subtitles|fra |1 |0 |0 |Hearing-| Captions for |
| | | | | | |Impaired| users with |
| | | | | | | | hearing |
| | | | | | | | impairments |
+---+---------+----+--------+-------+------+--------+--------------+
|6 |Subtitles|por |0 |1 |0 |None | |
+---+---------+----+--------+-------+------+--------+--------------+
|7 |Subtitles|por |0 |0 |1 |None | Signs |
+---+---------+----+--------+-------+------+--------+--------------+
|8 |Subtitles|por |0 |0 |0 |Hearing-| SDH |
| | | | | | |Impaired| |
+---+---------+----+--------+-------+------+--------+--------------+
Table 45: Subtitle Tracks for Default Selection
The table above shows two audio tracks and five subtitle tracks. As
we can see, French is the original language.
We'll start by discussing the case where the user prefers French (or
original-language) audio (or has explicitly selected the French audio
track) and also prefers French subtitles.
In this case, if the player isn't configured to display captions when
the audio matches their preferred subtitle languages, the player
doesn't need to select a subtitle track at all.
If the user _has_ indicated that they want captions to be displayed,
the selection simply comes down to whether hearing-impaired subtitles
are preferred.
The situation for a user who prefers Portuguese subtitles starts out
somewhat analogous. If they select the original French audio (either
by explicit audio language preference, preference for original-
language tracks, or explicitly selecting that track), then the
selection once again comes down to the hearing-impaired preference.
However, the case where the Portuguese audio track is selected has an
important catch: a Forced track in Portuguese is present. This may
contain translations of on-screen text from the video track or of
portions of the audio that are not translated (music, for instance).
This means that even if the user's preferences wouldn't normally call
for captions here, the Forced track should be selected nonetheless,
rather than selecting no track at all. On the other hand, if the
user's preferences _do_ call for captions, the non-Forced tracks
should be preferred, as the Forced track will not contain captioning
for the dialogue.
20. Chapters
The Matroska Chapters system can have multiple Editions, and each
Edition can consist of Simple Chapters where a chapter start time is
used as a marker in the timeline only. An Edition can be more
complex with Ordered Chapters where a chapter end timestamp is
additionally used or much more complex with Linked Chapters. The
Matroska Chapters system can also have a menu structure borrowed from
the DVD-menu system [DVD-Video] or have its own built-in Matroska
menu structure.
20.1. EditionEntry
The EditionEntry is also called an Edition. An Edition contains a
set of Edition flags and MUST contain at least one ChapterAtom
element. Chapters are always inside an Edition (or a Chapter itself
is part of an Edition). Multiple Editions are allowed. Some of
these Editions MAY be ordered and others not.
20.1.1. EditionFlagDefault
Only one Edition SHOULD have an EditionFlagDefault flag set to true.
20.1.2. Default Edition
The Default Edition is the Edition that a Matroska Player SHOULD use
for playback by default.
The first Edition with the EditionFlagDefault flag set to true is the
Default Edition.
When all EditionFlagDefault flags are set to false, then the first
Edition is the Default Edition.
+===========+=============+=================+
| Edition | FlagDefault | Default Edition |
+===========+=============+=================+
| Edition 1 | true | X |
+-----------+-------------+-----------------+
| Edition 2 | true | |
+-----------+-------------+-----------------+
| Edition 3 | true | |
+-----------+-------------+-----------------+
Table 46: Default Edition, All Default
+===========+=============+=================+
| Edition | FlagDefault | Default Edition |
+===========+=============+=================+
| Edition 1 | false | X |
+-----------+-------------+-----------------+
| Edition 2 | false | |
+-----------+-------------+-----------------+
| Edition 3 | false | |
+-----------+-------------+-----------------+
Table 47: Default Edition, No Default
+===========+=============+=================+
| Edition | FlagDefault | Default Edition |
+===========+=============+=================+
| Edition 1 | false | |
+-----------+-------------+-----------------+
| Edition 2 | true | X |
+-----------+-------------+-----------------+
| Edition 3 | false | |
+-----------+-------------+-----------------+
Table 48: Default Edition, With Default
20.1.3. EditionFlagOrdered
The EditionFlagOrdered flag is a significant feature, as it enables
an Edition of Ordered Chapters that defines and arranges a virtual
timeline rather than simply labeling points within the timeline. For
example, with Editions of Ordered Chapters, a single Matroska file
can present multiple edits of a film without duplicating content.
Alternatively, if a videotape is digitized in full, one Ordered
Edition could present the full content (including colorbars,
countdown, slate, a feature presentation, and black frames), while
another Edition of Ordered Chapters can use Chapters that only mark
the intended presentation with the colorbars and other ancillary
visual information excluded. If an Edition of Ordered Chapters is
enabled, then the Matroska Player MUST play those Chapters in their
stored order from the timestamp marked in the ChapterTimeStart
element to the timestamp marked in to ChapterTimeEnd element.
If the EditionFlagOrdered flag evaluates to "0", Simple Chapters are
used and only the ChapterTimeStart of a Chapter is used as a chapter
mark to jump to the predefined point in the timeline. With Simple
Chapters, a Matroska Player MUST ignore certain elements inside a
Chapters element. In that case, these elements are informational
only.
The following list shows the different Chapters elements only found
in Ordered Chapters.
* ChapterAtom\ChapterSegmentUUID
* ChapterAtom\ChapterSegmentEditionUID
* ChapterAtom\ChapProcess
* Info\ChapterTranslate
* TrackEntry\TrackTranslate
Furthermore, there are other EBML elements that could be used if the
EditionFlagOrdered evaluates to "1".
20.1.3.1. Ordered-Edition and Matroska Segment Linking
Hard Linking: Ordered Chapters supersede the Hard Linking.
Medium Linking: Ordered Chapters are used in a normal way and can be
combined with the ChapterSegmentUUID element, which establishes a
link to another Segment.
See Section 17 on Linked Segments for more information about Hard
Linking and Medium Linking.
20.2. ChapterAtom
The ChapterAtom is also called a Chapter.
20.2.1. ChapterTimeStart
ChapterTimeStart is the timestamp of the start of Chapter with
nanosecond accuracy and is not scaled by TimestampScale. For Simple
Chapters, this is the position of the chapter markers in the
timeline.
20.2.2. ChapterTimeEnd
ChapterTimeEnd is the timestamp of the end of Chapter with nanosecond
accuracy and is not scaled by TimestampScale. The timestamp defined
by the ChapterTimeEnd is not part of the Chapter. A Matroska Player
calculates the duration of this Chapter using the difference between
the ChapterTimeEnd and ChapterTimeStart. The end timestamp MUST be
greater than or equal to the start timestamp.
When the ChapterTimeEnd timestamp is equal to the ChapterTimeStart
timestamp, the timestamp is included in the Chapter. It can be
useful to put markers in a file or add chapter commands with ordered
chapter commands without having to play anything; see
Section 5.1.7.1.4.14.
+===========+=================+===============+===============+
| Chapter | Start timestamp | End timestamp | Duration |
+===========+=================+===============+===============+
| Chapter 1 | 0 | 1000000000 | 1000000000 |
+-----------+-----------------+---------------+---------------+
| Chapter 2 | 1000000000 | 5000000000 | 4000000000 |
+-----------+-----------------+---------------+---------------+
| Chapter 3 | 6000000000 | 6000000000 | 0 |
+-----------+-----------------+---------------+---------------+
| Chapter 4 | 9000000000 | 8000000000 | Invalid |
| | | | (-1000000000) |
+-----------+-----------------+---------------+---------------+
Table 49: ChapterTimeEnd Usage Possibilities
20.2.3. Nested Chapters
A ChapterAtom element can contain other ChapterAtom elements. That
element is a Parent Chapter, and the ChapterAtom elements it contains
are Nested Chapters.
Nested Chapters can be useful to tag small parts of a Segment that
already have tags or add Chapter Codec commands on smaller parts of a
Segment that already have Chapter Codec commands.
The ChapterTimeStart of a Nested Chapter MUST be greater than or
equal to the ChapterTimeStart of its Parent Chapter.
If the Parent Chapter of a Nested Chapter has a ChapterTimeEnd, the
ChapterTimeStart of that Nested Chapter MUST be smaller than or equal
to the ChapterTimeEnd of the Parent Chapter.
20.2.4. Nested Chapters in Ordered Chapters
The ChapterTimeEnd of the lowest level of Nested Chapters MUST be set
for Ordered Chapters.
When used with Ordered Chapters, the ChapterTimeEnd value of a Parent
Chapter is useless for playback, as the proper playback sections are
described in its Nested Chapters. The ChapterTimeEnd SHOULD NOT be
set in Parent Chapters and MUST be ignored for playback.
20.2.5. ChapterFlagHidden
Each Chapter's ChapterFlagHidden flag works independently of Parent
Chapters. A Nested Chapter with a ChapterFlagHidden flag that
evaluates to "0" remains visible in the user interface even if the
Parent Chapter's ChapterFlagHidden flag is set to "1".
+==========================+===================+=========+
| Chapter + Nested Chapter | ChapterFlagHidden | visible |
+==========================+===================+=========+
| Chapter 1 | 0 | yes |
+--------------------------+-------------------+---------+
| Nested Chapter 1.1 | 0 | yes |
+--------------------------+-------------------+---------+
| Nested Chapter 1.2 | 1 | no |
+--------------------------+-------------------+---------+
| Chapter 2 | 1 | no |
+--------------------------+-------------------+---------+
| Nested Chapter 2.1 | 0 | yes |
+--------------------------+-------------------+---------+
| Nested Chapter 2.2 | 1 | no |
+--------------------------+-------------------+---------+
Table 50: ChapterFlagHidden Nested Visibility
20.3. Menu Features
The menu features are handled like a chapter codec. That means each
codec has a type, some private data, and some data in the chapters.
The type of the menu system is defined by the ChapProcessCodecID
parameter. For now, only two values are supported: 0 (Matroska
Script) and 1 (menu borrowed from the DVD [DVD-Video]). The private
data stored in ChapProcessPrivate and ChapProcessData depends on the
ChapProcessCodecID value.
The menu system, as well as Chapter Codecs in general, can perform
actions on the Matroska Player, such as jumping to another Chapter or
Edition, selecting different tracks, and possibly more. The scope of
all the possibilities of Chapter Codecs is not covered in this
document, as it depends on the Chapter Codec features and its
integration in a Matroska Player.
20.4. Physical Types
Each level can have different meanings for audio and video. The
ORIGINAL_MEDIA_TYPE tag [MatroskaTags] can be used to specify a
string for ChapterPhysicalEquiv = 60. Here is the list of possible
levels for both audio and video:
+=======+=======================+=============+=====================+
| Value | Audio | Video | Comment |
+=======+=======================+=============+=====================+
| 70 | SET / PACKAGE | SET / | the collection of |
| | | PACKAGE | different media |
+-------+-----------------------+-------------+---------------------+
| 60 | CD / 12" / 10" / 7" / | DVD / VHS | the physical medium |
| | TAPE / MINIDISC / DAT | / | like a CD or a DVD |
| | | LASERDISC | |
+-------+-----------------------+-------------+---------------------+
| 50 | SIDE | SIDE | when the original |
| | | | medium (LP/DVD) has |
| | | | different sides |
+-------+-----------------------+-------------+---------------------+
| 40 | - | LAYER | another physical |
| | | | level on DVDs |
+-------+-----------------------+-------------+---------------------+
| 30 | SESSION | SESSION | as found on CDs and |
| | | | DVDs |
+-------+-----------------------+-------------+---------------------+
| 20 | TRACK | - | as found on audio |
| | | | CDs |
+-------+-----------------------+-------------+---------------------+
| 10 | INDEX | - | the first logical |
| | | | level of the side/ |
| | | | medium |
+-------+-----------------------+-------------+---------------------+
Table 51: ChapterPhysicalEquiv Meaning per Track Type
20.5. Chapter Examples
20.5.1. Example 1: Basic Chaptering
In this example, a movie is split in different chapters. It could
also just be an audio file (album) in which each track corresponds to
a chapter.
* 00000 ms - 05000 ms: Intro
* 05000 ms - 25000 ms: Before the crime
* 25000 ms - 27500 ms: The crime
* 27500 ms - 38000 ms: After the crime
* 38000 ms - 43000 ms: Credits
This translates to Matroska form, with the EBML tree shown as follows
in XML:
<Chapters>
<EditionEntry>
<EditionUID>16603393396715046047</EditionUID>
<ChapterAtom>
<ChapterUID>1193046</ChapterUID>
<ChapterTimeStart>0</ChapterTimeStart>
<ChapterTimeEnd>5000000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Intro</ChapString>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>2311527</ChapterUID>
<ChapterTimeStart>5000000000</ChapterTimeStart>
<ChapterTimeEnd>25000000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Before the crime</ChapString>
</ChapterDisplay>
<ChapterDisplay>
<ChapString>Avant le crime</ChapString>
<ChapLanguage>fra</ChapLanguage>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>3430008</ChapterUID>
<ChapterTimeStart>25000000000</ChapterTimeStart>
<ChapterTimeEnd>27500000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>The crime</ChapString>
</ChapterDisplay>
<ChapterDisplay>
<ChapString>Le crime</ChapString>
<ChapLanguage>fra</ChapLanguage>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>4548489</ChapterUID>
<ChapterTimeStart>27500000000</ChapterTimeStart>
<ChapterTimeEnd>38000000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>After the crime</ChapString>
</ChapterDisplay>
<ChapterDisplay>
<ChapString>Apres le crime</ChapString>
<ChapLanguage>fra</ChapLanguage>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>5666960</ChapterUID>
<ChapterTimeStart>38000000000</ChapterTimeStart>
<ChapterTimeEnd>43000000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Credits</ChapString>
</ChapterDisplay>
<ChapterDisplay>
<ChapString>Generique</ChapString>
<ChapLanguage>fra</ChapLanguage>
</ChapterDisplay>
</ChapterAtom>
</EditionEntry>
</Chapters>
Figure 25: Basic Chapters Example
20.5.2. Example 2: Nested Chapters
In this example, an (existing) album is split into different
chapters, and one of them contains another splitting.
20.5.2.1. The Micronauts "Bleep To Bleep"
* 00:00 - 12:28: Baby wants to Bleep/Rock
- 00:00 - 04:38: Baby wants to bleep (pt.1)
- 04:38 - 07:12: Baby wants to rock
- 07:12 - 10:33: Baby wants to bleep (pt.2)
- 10:33 - 12:28: Baby wants to bleep (pt.3)
* 12:30 - 19:38: Bleeper_O+2
* 19:40 - 22:20: Baby wants to bleep (pt.4)
* 22:22 - 25:18: Bleep to bleep
* 25:20 - 33:35: Baby wants to bleep (k)
* 33:37 - 44:28: Bleeper
This translates to Matroska form, with the EBML tree shown as follows
in XML:
<Chapters>
<EditionEntry>
<EditionUID>1281690858003401414</EditionUID>
<ChapterAtom>
<ChapterUID>1</ChapterUID>
<ChapterTimeStart>0</ChapterTimeStart>
<ChapterTimeEnd>748000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Baby wants to Bleep/Rock</ChapString>
</ChapterDisplay>
<ChapterAtom>
<ChapterUID>2</ChapterUID>
<ChapterTimeStart>0</ChapterTimeStart>
<ChapterTimeEnd>278000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Baby wants to bleep (pt.1)</ChapString>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>3</ChapterUID>
<ChapterTimeStart>278000000</ChapterTimeStart>
<ChapterTimeEnd>432000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Baby wants to rock</ChapString>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>4</ChapterUID>
<ChapterTimeStart>432000000</ChapterTimeStart>
<ChapterTimeEnd>633000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Baby wants to bleep (pt.2)</ChapString>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>5</ChapterUID>
<ChapterTimeStart>633000000</ChapterTimeStart>
<ChapterTimeEnd>748000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Baby wants to bleep (pt.3)</ChapString>
</ChapterDisplay>
</ChapterAtom>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>6</ChapterUID>
<ChapterTimeStart>750000000</ChapterTimeStart>
<ChapterTimeEnd>1178500000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Bleeper_O+2</ChapString>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>7</ChapterUID>
<ChapterTimeStart>1180500000</ChapterTimeStart>
<ChapterTimeEnd>1340000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Baby wants to bleep (pt.4)</ChapString>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>8</ChapterUID>
<ChapterTimeStart>1342000000</ChapterTimeStart>
<ChapterTimeEnd>1518000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Bleep to bleep</ChapString>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>9</ChapterUID>
<ChapterTimeStart>1520000000</ChapterTimeStart>
<ChapterTimeEnd>2015000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Baby wants to bleep (k)</ChapString>
</ChapterDisplay>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>10</ChapterUID>
<ChapterTimeStart>2017000000</ChapterTimeStart>
<ChapterTimeEnd>2668000000</ChapterTimeEnd>
<ChapterDisplay>
<ChapString>Bleeper</ChapString>
</ChapterDisplay>
</ChapterAtom>
</EditionEntry>
</Chapters>
Figure 26: Nested Chapters Example
21. Attachments
Matroska supports storage of related files and data in the
Attachments element (a Top-Level Element). Attachments elements can
be used to store related cover art, font files, transcripts, reports,
error recovery files, pictures, text-based annotations, copies of
specifications, or other ancillary files related to the Segment.
Matroska Readers MUST NOT execute files stored as Attachments
elements.
21.1. Cover Art
This section defines a set of guidelines for the storage of cover art
in Matroska files. A Matroska Reader MAY use embedded cover art to
display a representational still-image depiction of the multimedia
contents of the Matroska file.
Only [JPEG] and PNG [RFC2083] image formats SHOULD be used for cover
art pictures.
There can be two different covers for a movie/album: a portrait style
(e.g., a DVD case) and a landscape style (e.g., a wide banner ad).
There can be two versions of the same cover: the normal cover and the
small cover. The dimension of the normal cover SHOULD be 600 pixels
on the smallest side (e.g., 960x600 for landscape, 600x800 for
portrait, or 600x600 for square). The dimension of the small cover
SHOULD be 120 pixels on the smallest side (e.g., 192x120 or 120x160).
Versions of cover art can be differentiated by the filename, which is
stored in the FileName element. The default filename of the normal
cover in square or portrait mode is cover.(jpg|png). When stored,
the normal cover SHOULD be the first Attachments element in storage
order. The small cover SHOULD be prefixed with "small_", such as
small_cover.(jpg|png). The landscape variant SHOULD be suffixed with
"_land", such as cover_land.(jpg|png). The filenames are case-
sensitive.
The following table provides examples of file names for cover art in
Attachments.
+======================+===================+=================+
| File Name | Image Orientation | Pixel Length of |
| | | Smallest Side |
+======================+===================+=================+
| cover.jpg | Portrait or | 600 |
| | square | |
+----------------------+-------------------+-----------------+
| small_cover.png | Portrait or | 120 |
| | square | |
+----------------------+-------------------+-----------------+
| cover_land.png | Landscape | 600 |
+----------------------+-------------------+-----------------+
| small_cover_land.jpg | Landscape | 120 |
+----------------------+-------------------+-----------------+
Table 52: Cover Art Filenames
21.2. Font Files
Font files MAY be added to a Matroska file as Attachments so that the
font file may be used to display an associated subtitle track. This
allows the presentation of a Matroska file to be consistent in
various environments where the needed fonts might not be available on
the local system.
Depending on the font format in question, each font file can contain
multiple font variants. Each font variant has a name that will be
referred to as Font Name from now on. This Font Name can be
different from the Attachment's FileName, even when disregarding the
extension. In order to select a font for display, a Matroska Player
SHOULD consider both the Font Name and the base name of the
Attachment's FileName, preferring the former when there are multiple
matches.
Subtitle codecs, such as SubStation Alpha (SSA) and Advanced
SubStation Alpha (ASS), usually refer to a font by its Font Name, not
by its filename. If none of the Attachments are a match for the Font
Name, the Matroska Player SHOULD attempt to find a system font whose
Font Name matches the one used in the subtitle track.
Since loading fonts temporarily can take a while, a Matroska Player
usually loads or installs all the fonts found in attachments so they
are ready to be used during playback. Failure to use the font
attachment might result in incorrect rendering of the subtitles.
If a selected subtitle track has some AttachmentLink elements, the
player MAY restrict its font rendering to use only these fonts.
A Matroska Player SHOULD handle the official font media types from
[RFC8081] when the system can handle the type:
* font/sfnt: Generic SFNT Font Type
* font/ttf: TrueType Font (TTF) Font Type
* font/otf: OpenType Layout (OTF) Font Type
* font/collection: Collection Font Type
* font/woff: WOFF 1.0
* font/woff2: WOFF 2.0
Fonts in Matroska existed long before [RFC8081]. A few unofficial
media types for fonts were used in existing files. Therefore, it is
RECOMMENDED for a Matroska Player to support the following legacy
media types for font attachments:
* application/x-truetype-font: TrueType fonts, equivalent to font/
ttf and sometimes font/otf
* application/x-font-ttf: TrueType fonts, equivalent to font/ttf
* application/vnd.ms-opentype: OpenType Layout fonts, equivalent to
font/otf
* application/font-sfnt: Generic SFNT Font Type, equivalent to font/
sfnt
* application/font-woff: WOFF 1.0, equivalent to font/woff
There may also be some font attachments with the application/octet-
stream media type. In that case, the Matroska Player MAY try to
guess the font type by checking the file extension of the
AttachedFile\FileName string. Common file extensions for fonts are:
* .ttf for TrueType fonts, equivalent to font/ttf
* .otf for OpenType Layout fonts, equivalent to font/otf
* .ttc for Collection fonts, equivalent to font/collection
The file extension check MUST be case-insensitive.
Matroska Writers SHOULD use a valid font media type from [RFC8081] in
the AttachedFile\FileMediaType of the font attachment. They MAY use
the media types found in older files when compatibility with older
players is necessary.
22. Cues
The Cues element provides an index of certain Cluster elements to
allow for optimized seeking to absolute timestamps within the
Segment. The Cues element contains one or many CuePoint elements,
each of which MUST reference an absolute timestamp (via the CueTime
element), a Track (via the CueTrack element), and a Segment Position
(via the CueClusterPosition element). Additional non-mandated
elements are part of the CuePoint element, such as CueDuration,
CueRelativePosition, CueCodecState, and others that provide any
Matroska Reader with additional information to use in the
optimization of seeking performance.
22.1. Recommendations
The following recommendations are provided to optimize Matroska
performance.
* Unless Matroska is used as a live stream, it SHOULD contain a Cues
element.
* For each video track, each keyframe SHOULD be referenced by a
CuePoint element.
* It is RECOMMENDED to not reference non-keyframes of video tracks
in Cues unless it references a Cluster element that contains a
CodecState element but no keyframes.
* For each subtitle track present, each subtitle frame SHOULD be
referenced by a CuePoint element with a CueDuration element.
* References to audio tracks MAY be skipped in CuePoint elements if
a video track is present. When included, the CuePoint elements
SHOULD reference audio keyframes once every 500 milliseconds at
most.
* If the referenced frame is not stored within the first SimpleBlock
or first BlockGroup within its Cluster element, then the
CueRelativePosition element SHOULD be written to reference where
in the Cluster the reference frame is stored.
* If a CuePoint element references a Cluster element that includes a
CodecState element, then that CuePoint element MUST use a
CueCodecState element.
* CuePoint elements SHOULD be numerically sorted in storage order by
the value of the CueTime element.
23. Matroska Streaming
In Matroska, there are two kinds of streaming: file access and
livestreaming.
23.1. File Access
File access can simply be reading a file located on your computer,
but it also includes accessing a file from an HTTP (web) server or
Common Internet File System (CIFS) (Windows share) server. These
protocols are usually safe from reading errors, and seeking in the
stream is possible. However, when a file is stored far away or on a
slow server, seeking can be an expensive operation and should be
avoided. When followed, the guidelines in Section 25 help reduce the
number of seeking operations for regular playback and also have the
playback start quickly without needing to read lot of data first
(like a Cues element, Attachments element, or SeekHead element).
Matroska, having a small overhead, is well suited for storing music/
videos on file servers without a big impact on the bandwidth used.
Matroska does not require the index to be loaded before playing,
which allows playback to start very quickly. The index can be loaded
only when seeking is requested the first time.
23.2. Livestreaming
Livestreaming is the equivalent of television broadcasting on the
Internet. There are two families of servers for livestreaming: RTP /
Real-Time Streaming Protocol (RTSP) and HTTP. Matroska is not meant
to be used over RTP. RTP already has timing and channel mechanisms
that would be wasted if doubled in Matroska. Additionally, having
the same information at the RTP and Matroska level would be a source
of confusion if they do not match. Livestreaming of Matroska over
file-like protocols like HTTP, QUIC, etc., is possible.
A live Matroska stream is different from a file because it usually
has no known end (only ending when the client disconnects). For
this, all bits of the "size" portion of the Segment element MUST be
set to 1. Another option is to concatenate Segment elements with
known sizes, one after the other. This solution allows a change of
codec/resolution between each segment. For example, this allows for
a switch between 4:3 and 16:9 in a television program.
When Segment elements are continuous, certain elements (like
SeekHead, Cues, Chapters, and Attachments) MUST NOT be used.
It is possible for a Matroska Player to detect that a stream is not
seekable. If the stream has neither a SeekHead list nor a Cues list
at the beginning of the stream, it SHOULD be considered non-seekable.
Even though it is possible to seek forward in the stream, it is NOT
RECOMMENDED.
In the context of live radio or web TV, it is possible to "tag" the
content while it is playing. The Tags element can be placed between
Clusters each time it is necessary. In that case, the new Tags
element MUST reset the previously encountered Tags elements and use
the new values instead.
24. Tags
24.1. Tags Precedence
Tags allow tagging all kinds of Matroska parts with very detailed
metadata in multiple languages.
Some Matroska elements also contain their own string value, like the
track Name element (Section 5.1.4.1.18) or the ChapString element
(Section 5.1.7.1.4.10).
The following Matroska elements can also be defined with tags:
* The track Name element (Section 5.1.4.1.18) corresponds to a tag
with the TagTrackUID (Section 5.1.8.1.1.3) set to the given track,
a TagName of TITLE (Section 5.1.8.1.2.1), and a TagLanguage
(Section 5.1.8.1.2.2) or TagLanguageBCP47 (Section 5.1.8.1.2.3) of
"und".
* The ChapString element (Section 5.1.7.1.4.10) corresponds to a tag
with the TagChapterUID (Section 5.1.8.1.1.5) set to the same
chapter UID, a TagName of TITLE (Section 5.1.8.1.2.1), and a
TagLanguage (Section 5.1.8.1.2.2) or TagLanguageBCP47
(Section 5.1.8.1.2.3) matching the ChapLanguage
(Section 5.1.7.1.4.11) or ChapLanguageBCP47
(Section 5.1.7.1.4.12), respectively.
* The FileDescription element (Section 5.1.6.1.1) of an attachment
corresponds to a tag with the TagAttachmentUID
(Section 5.1.8.1.1.6) set to the given attachment, a TagName of
TITLE (Section 5.1.8.1.2.1), and a TagLanguage
(Section 5.1.8.1.2.2) or TagLanguageBCP47 (Section 5.1.8.1.2.3) of
"und".
When both values exist in the file, the value found in Tags takes
precedence over the value found in the original location of the
element. For example, if you have a TrackEntry\Name element and a
tag value TITLE for that track in a Matroska Segment, the tag value
string SHOULD be used instead of the TrackEntry\Name string to
identify the track.
As the Tag element is optional, a lot of Matroska Readers do not
handle it and will not use the tags value when it's found. Thus, for
maximum compatibility, it's usually better to put the strings in the
TrackEntry, ChapterAtom, and Attachments elements and keep the tags
matching these values if tags are also used.
24.2. Tag Levels
Tag elements allow tagging information on multiple levels, with each
level having a TargetTypeValue (Section 5.1.8.1.1.1). An element for
a given TargetTypeValue also applies to the lower levels denoted by
smaller TargetTypeValue values. If an upper value doesn't apply to a
level but the actual value to use is not known, an empty TagString
(Section 5.1.8.1.2.5) or an empty TagBinary (Section 5.1.8.1.2.6)
MUST be used as the tag value for this level.
See [MatroskaTags] for more details on common tag names, types, and
descriptions.
25. Implementation Recommendations
25.1. Cluster
It is RECOMMENDED that each individual Cluster element contain no
more than five seconds or five megabytes of content.
25.2. SeekHead
It is RECOMMENDED that the first SeekHead element be followed by a
Void element to allow for the SeekHead element to be expanded to
cover new Top-Level Elements that could be added to the Matroska
file, such as Tags, Chapters, and Attachments elements.
The size of this Void element should be adjusted depending on the
Tags, Chapters, and Attachments elements in the Matroska file.
25.3. Optimum Layouts
While there can be Top-Level Elements in any order, some orderings of
elements are better than others. The following subsections detail
optimum layouts for different use cases.
25.3.1. Optimum Layout for a Muxer
This is the basic layout muxers should be using for an efficient
playback experience:
* SeekHead
* Info
* Tracks
* Chapters
* Attachments
* Tags
* Clusters
* Cues
25.3.2. Optimum Layout after Editing Tags
When tags from the previous layout need to be extended, they are
moved to the end with the extra information. The location where the
old tags were located is voided.
* SeekHead
* Info
* Tracks
* Chapters
* Attachments
* Void
* Clusters
* Cues
* Tags
25.3.3. Optimum Layout with Cues at the Front
Cues are usually a big chunk of data referencing a lot of locations
in the file. Players that want to seek in the file need to seek to
the end of the file to access these locations. It is often better if
they are placed early in the file. On the other hand, that means
players that don't intend to seek will have to read/skip these data
no matter what.
Because the Cues reference locations further in the file, it's often
complicated to allocate the proper space for that element before all
the locations are known. Therefore, this layout is rarely used:
* SeekHead
* Info
* Tracks
* Chapters
* Attachments
* Tags
* Cues
* Clusters
25.3.4. Optimum Layout for Livestreaming
In livestreaming (Section 23.2), only a few elements make sense. For
example, SeekHead and Cues are useless. All elements other than the
Clusters MUST be placed before the Clusters.
* Info
* Tracks
* Attachments (rare)
* Tags
* Clusters
26. Security Considerations
Matroska inherits security considerations from EBML [RFC8794].
Attacks on a Matroska Reader could include:
* Storage of an arbitrary and potentially executable data within an
Attachments element. Matroska Readers that extract or use data
from Matroska Attachments SHOULD check that the data adheres to
expectations or not use the attachment.
* A Matroska Attachment with an inaccurate media type.
* Damage to the Encryption and Compression fields (Section 14) that
would result in bogus binary data interpreted by the decoder.
* Chapter Codecs running unwanted commands on the host system.
The same error handling done for EBML applies to Matroska files.
Particular error handling is not covered in this specification, as
this is depends on the goal of the Matroska Readers. Matroska
Readers decide how to handle the errors whether or not they are
recoverable in their code. For example, if the checksum of the
\Segment\Tracks is invalid, some could decide to try to read the data
anyway, some will just reject the file, and most will not even check
it.
Matroska Reader implementations need to be robust against malicious
payloads. Those related to denial of service are outlined in
Section 2.1 of [RFC4732].
Although rarer, the same may apply to a Matroska Writer. Malicious
stream data must not cause the Matroska Writer to misbehave, as this
might allow an attacker access to transcoding gateways.
As an audio/video container format, a Matroska file or stream will
potentially encapsulate numerous byte streams created with a variety
of codecs. Implementers will need to consider the security
considerations of these encapsulated formats.
27. IANA Considerations
27.1. Matroska Element IDs Registry
IANA has created a new registry called the "Matroska Element IDs"
registry.
To register a new Element ID in this registry, one needs an Element
ID, an Element Name, a Change Controller, and an optional Reference
to a document describing the Element ID.
Element IDs are encoded using the VINT mechanism described in
Section 4 of [RFC8794] and can be between one and five octets long.
Five-octet Element IDs are possible only if declared in the EBML
Header.
Element IDs are described in Section 5 of [RFC8794], with the changes
in [Err7189] and [Err7191].
One-octet Matroska Element IDs (range 0x80-0xFE) are to be allocated
according to the "RFC Required" policy [RFC8126].
Two-octet Matroska Element IDs (range 0x407F-0x7FFE) are to be
allocated according to the "Specification Required" policy [RFC8126].
Two-octet Matroska Element IDs between 0x0100 and 0x407E are not
valid for use as an Element ID.
Three-octet (range 0x203FFF-0x3FFFFE) and four-octet Matroska Element
IDs (range 0x101FFFFF-0x1FFFFFFE) are to be allocated according to
the "First Come First Served" policy [RFC8126].
Three-octet Matroska Element IDs between 0x010000 and 0x203FFE are
not valid for use as an Element ID.
Four-octet Matroska Element IDs between 0x01000000 and 0x101FFFFE are
not valid for use as an Element ID.
The allowed values in the "Matroska Element IDs" registry are similar
to the ones found in the "EBML Element IDs" registry defined in
Section 17.1 of [RFC8794].
EBML Element IDs defined for the EBML Header -- as defined in
Section 17.1 of [RFC8794] -- MUST NOT be used as Matroska Element
IDs.
Given the scarcity of one-octet Element IDs, they should only be
created to save space for elements found many times in a file (for
example, BlockGroup or Chapters). The four-octet Element IDs are
mostly for synchronization of large elements. They should only be
used for such high-level elements. Elements that are not expected to
be used often should use three-octet Element IDs.
Elements found in Appendix A have an assigned Matroska Element ID for
historical reasons. These elements are not in use and SHOULD NOT be
reused unless there are no other IDs available with the desired size.
Such IDs are marked as "Reclaimed" in the "Matroska Element IDs"
registry, as they could be used for other things in the future.
Table 53 shows the initial contents of the "Matroska Element IDs"
registry. The Change Controller for the initial entries is the IETF.
+=====================+=============================+==============+
| Element ID| Element Name |Reference |
+=====================+=============================+==============+
| 0x80| ChapterDisplay |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.9 |
+---------------------+-----------------------------+--------------+
| 0x83| TrackType |RFC 9559, |
| | |Section |
| | |5.1.4.1.3 |
+---------------------+-----------------------------+--------------+
| 0x85| ChapString |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.10 |
+---------------------+-----------------------------+--------------+
| 0x86| CodecID |RFC 9559, |
| | |Section |
| | |5.1.4.1.21 |
+---------------------+-----------------------------+--------------+
| 0x88| FlagDefault |RFC 9559, |
| | |Section |
| | |5.1.4.1.5 |
+---------------------+-----------------------------+--------------+
| 0x8E| Slices |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.5) |
+---------------------+-----------------------------+--------------+
| 0x91| ChapterTimeStart |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.3 |
+---------------------+-----------------------------+--------------+
| 0x92| ChapterTimeEnd |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.4 |
+---------------------+-----------------------------+--------------+
| 0x96| CueRefTime |RFC 9559, |
| | |Section |
| | |5.1.5.1.2.8 |
+---------------------+-----------------------------+--------------+
| 0x97| CueRefCluster |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.37)|
+---------------------+-----------------------------+--------------+
| 0x98| ChapterFlagHidden |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.5 |
+---------------------+-----------------------------+--------------+
| 0x9A| FlagInterlaced |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.1 |
+---------------------+-----------------------------+--------------+
| 0x9B| BlockDuration |RFC 9559, |
| | |Section |
| | |5.1.3.5.3 |
+---------------------+-----------------------------+--------------+
| 0x9C| FlagLacing |RFC 9559, |
| | |Section |
| | |5.1.4.1.12 |
+---------------------+-----------------------------+--------------+
| 0x9D| FieldOrder |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.2 |
+---------------------+-----------------------------+--------------+
| 0x9F| Channels |RFC 9559, |
| | |Section |
| | |5.1.4.1.29.3 |
+---------------------+-----------------------------+--------------+
| 0xA0| BlockGroup |RFC 9559, |
| | |Section |
| | |5.1.3.5 |
+---------------------+-----------------------------+--------------+
| 0xA1| Block |RFC 9559, |
| | |Section |
| | |5.1.3.5.1 |
+---------------------+-----------------------------+--------------+
| 0xA2| BlockVirtual |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.3) |
+---------------------+-----------------------------+--------------+
| 0xA3| SimpleBlock |RFC 9559, |
| | |Section |
| | |5.1.3.4 |
+---------------------+-----------------------------+--------------+
| 0xA4| CodecState |RFC 9559, |
| | |Section |
| | |5.1.3.5.6 |
+---------------------+-----------------------------+--------------+
| 0xA5| BlockAdditional |RFC 9559, |
| | |Section |
| | |5.1.3.5.2.2 |
+---------------------+-----------------------------+--------------+
| 0xA6| BlockMore |RFC 9559, |
| | |Section |
| | |5.1.3.5.2.1 |
+---------------------+-----------------------------+--------------+
| 0xA7| Position |RFC 9559, |
| | |Section |
| | |5.1.3.2 |
+---------------------+-----------------------------+--------------+
| 0xAA| CodecDecodeAll |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.22)|
+---------------------+-----------------------------+--------------+
| 0xAB| PrevSize |RFC 9559, |
| | |Section |
| | |5.1.3.3 |
+---------------------+-----------------------------+--------------+
| 0xAE| TrackEntry |RFC 9559, |
| | |Section |
| | |5.1.4.1 |
+---------------------+-----------------------------+--------------+
| 0xAF| EncryptedBlock |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.15)|
+---------------------+-----------------------------+--------------+
| 0xB0| PixelWidth |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.6 |
+---------------------+-----------------------------+--------------+
| 0xB2| CueDuration |RFC 9559, |
| | |Section |
| | |5.1.5.1.2.4 |
+---------------------+-----------------------------+--------------+
| 0xB3| CueTime |RFC 9559, |
| | |Section |
| | |5.1.5.1.1 |
+---------------------+-----------------------------+--------------+
| 0xB5| SamplingFrequency |RFC 9559, |
| | |Section |
| | |5.1.4.1.29.1 |
+---------------------+-----------------------------+--------------+
| 0xB6| ChapterAtom |RFC 9559, |
| | |Section |
| | |5.1.7.1.4 |
+---------------------+-----------------------------+--------------+
| 0xB7| CueTrackPositions |RFC 9559, |
| | |Section |
| | |5.1.5.1.2 |
+---------------------+-----------------------------+--------------+
| 0xB9| FlagEnabled |RFC 9559, |
| | |Section |
| | |5.1.4.1.4 |
+---------------------+-----------------------------+--------------+
| 0xBA| PixelHeight |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.7 |
+---------------------+-----------------------------+--------------+
| 0xBB| CuePoint |RFC 9559, |
| | |Section |
| | |5.1.5.1 |
+---------------------+-----------------------------+--------------+
| 0xC0| TrickTrackUID |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.28)|
+---------------------+-----------------------------+--------------+
| 0xC1| TrickTrackSegmentUID |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.29)|
+---------------------+-----------------------------+--------------+
| 0xC4| TrickMasterTrackSegmentUID |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.32)|
+---------------------+-----------------------------+--------------+
| 0xC6| TrickTrackFlag |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.30)|
+---------------------+-----------------------------+--------------+
| 0xC7| TrickMasterTrackUID |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.31)|
+---------------------+-----------------------------+--------------+
| 0xC8| ReferenceFrame |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.12)|
+---------------------+-----------------------------+--------------+
| 0xC9| ReferenceOffset |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.13)|
+---------------------+-----------------------------+--------------+
| 0xCA| ReferenceTimestamp |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.14)|
+---------------------+-----------------------------+--------------+
| 0xCB| BlockAdditionID |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.9) |
+---------------------+-----------------------------+--------------+
| 0xCC| LaceNumber |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.7) |
+---------------------+-----------------------------+--------------+
| 0xCD| FrameNumber |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.8) |
+---------------------+-----------------------------+--------------+
| 0xCE| Delay |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.10)|
+---------------------+-----------------------------+--------------+
| 0xCF| SliceDuration |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.11)|
+---------------------+-----------------------------+--------------+
| 0xD7| TrackNumber |RFC 9559, |
| | |Section |
| | |5.1.4.1.1 |
+---------------------+-----------------------------+--------------+
| 0xDB| CueReference |RFC 9559, |
| | |Section |
| | |5.1.5.1.2.7 |
+---------------------+-----------------------------+--------------+
| 0xE0| Video |RFC 9559, |
| | |Section |
| | |5.1.4.1.28 |
+---------------------+-----------------------------+--------------+
| 0xE1| Audio |RFC 9559, |
| | |Section |
| | |5.1.4.1.29 |
+---------------------+-----------------------------+--------------+
| 0xE2| TrackOperation |RFC 9559, |
| | |Section |
| | |5.1.4.1.30 |
+---------------------+-----------------------------+--------------+
| 0xE3| TrackCombinePlanes |RFC 9559, |
| | |Section |
| | |5.1.4.1.30.1 |
+---------------------+-----------------------------+--------------+
| 0xE4| TrackPlane |RFC 9559, |
| | |Section |
| | |5.1.4.1.30.2 |
+---------------------+-----------------------------+--------------+
| 0xE5| TrackPlaneUID |RFC 9559, |
| | |Section |
| | |5.1.4.1.30.3 |
+---------------------+-----------------------------+--------------+
| 0xE6| TrackPlaneType |RFC 9559, |
| | |Section |
| | |5.1.4.1.30.4 |
+---------------------+-----------------------------+--------------+
| 0xE7| Timestamp |RFC 9559, |
| | |Section |
| | |5.1.3.1 |
+---------------------+-----------------------------+--------------+
| 0xE8| TimeSlice |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.6) |
+---------------------+-----------------------------+--------------+
| 0xE9| TrackJoinBlocks |RFC 9559, |
| | |Section |
| | |5.1.4.1.30.5 |
+---------------------+-----------------------------+--------------+
| 0xEA| CueCodecState |RFC 9559, |
| | |Section |
| | |5.1.5.1.2.6 |
+---------------------+-----------------------------+--------------+
| 0xEB| CueRefCodecState |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.39)|
+---------------------+-----------------------------+--------------+
| 0xED| TrackJoinUID |RFC 9559, |
| | |Section |
| | |5.1.4.1.30.6 |
+---------------------+-----------------------------+--------------+
| 0xEE| BlockAddID |RFC 9559, |
| | |Section |
| | |5.1.3.5.2.3 |
+---------------------+-----------------------------+--------------+
| 0xF0| CueRelativePosition |RFC 9559, |
| | |Section |
| | |5.1.5.1.2.3 |
+---------------------+-----------------------------+--------------+
| 0xF1| CueClusterPosition |RFC 9559, |
| | |Section |
| | |5.1.5.1.2.2 |
+---------------------+-----------------------------+--------------+
| 0xF7| CueTrack |RFC 9559, |
| | |Section |
| | |5.1.5.1.2.1 |
+---------------------+-----------------------------+--------------+
| 0xFA| ReferencePriority |RFC 9559, |
| | |Section |
| | |5.1.3.5.4 |
+---------------------+-----------------------------+--------------+
| 0xFB| ReferenceBlock |RFC 9559, |
| | |Section |
| | |5.1.3.5.5 |
+---------------------+-----------------------------+--------------+
| 0xFD| ReferenceVirtual |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.4) |
+---------------------+-----------------------------+--------------+
| 0xFF| Reserved |RFC 9559 |
+---------------------+-----------------------------+--------------+
| 0x0100-0x407E| Not valid for use as an |RFC 9559, |
| | Element ID |Section 27.1 |
+---------------------+-----------------------------+--------------+
| 0x41A4| BlockAddIDName |RFC 9559, |
| | |Section |
| | |5.1.4.1.17.2 |
+---------------------+-----------------------------+--------------+
| 0x41E4| BlockAdditionMapping |RFC 9559, |
| | |Section |
| | |5.1.4.1.17 |
+---------------------+-----------------------------+--------------+
| 0x41E7| BlockAddIDType |RFC 9559, |
| | |Section |
| | |5.1.4.1.17.3 |
+---------------------+-----------------------------+--------------+
| 0x41ED| BlockAddIDExtraData |RFC 9559, |
| | |Section |
| | |5.1.4.1.17.4 |
+---------------------+-----------------------------+--------------+
| 0x41F0| BlockAddIDValue |RFC 9559, |
| | |Section |
| | |5.1.4.1.17.1 |
+---------------------+-----------------------------+--------------+
| 0x4254| ContentCompAlgo |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.6 |
+---------------------+-----------------------------+--------------+
| 0x4255| ContentCompSettings |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.7 |
+---------------------+-----------------------------+--------------+
| 0x437C| ChapLanguage |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.11 |
+---------------------+-----------------------------+--------------+
| 0x437D| ChapLanguageBCP47 |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.12 |
+---------------------+-----------------------------+--------------+
| 0x437E| ChapCountry |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.13 |
+---------------------+-----------------------------+--------------+
| 0x4444| SegmentFamily |RFC 9559, |
| | |Section |
| | |5.1.2.7 |
+---------------------+-----------------------------+--------------+
| 0x4461| DateUTC |RFC 9559, |
| | |Section |
| | |5.1.2.11 |
+---------------------+-----------------------------+--------------+
| 0x447A| TagLanguage |RFC 9559, |
| | |Section |
| | |5.1.8.1.2.2 |
+---------------------+-----------------------------+--------------+
| 0x447B| TagLanguageBCP47 |RFC 9559, |
| | |Section |
| | |5.1.8.1.2.3 |
+---------------------+-----------------------------+--------------+
| 0x4484| TagDefault |RFC 9559, |
| | |Section |
| | |5.1.8.1.2.4 |
+---------------------+-----------------------------+--------------+
| 0x4485| TagBinary |RFC 9559, |
| | |Section |
| | |5.1.8.1.2.6 |
+---------------------+-----------------------------+--------------+
| 0x4487| TagString |RFC 9559, |
| | |Section |
| | |5.1.8.1.2.5 |
+---------------------+-----------------------------+--------------+
| 0x4489| Duration |RFC 9559, |
| | |Section |
| | |5.1.2.10 |
+---------------------+-----------------------------+--------------+
| 0x44B4| TagDefaultBogus |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.43)|
+---------------------+-----------------------------+--------------+
| 0x450D| ChapProcessPrivate |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.16 |
+---------------------+-----------------------------+--------------+
| 0x45A3| TagName |RFC 9559, |
| | |Section |
| | |5.1.8.1.2.1 |
+---------------------+-----------------------------+--------------+
| 0x45B9| EditionEntry |RFC 9559, |
| | |Section |
| | |5.1.7.1 |
+---------------------+-----------------------------+--------------+
| 0x45BC| EditionUID |RFC 9559, |
| | |Section |
| | |5.1.7.1.1 |
+---------------------+-----------------------------+--------------+
| 0x45DB| EditionFlagDefault |RFC 9559, |
| | |Section |
| | |5.1.7.1.2 |
+---------------------+-----------------------------+--------------+
| 0x45DD| EditionFlagOrdered |RFC 9559, |
| | |Section |
| | |5.1.7.1.3 |
+---------------------+-----------------------------+--------------+
| 0x465C| FileData |RFC 9559, |
| | |Section |
| | |5.1.6.1.4 |
+---------------------+-----------------------------+--------------+
| 0x4660| FileMediaType |RFC 9559, |
| | |Section |
| | |5.1.6.1.3 |
+---------------------+-----------------------------+--------------+
| 0x4661| FileUsedStartTime |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.41)|
+---------------------+-----------------------------+--------------+
| 0x4662| FileUsedEndTime |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.42)|
+---------------------+-----------------------------+--------------+
| 0x466E| FileName |RFC 9559, |
| | |Section |
| | |5.1.6.1.2 |
+---------------------+-----------------------------+--------------+
| 0x4675| FileReferral |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.40)|
+---------------------+-----------------------------+--------------+
| 0x467E| FileDescription |RFC 9559, |
| | |Section |
| | |5.1.6.1.1 |
+---------------------+-----------------------------+--------------+
| 0x46AE| FileUID |RFC 9559, |
| | |Section |
| | |5.1.6.1.5 |
+---------------------+-----------------------------+--------------+
| 0x47E1| ContentEncAlgo |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.9 |
+---------------------+-----------------------------+--------------+
| 0x47E2| ContentEncKeyID |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.10 |
+---------------------+-----------------------------+--------------+
| 0x47E3| ContentSignature |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.33)|
+---------------------+-----------------------------+--------------+
| 0x47E4| ContentSigKeyID |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.34)|
+---------------------+-----------------------------+--------------+
| 0x47E5| ContentSigAlgo |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.35)|
+---------------------+-----------------------------+--------------+
| 0x47E6| ContentSigHashAlgo |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.36)|
+---------------------+-----------------------------+--------------+
| 0x47E7| ContentEncAESSettings |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.11 |
+---------------------+-----------------------------+--------------+
| 0x47E8| AESSettingsCipherMode |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.12 |
+---------------------+-----------------------------+--------------+
| 0x4D80| MuxingApp |RFC 9559, |
| | |Section |
| | |5.1.2.13 |
+---------------------+-----------------------------+--------------+
| 0x4DBB| Seek |RFC 9559, |
| | |Section |
| | |5.1.1.1 |
+---------------------+-----------------------------+--------------+
| 0x5031| ContentEncodingOrder |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.2 |
+---------------------+-----------------------------+--------------+
| 0x5032| ContentEncodingScope |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.3 |
+---------------------+-----------------------------+--------------+
| 0x5033| ContentEncodingType |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.4 |
+---------------------+-----------------------------+--------------+
| 0x5034| ContentCompression |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.5 |
+---------------------+-----------------------------+--------------+
| 0x5035| ContentEncryption |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.8 |
+---------------------+-----------------------------+--------------+
| 0x535F| CueRefNumber |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.38)|
+---------------------+-----------------------------+--------------+
| 0x536E| Name |RFC 9559, |
| | |Section |
| | |5.1.4.1.18 |
+---------------------+-----------------------------+--------------+
| 0x5378| CueBlockNumber |RFC 9559, |
| | |Section |
| | |5.1.5.1.2.5 |
+---------------------+-----------------------------+--------------+
| 0x537F| TrackOffset |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.18)|
+---------------------+-----------------------------+--------------+
| 0x53AB| SeekID |RFC 9559, |
| | |Section |
| | |5.1.1.1.1 |
+---------------------+-----------------------------+--------------+
| 0x53AC| SeekPosition |RFC 9559, |
| | |Section |
| | |5.1.1.1.2 |
+---------------------+-----------------------------+--------------+
| 0x53B8| StereoMode |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.3 |
+---------------------+-----------------------------+--------------+
| 0x53B9| OldStereoMode |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.5 |
+---------------------+-----------------------------+--------------+
| 0x53C0| AlphaMode |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.4 |
+---------------------+-----------------------------+--------------+
| 0x54AA| PixelCropBottom |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.8 |
+---------------------+-----------------------------+--------------+
| 0x54B0| DisplayWidth |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.12 |
+---------------------+-----------------------------+--------------+
| 0x54B2| DisplayUnit |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.14 |
+---------------------+-----------------------------+--------------+
| 0x54B3| AspectRatioType |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.24)|
+---------------------+-----------------------------+--------------+
| 0x54BA| DisplayHeight |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.13 |
+---------------------+-----------------------------+--------------+
| 0x54BB| PixelCropTop |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.9 |
+---------------------+-----------------------------+--------------+
| 0x54CC| PixelCropLeft |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.10 |
+---------------------+-----------------------------+--------------+
| 0x54DD| PixelCropRight |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.11 |
+---------------------+-----------------------------+--------------+
| 0x55AA| FlagForced |RFC 9559, |
| | |Section |
| | |5.1.4.1.6 |
+---------------------+-----------------------------+--------------+
| 0x55AB| FlagHearingImpaired |RFC 9559, |
| | |Section |
| | |5.1.4.1.7 |
+---------------------+-----------------------------+--------------+
| 0x55AC| FlagVisualImpaired |RFC 9559, |
| | |Section |
| | |5.1.4.1.8 |
+---------------------+-----------------------------+--------------+
| 0x55AD| FlagTextDescriptions |RFC 9559, |
| | |Section |
| | |5.1.4.1.9 |
+---------------------+-----------------------------+--------------+
| 0x55AE| FlagOriginal |RFC 9559, |
| | |Section |
| | |5.1.4.1.10 |
+---------------------+-----------------------------+--------------+
| 0x55AF| FlagCommentary |RFC 9559, |
| | |Section |
| | |5.1.4.1.11 |
+---------------------+-----------------------------+--------------+
| 0x55B0| Colour |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.16 |
+---------------------+-----------------------------+--------------+
| 0x55B1| MatrixCoefficients |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.17 |
+---------------------+-----------------------------+--------------+
| 0x55B2| BitsPerChannel |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.18 |
+---------------------+-----------------------------+--------------+
| 0x55B3| ChromaSubsamplingHorz |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.19 |
+---------------------+-----------------------------+--------------+
| 0x55B4| ChromaSubsamplingVert |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.20 |
+---------------------+-----------------------------+--------------+
| 0x55B5| CbSubsamplingHorz |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.21 |
+---------------------+-----------------------------+--------------+
| 0x55B6| CbSubsamplingVert |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.22 |
+---------------------+-----------------------------+--------------+
| 0x55B7| ChromaSitingHorz |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.23 |
+---------------------+-----------------------------+--------------+
| 0x55B8| ChromaSitingVert |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.24 |
+---------------------+-----------------------------+--------------+
| 0x55B9| Range |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.25 |
+---------------------+-----------------------------+--------------+
| 0x55BA| TransferCharacteristics |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.26 |
+---------------------+-----------------------------+--------------+
| 0x55BB| Primaries |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.27 |
+---------------------+-----------------------------+--------------+
| 0x55BC| MaxCLL |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.28 |
+---------------------+-----------------------------+--------------+
| 0x55BD| MaxFALL |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.29 |
+---------------------+-----------------------------+--------------+
| 0x55D0| MasteringMetadata |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.30 |
+---------------------+-----------------------------+--------------+
| 0x55D1| PrimaryRChromaticityX |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.31 |
+---------------------+-----------------------------+--------------+
| 0x55D2| PrimaryRChromaticityY |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.32 |
+---------------------+-----------------------------+--------------+
| 0x55D3| PrimaryGChromaticityX |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.33 |
+---------------------+-----------------------------+--------------+
| 0x55D4| PrimaryGChromaticityY |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.34 |
+---------------------+-----------------------------+--------------+
| 0x55D5| PrimaryBChromaticityX |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.35 |
+---------------------+-----------------------------+--------------+
| 0x55D6| PrimaryBChromaticityY |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.36 |
+---------------------+-----------------------------+--------------+
| 0x55D7| WhitePointChromaticityX |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.37 |
+---------------------+-----------------------------+--------------+
| 0x55D8| WhitePointChromaticityY |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.38 |
+---------------------+-----------------------------+--------------+
| 0x55D9| LuminanceMax |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.39 |
+---------------------+-----------------------------+--------------+
| 0x55DA| LuminanceMin |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.40 |
+---------------------+-----------------------------+--------------+
| 0x55EE| MaxBlockAdditionID |RFC 9559, |
| | |Section |
| | |5.1.4.1.16 |
+---------------------+-----------------------------+--------------+
| 0x5654| ChapterStringUID |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.2 |
+---------------------+-----------------------------+--------------+
| 0x56AA| CodecDelay |RFC 9559, |
| | |Section |
| | |5.1.4.1.25 |
+---------------------+-----------------------------+--------------+
| 0x56BB| SeekPreRoll |RFC 9559, |
| | |Section |
| | |5.1.4.1.26 |
+---------------------+-----------------------------+--------------+
| 0x5741| WritingApp |RFC 9559, |
| | |Section |
| | |5.1.2.14 |
+---------------------+-----------------------------+--------------+
| 0x5854| SilentTracks |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.1) |
+---------------------+-----------------------------+--------------+
| 0x58D7| SilentTrackNumber |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.2) |
+---------------------+-----------------------------+--------------+
| 0x61A7| AttachedFile |RFC 9559, |
| | |Section |
| | |5.1.6.1 |
+---------------------+-----------------------------+--------------+
| 0x6240| ContentEncoding |RFC 9559, |
| | |Section |
| | |5.1.4.1.31.1 |
+---------------------+-----------------------------+--------------+
| 0x6264| BitDepth |RFC 9559, |
| | |Section |
| | |5.1.4.1.29.4 |
+---------------------+-----------------------------+--------------+
| 0x63A2| CodecPrivate |RFC 9559, |
| | |Section |
| | |5.1.4.1.22 |
+---------------------+-----------------------------+--------------+
| 0x63C0| Targets |RFC 9559, |
| | |Section |
| | |5.1.8.1.1 |
+---------------------+-----------------------------+--------------+
| 0x63C3| ChapterPhysicalEquiv |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.8 |
+---------------------+-----------------------------+--------------+
| 0x63C4| TagChapterUID |RFC 9559, |
| | |Section |
| | |5.1.8.1.1.5 |
+---------------------+-----------------------------+--------------+
| 0x63C5| TagTrackUID |RFC 9559, |
| | |Section |
| | |5.1.8.1.1.3 |
+---------------------+-----------------------------+--------------+
| 0x63C6| TagAttachmentUID |RFC 9559, |
| | |Section |
| | |5.1.8.1.1.6 |
+---------------------+-----------------------------+--------------+
| 0x63C9| TagEditionUID |RFC 9559, |
| | |Section |
| | |5.1.8.1.1.4 |
+---------------------+-----------------------------+--------------+
| 0x63CA| TargetType |RFC 9559, |
| | |Section |
| | |5.1.8.1.1.2 |
+---------------------+-----------------------------+--------------+
| 0x6624| TrackTranslate |RFC 9559, |
| | |Section |
| | |5.1.4.1.27 |
+---------------------+-----------------------------+--------------+
| 0x66A5| TrackTranslateTrackID |RFC 9559, |
| | |Section |
| | |5.1.4.1.27.1 |
+---------------------+-----------------------------+--------------+
| 0x66BF| TrackTranslateCodec |RFC 9559, |
| | |Section |
| | |5.1.4.1.27.2 |
+---------------------+-----------------------------+--------------+
| 0x66FC| TrackTranslateEditionUID |RFC 9559, |
| | |Section |
| | |5.1.4.1.27.3 |
+---------------------+-----------------------------+--------------+
| 0x67C8| SimpleTag |RFC 9559, |
| | |Section |
| | |5.1.8.1.2 |
+---------------------+-----------------------------+--------------+
| 0x68CA| TargetTypeValue |RFC 9559, |
| | |Section |
| | |5.1.8.1.1.1 |
+---------------------+-----------------------------+--------------+
| 0x6911| ChapProcessCommand |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.17 |
+---------------------+-----------------------------+--------------+
| 0x6922| ChapProcessTime |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.18 |
+---------------------+-----------------------------+--------------+
| 0x6924| ChapterTranslate |RFC 9559, |
| | |Section |
| | |5.1.2.8 |
+---------------------+-----------------------------+--------------+
| 0x6933| ChapProcessData |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.19 |
+---------------------+-----------------------------+--------------+
| 0x6944| ChapProcess |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.14 |
+---------------------+-----------------------------+--------------+
| 0x6955| ChapProcessCodecID |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.15 |
+---------------------+-----------------------------+--------------+
| 0x69A5| ChapterTranslateID |RFC 9559, |
| | |Section |
| | |5.1.2.8.1 |
+---------------------+-----------------------------+--------------+
| 0x69BF| ChapterTranslateCodec |RFC 9559, |
| | |Section |
| | |5.1.2.8.2 |
+---------------------+-----------------------------+--------------+
| 0x69FC| ChapterTranslateEditionUID |RFC 9559, |
| | |Section |
| | |5.1.2.8.3 |
+---------------------+-----------------------------+--------------+
| 0x6D80| ContentEncodings |RFC 9559, |
| | |Section |
| | |5.1.4.1.31 |
+---------------------+-----------------------------+--------------+
| 0x6DE7| MinCache |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.16)|
+---------------------+-----------------------------+--------------+
| 0x6DF8| MaxCache |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.17)|
+---------------------+-----------------------------+--------------+
| 0x6E67| ChapterSegmentUUID |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.6 |
+---------------------+-----------------------------+--------------+
| 0x6EBC| ChapterSegmentEditionUID |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.7 |
+---------------------+-----------------------------+--------------+
| 0x6FAB| TrackOverlay |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.23)|
+---------------------+-----------------------------+--------------+
| 0x7373| Tag |RFC 9559, |
| | |Section |
| | |5.1.8.1 |
+---------------------+-----------------------------+--------------+
| 0x7384| SegmentFilename |RFC 9559, |
| | |Section |
| | |5.1.2.2 |
+---------------------+-----------------------------+--------------+
| 0x73A4| SegmentUUID |RFC 9559, |
| | |Section |
| | |5.1.2.1 |
+---------------------+-----------------------------+--------------+
| 0x73C4| ChapterUID |RFC 9559, |
| | |Section |
| | |5.1.7.1.4.1 |
+---------------------+-----------------------------+--------------+
| 0x73C5| TrackUID |RFC 9559, |
| | |Section |
| | |5.1.4.1.2 |
+---------------------+-----------------------------+--------------+
| 0x7446| AttachmentLink |RFC 9559, |
| | |Section |
| | |5.1.4.1.24 |
+---------------------+-----------------------------+--------------+
| 0x75A1| BlockAdditions |RFC 9559, |
| | |Section |
| | |5.1.3.5.2 |
+---------------------+-----------------------------+--------------+
| 0x75A2| DiscardPadding |RFC 9559, |
| | |Section |
| | |5.1.3.5.7 |
+---------------------+-----------------------------+--------------+
| 0x7670| Projection |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.41 |
+---------------------+-----------------------------+--------------+
| 0x7671| ProjectionType |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.42 |
+---------------------+-----------------------------+--------------+
| 0x7672| ProjectionPrivate |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.43 |
+---------------------+-----------------------------+--------------+
| 0x7673| ProjectionPoseYaw |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.44 |
+---------------------+-----------------------------+--------------+
| 0x7674| ProjectionPosePitch |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.45 |
+---------------------+-----------------------------+--------------+
| 0x7675| ProjectionPoseRoll |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.46 |
+---------------------+-----------------------------+--------------+
| 0x78B5| OutputSamplingFrequency |RFC 9559, |
| | |Section |
| | |5.1.4.1.29.2 |
+---------------------+-----------------------------+--------------+
| 0x7BA9| Title |RFC 9559, |
| | |Section |
| | |5.1.2.12 |
+---------------------+-----------------------------+--------------+
| 0x7D7B| ChannelPositions |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.27)|
+---------------------+-----------------------------+--------------+
| 0x7FFF| Reserved |RFC 9559 |
+---------------------+-----------------------------+--------------+
| 0x010000-0x203FFE| Not valid for use as an |RFC 9559, |
| | Element ID |Section 27.1 |
+---------------------+-----------------------------+--------------+
| 0x22B59C| Language |RFC 9559, |
| | |Section |
| | |5.1.4.1.19 |
+---------------------+-----------------------------+--------------+
| 0x22B59D| LanguageBCP47 |RFC 9559, |
| | |Section |
| | |5.1.4.1.20 |
+---------------------+-----------------------------+--------------+
| 0x23314F| TrackTimestampScale |RFC 9559, |
| | |Section |
| | |5.1.4.1.15 |
+---------------------+-----------------------------+--------------+
| 0x234E7A| DefaultDecodedFieldDuration |RFC 9559, |
| | |Section |
| | |5.1.4.1.14 |
+---------------------+-----------------------------+--------------+
| 0x2383E3| FrameRate |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.26)|
+---------------------+-----------------------------+--------------+
| 0x23E383| DefaultDuration |RFC 9559, |
| | |Section |
| | |5.1.4.1.13 |
+---------------------+-----------------------------+--------------+
| 0x258688| CodecName |RFC 9559, |
| | |Section |
| | |5.1.4.1.23 |
+---------------------+-----------------------------+--------------+
| 0x26B240| CodecDownloadURL |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.21)|
+---------------------+-----------------------------+--------------+
| 0x2AD7B1| TimestampScale |RFC 9559, |
| | |Section |
| | |5.1.2.9 |
+---------------------+-----------------------------+--------------+
| 0x2EB524| UncompressedFourCC |RFC 9559, |
| | |Section |
| | |5.1.4.1.28.15 |
+---------------------+-----------------------------+--------------+
| 0x2FB523| GammaValue |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.25)|
+---------------------+-----------------------------+--------------+
| 0x3A9697| CodecSettings |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.19)|
+---------------------+-----------------------------+--------------+
| 0x3B4040| CodecInfoURL |Reclaimed (RFC|
| | |9559, |
| | |Appendix A.20)|
+---------------------+-----------------------------+--------------+
| 0x3C83AB| PrevFilename |RFC 9559, |
| | |Section |
| | |5.1.2.4 |
+---------------------+-----------------------------+--------------+
| 0x3CB923| PrevUUID |RFC 9559, |
| | |Section |
| | |5.1.2.3 |
+---------------------+-----------------------------+--------------+
| 0x3E83BB| NextFilename |RFC 9559, |
| | |Section |
| | |5.1.2.6 |
+---------------------+-----------------------------+--------------+
| 0x3EB923| NextUUID |RFC 9559, |
| | |Section |
| | |5.1.2.5 |
+---------------------+-----------------------------+--------------+
| 0x3FFFFF| Reserved |RFC 9559 |
+---------------------+-----------------------------+--------------+
|0x01000000-0x101FFFFE| Not valid for use as an |RFC 9559, |
| | Element ID |Section 27.1 |
+---------------------+-----------------------------+--------------+
| 0x1043A770| Chapters |RFC 9559, |
| | |Section 5.1.7 |
+---------------------+-----------------------------+--------------+
| 0x114D9B74| SeekHead |RFC 9559, |
| | |Section 5.1.1 |
+---------------------+-----------------------------+--------------+
| 0x1254C367| Tags |RFC 9559, |
| | |Section 5.1.8 |
+---------------------+-----------------------------+--------------+
| 0x1549A966| Info |RFC 9559, |
| | |Section 5.1.2 |
+---------------------+-----------------------------+--------------+
| 0x1654AE6B| Tracks |RFC 9559, |
| | |Section 5.1.4 |
+---------------------+-----------------------------+--------------+
| 0x18538067| Segment |RFC 9559, |
| | |Section 5.1 |
+---------------------+-----------------------------+--------------+
| 0x1941A469| Attachments |RFC 9559, |
| | |Section 5.1.6 |
+---------------------+-----------------------------+--------------+
| 0x1C53BB6B| Cues |RFC 9559, |
| | |Section 5.1.5 |
+---------------------+-----------------------------+--------------+
| 0x1F43B675| Cluster |RFC 9559, |
| | |Section 5.1.3 |
+---------------------+-----------------------------+--------------+
| 0x1FFFFFFF| Reserved |RFC 9559 |
+---------------------+-----------------------------+--------------+
Table 53: Initial Contents of "Matroska Element IDs" Registry
27.2. Matroska Compression Algorithms Registry
IANA has created a new registry called the "Matroska Compression
Algorithms" registry. The values correspond to the unsigned integer
ContentCompAlgo value described in Section 5.1.4.1.31.6.
To register a new Compression Algorithm in this registry, one needs a
Compression Algorithm value, a description, a Change Controller, and
a Reference to a document describing the Compression Algorithm.
The Compression Algorithms are to be allocated according to the
"Specification Required" policy [RFC8126]. Available values range
from 4-18446744073709551615.
Table 54 shows the initial contents of the "Matroska Compression
Algorithms" registry. The Change Controller for the initial entries
is the IETF.
+=======================+=============+===================+
| Compression Algorithm | Description | Reference |
+=======================+=============+===================+
| 0 | zlib | RFC 9559, Section |
| | | 5.1.4.1.31.6 |
+-----------------------+-------------+-------------------+
| 1 | bzlib | RFC 9559, Section |
| | | 5.1.4.1.31.6 |
+-----------------------+-------------+-------------------+
| 2 | lzo1x | RFC 9559, Section |
| | | 5.1.4.1.31.6 |
+-----------------------+-------------+-------------------+
| 3 | Header | RFC 9559, Section |
| | Stripping | 5.1.4.1.31.6 |
+-----------------------+-------------+-------------------+
Table 54: Initial Contents of "Matroska Compression
Algorithms" Registry
27.3. Matroska Encryption Algorithms Registry
IANA has created a new registry called the "Matroska Encryption
Algorithms" registry. The values correspond to the unsigned integer
ContentEncAlgo value described in Section 5.1.4.1.31.9.
To register a new Encryption Algorithm in this registry, one needs an
Encryption Algorithm value, a description, a Change Controller, and
an optional Reference to a document describing the Encryption
Algorithm.
The Encryption Algorithms are to be allocated according to the "First
Come First Served" policy [RFC8126]. Available values range from
6-18446744073709551615.
Table 55 shows the initial contents of the "Matroska Encryption
Algorithms" registry. The Change Controller for the initial entries
is the IETF.
+======================+===============+===================+
| Encryption Algorithm | Description | Reference |
+======================+===============+===================+
| 0 | Not encrypted | RFC 9559, Section |
| | | 5.1.4.1.31.9 |
+----------------------+---------------+-------------------+
| 1 | DES | RFC 9559, Section |
| | | 5.1.4.1.31.9 |
+----------------------+---------------+-------------------+
| 2 | 3DES | RFC 9559, Section |
| | | 5.1.4.1.31.9 |
+----------------------+---------------+-------------------+
| 3 | Twofish | RFC 9559, Section |
| | | 5.1.4.1.31.9 |
+----------------------+---------------+-------------------+
| 4 | Blowfish | RFC 9559, Section |
| | | 5.1.4.1.31.9 |
+----------------------+---------------+-------------------+
| 5 | AES | RFC 9559, Section |
| | | 5.1.4.1.31.9 |
+----------------------+---------------+-------------------+
Table 55: Initial Contents of "Matroska Encryption
Algorithms" Registry
27.4. Matroska AES Cipher Modes Registry
IANA has created a new registry called the "Matroska AES Cipher
Modes" registry. The values correspond to the unsigned integer
AESSettingsCipherMode value described in Section 5.1.4.1.31.12.
To register a new AES Cipher Mode in this registry, one needs an AES
Cipher Mode value, a description, a Change Controller, and an
optional Reference to a document describing the AES Cipher Mode.
The AES Cipher Modes are to be allocated according to the "First Come
First Served" policy [RFC8126]. Available values range from
3-18446744073709551615.
The value 0 is not valid for use as an AES Cipher Mode.
Table 56 shows the initial contents of the "Matroska AES Cipher
Modes" registry. The Change Controller for the initial entries is
the IETF.
+=================+======================+===================+
| AES Cipher Mode | Description | Reference |
+=================+======================+===================+
| 0 | Not valid for use as | RFC 9559, Section |
| | an AES Cipher Mode | 5.1.4.1.31.12 |
+-----------------+----------------------+-------------------+
| 1 | AES-CTR | RFC 9559, Section |
| | | 5.1.4.1.31.12 |
+-----------------+----------------------+-------------------+
| 2 | AES-CBC | RFC 9559, Section |
| | | 5.1.4.1.31.12 |
+-----------------+----------------------+-------------------+
Table 56: Initial Contents of "Matroska AES Cipher Modes"
Registry
27.5. Matroska Content Encoding Scopes Registry
IANA has created a new registry called the "Matroska Content Encoding
Scopes" registry. The values correspond to the unsigned integer
ContentEncodingScope value described in Section 5.1.4.1.31.3.
To register a new Content Encoding Scope in this registry, one needs
a Content Encoding Scope value, a description, a Change Controller,
and a Reference to a document describing the Content Encoding Scope.
The Content Encoding Scopes are to be allocated according to the
"Specification Required" policy [RFC8126]. Available values range
from 0x8-0x8000000000000000.
The Content Encoding Scope is a bit-field value, so only power of 2
values can be registered.
The value 0 is not valid for use as a Content Encoding Scope.
Table 57 shows the initial contents of the "Matroska Content Encoding
Scopes" registry. The Change Controller for the initial entries is
the IETF.
+================+========================+===================+
| Content | Description | Reference |
| Encoding Scope | | |
+================+========================+===================+
| 0x0 | Not valid for use as a | RFC 9559, Section |
| | Content Encoding Scope | 5.1.4.1.31.3 |
+----------------+------------------------+-------------------+
| 0x1 | Block | RFC 9559, Section |
| | | 5.1.4.1.31.3 |
+----------------+------------------------+-------------------+
| 0x2 | Private | RFC 9559, Section |
| | | 5.1.4.1.31.3 |
+----------------+------------------------+-------------------+
| 0x4 | Next | RFC 9559, Section |
| | | 5.1.4.1.31.3 |
+----------------+------------------------+-------------------+
Table 57: Initial Contents of "Matroska Content Encoding
Scopes" Registry
27.6. Matroska Content Encoding Types Registry
IANA has created a new registry called the "Matroska Content Encoding
Types" registry. The values correspond to the unsigned integer
ContentEncodingType value described in Section 5.1.4.1.31.4.
To register a new Content Encoding Type in this registry, one needs a
Content Encoding Type value, a description, a Change Controller, and
a Reference to a document describing the Content Encoding Type.
The Content Encoding Types are to be allocated according to the
"Specification Required" policy [RFC8126]. Available values range
from 2-18446744073709551615.
Table 58 shows the initial contents of the "Matroska Content Encoding
Types" registry. The Change Controller for the initial entries is
the IETF.
+=======================+=============+===================+
| Content Encoding Type | Description | Reference |
+=======================+=============+===================+
| 0 | Compression | RFC 9559, Section |
| | | 5.1.4.1.31.4 |
+-----------------------+-------------+-------------------+
| 1 | Encryption | RFC 9559, Section |
| | | 5.1.4.1.31.4 |
+-----------------------+-------------+-------------------+
Table 58: Initial Contents of "Matroska Content
Encoding Types" Registry
27.7. Matroska Stereo Modes Registry
IANA has created a new registry called the "Matroska Stereo Modes"
registry. The values correspond to the unsigned integer StereoMode
value described in Section 5.1.4.1.28.3.
To register a new Stereo Mode in this registry, one needs a Stereo
Mode value, a description, a Change Controller, and a Reference to a
document describing the Stereo Mode.
The Stereo Modes are to be allocated according to the "Specification
Required" policy [RFC8126]. Available values range from
15-18446744073709551615.
Table 59 shows the initial contents of the "Matroska Stereo Modes"
registry. The Change Controller for the initial entries is the IETF.
+=============+============================+===================+
| Stereo Mode | Description | Reference |
+=============+============================+===================+
| 0 | mono | RFC 9559, Section |
| | | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 1 | side by side (left eye | RFC 9559, Section |
| | first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 2 | top - bottom (right eye is | RFC 9559, Section |
| | first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 3 | top - bottom (left eye is | RFC 9559, Section |
| | first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 4 | checkboard (right eye is | RFC 9559, Section |
| | first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 5 | checkboard (left eye is | RFC 9559, Section |
| | first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 6 | row interleaved (right eye | RFC 9559, Section |
| | is first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 7 | row interleaved (left eye | RFC 9559, Section |
| | is first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 8 | column interleaved (right | RFC 9559, Section |
| | eye is first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 9 | column interleaved (left | RFC 9559, Section |
| | eye is first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 10 | anaglyph (cyan/red) | RFC 9559, Section |
| | | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 11 | side by side (right eye | RFC 9559, Section |
| | first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 12 | anaglyph (green/magenta) | RFC 9559, Section |
| | | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 13 | both eyes laced in one | RFC 9559, Section |
| | Block (left eye is first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
| 14 | both eyes laced in one | RFC 9559, Section |
| | Block (right eye is first) | 5.1.4.1.28.3 |
+-------------+----------------------------+-------------------+
Table 59: Initial Contents of "Matroska Stereo Modes" Registry
27.8. Matroska Alpha Modes Registry
IANA has created a new registry called the "Matroska Alpha Modes"
registry. The values correspond to the unsigned integer AlphaMode
value described in Section 5.1.4.1.28.4.
To register a new Alpha Mode in this registry, one needs an Alpha
Mode value, a description, a Change Controller, and an optional
Reference to a document describing the Alpha Mode.
The Alpha Modes are to be allocated according to the "First Come
First Served" policy [RFC8126]. Available values range from
2-18446744073709551615.
Table 60 shows the initial contents of the "Matroska Alpha Modes"
registry. The Change Controller for the initial entries is the IETF.
+============+=============+================================+
| Alpha Mode | Description | Reference |
+============+=============+================================+
| 0 | none | RFC 9559, Section 5.1.4.1.28.4 |
+------------+-------------+--------------------------------+
| 1 | present | RFC 9559, Section 5.1.4.1.28.4 |
+------------+-------------+--------------------------------+
Table 60: Initial Contents of "Matroska Alpha Modes" Registry
27.9. Matroska Display Units Registry
IANA has created a new registry called the "Matroska Display Units"
registry. The values correspond to the unsigned integer DisplayUnit
value described in Section 5.1.4.1.28.14.
To register a new Display Unit in this registry, one needs a Display
Unit value, a description, a Change Controller, and a Reference to a
document describing the Display Unit.
The Display Units are to be allocated according to the "Specification
Required" policy [RFC8126]. Available values range from
5-18446744073709551615.
Table 61 shows the initial contents of the "Matroska Display Units"
registry. The Change Controller for the initial entries is the IETF.
+==============+==============+=================================+
| Display Unit | Description | Reference |
+==============+==============+=================================+
| 0 | pixels | RFC 9559, Section 5.1.4.1.28.14 |
+--------------+--------------+---------------------------------+
| 1 | centimeters | RFC 9559, Section 5.1.4.1.28.14 |
+--------------+--------------+---------------------------------+
| 2 | inches | RFC 9559, Section 5.1.4.1.28.14 |
+--------------+--------------+---------------------------------+
| 3 | display | RFC 9559, Section 5.1.4.1.28.14 |
| | aspect ratio | |
+--------------+--------------+---------------------------------+
| 4 | unknown | RFC 9559, Section 5.1.4.1.28.14 |
+--------------+--------------+---------------------------------+
Table 61: Initial Contents of "Matroska Display Units" Registry
27.10. Matroska Horizontal Chroma Sitings Registry
IANA has created a new registry called the "Matroska Horizontal
Chroma Sitings" registry. The values correspond to the unsigned
integer ChromaSitingHorz value described in Section 5.1.4.1.28.23.
To register a new Horizontal Chroma Siting in this registry, one
needs a Horizontal Chroma Siting value, a description, a Change
Controller, and an optional Reference to a document describing the
Horizontal Chroma Siting.
The Horizontal Chroma Sitings are to be allocated according to the
"First Come First Served" policy [RFC8126]. Available values range
from 3-18446744073709551615.
Table 62 shows the initial contents of the "Matroska Horizontal
Chroma Sitings" registry. The Change Controller for the initial
entries is the IETF.
+==========================+=============+===================+
| Horizontal Chroma Siting | Description | Reference |
+==========================+=============+===================+
| 0 | unspecified | RFC 9559, Section |
| | | 5.1.4.1.28.23 |
+--------------------------+-------------+-------------------+
| 1 | left | RFC 9559, Section |
| | collocated | 5.1.4.1.28.23 |
+--------------------------+-------------+-------------------+
| 2 | half | RFC 9559, Section |
| | | 5.1.4.1.28.23 |
+--------------------------+-------------+-------------------+
Table 62: Initial Contents of "Matroska Horizontal Chroma
Sitings" Registry
27.11. Matroska Vertical Chroma Sitings Registry
IANA has created a new registry called the "Matroska Vertical Chroma
Sitings" registry. The values correspond to the unsigned integer
ChromaSitingVert value described in Section 5.1.4.1.28.24.
To register a new Vertical Chroma Siting in this registry, one needs
a Vertical Chroma Siting value, a description, a Change Controller,
and an optional Reference to a document describing the Vertical
Chroma Siting.
The Vertical Chroma Sitings are to be allocated according to the
"First Come First Served" policy [RFC8126]. Available values range
from 3-18446744073709551615.
Table 63 shows the initial contents of the "Matroska Vertical Chroma
Sitings" registry. The Change Controller for the initial entries is
the IETF.
+========================+=============+===================+
| Vertical Chroma Siting | Description | Reference |
+========================+=============+===================+
| 0 | unspecified | RFC 9559, Section |
| | | 5.1.4.1.28.24 |
+------------------------+-------------+-------------------+
| 1 | top | RFC 9559, Section |
| | collocated | 5.1.4.1.28.24 |
+------------------------+-------------+-------------------+
| 2 | half | RFC 9559, Section |
| | | 5.1.4.1.28.24 |
+------------------------+-------------+-------------------+
Table 63: Initial Contents of "Matroska Vertical Chroma
Sitings" Registry
27.12. Matroska Color Ranges Registry
IANA has created a new registry called the "Matroska Color Ranges"
registry. The values correspond to the unsigned integer Range value
described in Section 5.1.4.1.28.25.
To register a new Color Range in this registry, one needs a Color
Range value, a description, a Change Controller, and a Reference to a
document describing the Color Range.
The Color Ranges are to be allocated according to the "Specification
Required" policy [RFC8126]. Available values range from
4-18446744073709551615.
Table 64 shows the initial contents of the "Matroska Color Ranges"
registry. The Change Controller for the initial entries is the IETF.
+=============+===============================+===================+
| Color Range | Description | Reference |
+=============+===============================+===================+
| 0 | unspecified | RFC 9559, Section |
| | | 5.1.4.1.28.25 |
+-------------+-------------------------------+-------------------+
| 1 | broadcast range | RFC 9559, Section |
| | | 5.1.4.1.28.25 |
+-------------+-------------------------------+-------------------+
| 2 | full range (no clipping) | RFC 9559, Section |
| | | 5.1.4.1.28.25 |
+-------------+-------------------------------+-------------------+
| 3 | defined by MatrixCoefficients | RFC 9559, Section |
| | / TransferCharacteristics | 5.1.4.1.28.25 |
+-------------+-------------------------------+-------------------+
Table 64: Initial Contents of "Matroska Color Ranges" Registry
27.13. Matroska Tags Target Types Registry
IANA has created a new registry called the "Matroska Tags Target
Types" registry. The values correspond to the unsigned integer
TargetTypeValue value described in Section 5.1.8.1.1.1.
To register a new Tags Target Type in this registry, one needs a Tags
Target Type value, a description, a Change Controller, and a
Reference to a document describing the Tags Target Type.
The Tags Target Types are to be allocated according to the
"Specification Required" policy [RFC8126]. Available values range
from 1-9, 11-19, 21-29, 31-39, 41-49, 51-59, 61-69, and
71-18446744073709551615.
The value 0 is not valid for use as a Tags Target Type.
Table 65 shows the initial contents of the "Matroska Tags Target
Types" registry. The Change Controller for the initial entries is
the IETF.
+==================+==========================+===================+
| Tags Target Type | Description | Reference |
+==================+==========================+===================+
| 70 | COLLECTION | RFC 9559, Section |
| | | 5.1.8.1.1.1 |
+------------------+--------------------------+-------------------+
| 60 | EDITION / ISSUE / VOLUME | RFC 9559, Section |
| | / OPUS / SEASON / SEQUEL | 5.1.8.1.1.1 |
+------------------+--------------------------+-------------------+
| 50 | ALBUM / OPERA / CONCERT | RFC 9559, Section |
| | / MOVIE / EPISODE | 5.1.8.1.1.1 |
+------------------+--------------------------+-------------------+
| 40 | PART / SESSION | RFC 9559, Section |
| | | 5.1.8.1.1.1 |
+------------------+--------------------------+-------------------+
| 30 | TRACK / SONG / CHAPTER | RFC 9559, Section |
| | | 5.1.8.1.1.1 |
+------------------+--------------------------+-------------------+
| 20 | SUBTRACK / MOVEMENT / | RFC 9559, Section |
| | SCENE | 5.1.8.1.1.1 |
+------------------+--------------------------+-------------------+
| 10 | SHOT | RFC 9559, Section |
| | | 5.1.8.1.1.1 |
+------------------+--------------------------+-------------------+
| 0 | Not valid for use as a | RFC 9559, Section |
| | Tags Target Type | 5.1.8.1.1.1 |
+------------------+--------------------------+-------------------+
Table 65: Initial Contents of "Matroska Tags Target Types" Registry
27.14. Matroska Chapter Codec IDs Registry
IANA has created a new registry called the "Matroska Chapter Codec
IDs" registry. The values correspond to the unsigned integer
ChapProcessCodecID, ChapterTranslateCodec, and TrackTranslateCodec
values described in Section 5.1.7.1.4.15.
To register a new Chapter Codec ID in this registry, one needs a
Chapter Codec ID value, a description, a Change Controller, and a
Reference to a document describing the Chapter Codec ID.
The Chapter Codec IDs are to be allocated according to the
"Specification Required" policy [RFC8126]. Available values range
from 2-18446744073709551615.
Table 66 shows the initial contents of the "Matroska Chapter Codec
IDs" registry. The Change Controller for the initial entries is the
IETF.
+==================+=================+===================+
| Chapter Codec ID | Description | Reference |
+==================+=================+===================+
| 0 | Matroska Script | RFC 9559, Section |
| | | 5.1.7.1.4.15 |
+------------------+-----------------+-------------------+
| 1 | DVD-menu | RFC 9559, Section |
| | | 5.1.7.1.4.15 |
+------------------+-----------------+-------------------+
Table 66: Initial Contents of "Matroska Chapter Codec
IDs" Registry
27.15. Matroska Projection Types Registry
IANA has created a new registry called the "Matroska Projection
Types" registry. The values correspond to the unsigned integer
ProjectionType value described in Section 5.1.4.1.28.42.
To register a new Projection Type in this registry, one needs a
Projection Type value, a description, a Change Controller, and an
optional Reference to a document describing the Projection Type.
The Projection Types are to be allocated according to the "First Come
First Served" policy [RFC8126]. Available values range from
4-18446744073709551615.
Table 67 shows the initial contents of the "Matroska Projection
Types" registry. The Change Controller for the initial entries is
the IETF.
+=================+=================+===================+
| Projection Type | Description | Reference |
+=================+=================+===================+
| 0 | rectangular | RFC 9559, Section |
| | | 5.1.4.1.28.42 |
+-----------------+-----------------+-------------------+
| 1 | equirectangular | RFC 9559, Section |
| | | 5.1.4.1.28.42 |
+-----------------+-----------------+-------------------+
| 2 | cubemap | RFC 9559, Section |
| | | 5.1.4.1.28.42 |
+-----------------+-----------------+-------------------+
| 3 | mesh | RFC 9559, Section |
| | | 5.1.4.1.28.42 |
+-----------------+-----------------+-------------------+
Table 67: Initial Contents of "Matroska Projection
Types" Registry
27.16. Matroska Track Types Registry
IANA has created a new registry called the "Matroska Track Types"
registry. The values correspond to the unsigned integer TrackType
value described in Section 5.1.4.1.3.
To register a new Track Type in this registry, one needs a Track Type
value, a description, a Change Controller, and a Reference to a
document describing the Track Type.
The Track Types are to be allocated according to the "Specification
Required" policy [RFC8126]. Available values range from 4-15, 19-31,
and 34-18446744073709551615.
The value 0 is not valid for use as a Track Type.
Table 68 shows the initial contents of the "Matroska Track Types"
registry. The Change Controller for the initial entries is the IETF.
+============+===================+===================+
| Track Type | Description | Reference |
+============+===================+===================+
| 0 | Not valid for use | RFC 9559, |
| | as a Track Type | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
| 1 | video | RFC 9559, |
| | | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
| 2 | audio | RFC 9559, |
| | | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
| 3 | complex | RFC 9559, |
| | | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
| 16 | logo | RFC 9559, |
| | | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
| 17 | subtitle | RFC 9559, |
| | | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
| 18 | buttons | RFC 9559, |
| | | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
| 32 | control | RFC 9559, |
| | | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
| 33 | metadata | RFC 9559, |
| | | Section 5.1.4.1.3 |
+------------+-------------------+-------------------+
Table 68: Initial Contents of "Matroska Track
Types" Registry
27.17. Matroska Track Plane Types Registry
IANA has created a new registry called the "Matroska Track Plane
Types" registry. The values correspond to the unsigned integer
TrackPlaneType value described in Section 5.1.4.1.30.4.
To register a new Track Plane Type in this registry, one needs a
Track Plane Type value, a description, a Change Controller, and an
optional Reference to a document describing the Track Plane Type.
The Track Plane Types are to be allocated according to the "First
Come First Served" policy [RFC8126]. Available values range from
3-18446744073709551615.
Table 69 shows the initial contents of the "Matroska Track Plane
Types" registry. The Change Controller for the initial entries is
the IETF.
+==================+=============+================================+
| Track Plane Type | Description | Reference |
+==================+=============+================================+
| 0 | left eye | RFC 9559, Section 5.1.4.1.30.4 |
+------------------+-------------+--------------------------------+
| 1 | right eye | RFC 9559, Section 5.1.4.1.30.4 |
+------------------+-------------+--------------------------------+
| 2 | background | RFC 9559, Section 5.1.4.1.30.4 |
+------------------+-------------+--------------------------------+
Table 69: Initial Contents of "Matroska Track Plane Types" Registry
27.18. Media Types
Matroska files and streams are found in three main forms: audio-
video, audio-only, and (occasionally) stereoscopic video.
Historically, Matroska files and streams have used the following
media types with an "x-" prefix. For better compatibility, a system
SHOULD be able to handle both formats. Newer systems SHOULD NOT use
the historic format and use the format that follows the format in
[RFC6838] instead.
IANA has registered three media types per the templates (see
[RFC6838]) in the following subsections.
27.18.1. For Files Containing Video Tracks
Type name: video
Subtype name: matroska
Required parameters: N/A
Optional parameters: N/A
Encoding considerations: As per RFCs 9559 and 8794
Security considerations: See Section 26 of RFC 9559.
Interoperability considerations: Due to the extensibility of
Matroska, it is possible to encounter files with unknown but valid
EBML Elements. Readers should be ready to handle this case. The
fixed byte order, octet boundaries, and UTF-8 usage allow for
broad interoperability.
Published specification: RFC 9559
Applications that use this media type: FFmpeg, VLC, etc.
Fragment identifier considerations: N/A
Additional information:
Deprecated alias names for this type: video/x-matroska
Magic number(s): N/A
File extension(s): mkv
Macintosh file type code(s): N/A
Person & email address to contact for further information: IETF
CELLAR WG (cellar@ietf.org)
Intended usage: COMMON
Restrictions on usage: None
Author: IETF CELLAR WG
Change controller: IETF
27.18.2. For Files Containing Audio Tracks with No Video Tracks
Type name: audio
Subtype name: matroska
Required parameters: N/A
Optional parameters: N/A
Encoding considerations: As per RFCs 9559 and 8794
Security considerations: See Section 26 of RFC 9559.
Interoperability considerations: Due to the extensibility of
Matroska, it is possible to encounter files with unknown but valid
EBML Elements. Readers should be ready to handle this case. The
fixed byte order, octet boundaries, and UTF-8 usage allow for
broad interoperability.
Published specification: RFC 9559
Applications that use this media type: FFmpeg, VLC, etc.
Fragment identifier considerations: N/A
Additional information:
Deprecated alias names for this type: audio/x-matroska
Magic number(s): N/A
File extension(s): mka
Macintosh file type code(s): N/A
Person & email address to contact for further information: IETF
CELLAR WG (cellar@ietf.org)
Intended usage: COMMON
Restrictions on usage: None
Author: IETF CELLAR WG
Change controller: IETF
27.18.3. For Files Containing a Stereoscopic Video Track
Type name: video
Subtype name: matroska-3d
Required parameters: N/A
Optional parameters: N/A
Encoding considerations: As per RFCs 9559 and 8794
Security considerations: See Section 26 of RFC 9559.
Interoperability considerations: Due to the extensibility of
Matroska, it is possible to encounter files with unknown but valid
EBML Elements. Readers should be ready to handle this case. The
fixed byte order, octet boundaries, and UTF-8 usage allow for
broad interoperability.
Published specification: RFC 9559
Applications that use this media type: FFmpeg, VLC, etc.
Fragment identifier considerations: N/A
Additional information:
Deprecated alias names for this type: video/x-matroska-3d
Magic number(s): N/A
File extension(s): mk3d
Macintosh file type code(s): N/A
Person & email address to contact for further information: IETF
CELLAR WG (cellar@ietf.org)
Intended usage: COMMON
Restrictions on usage: None
Author: IETF CELLAR WG
Change controller: IETF
28. References
28.1. Normative References
[CIE-1931] Wikipedia, "CIE 1931 color space",
<https://en.wikipedia.org/w/
index.php?title=CIE_1931_color_space&oldid=1242811504>.
[ISO639-2] International Organization for Standardization, "Codes for
the Representation of Names of Languages", ISO 639-2,
December 2017, <https://www.loc.gov/standards/iso639-
2/php/code_list.php>.
[ISO9899] International Organization for Standardization,
"Information technology -- Programming languages -- C",
ISO/IEC 9899:2018, June 2018,
<https://www.iso.org/standard/74528.html>.
[ITU-H.273]
ITU-T, "Coding-independent code points for video signal
type identification", ITU-T Recommendation H.273,
September 2023,
<https://www.itu.int/rec/T-REC-H.273-202309-P/en>.
[RFC1950] Deutsch, P. and J. Gailly, "ZLIB Compressed Data Format
Specification version 3.3", RFC 1950,
DOI 10.17487/RFC1950, May 1996,
<https://www.rfc-editor.org/info/rfc1950>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying
Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646,
September 2009, <https://www.rfc-editor.org/info/rfc5646>.
[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type
Specifications and Registration Procedures", BCP 13,
RFC 6838, DOI 10.17487/RFC6838, January 2013,
<https://www.rfc-editor.org/info/rfc6838>.
[RFC8081] Lilley, C., "The "font" Top-Level Media Type", RFC 8081,
DOI 10.17487/RFC8081, February 2017,
<https://www.rfc-editor.org/info/rfc8081>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8794] Lhomme, S., Rice, D., and M. Bunkus, "Extensible Binary
Meta Language", RFC 8794, DOI 10.17487/RFC8794, July 2020,
<https://www.rfc-editor.org/info/rfc8794>.
[RFC9562] Davis, K., Peabody, B., and P. Leach, "Universally Unique
IDentifiers (UUIDs)", RFC 9562, DOI 10.17487/RFC9562, May
2024, <https://www.rfc-editor.org/info/rfc9562>.
28.2. Informative References
[AVIFormat]
Microsoft Corporation, "AVI RIFF File Reference", June
2023, <https://docs.microsoft.com/en-
us/windows/win32/directshow/avi-riff-file-reference>.
[Blowfish] Schneier, B., "The Blowfish Encryption Algorithm", 1993,
<https://www.schneier.com/academic/blowfish/>.
[BZIP2] Seward, J., "bzip2", July 2019,
<https://sourceware.org/bzip2/>.
[DivXTrickTrack]
"Smooth FF/RW", December 2010,
<https://web.archive.org/web/20101222001148/
http://labs.divx.com/node/16601>.
[DivXWorldFonts]
"World Fonts", December 2010,
<https://web.archive.org/web/20110214132246/
http://labs.divx.com/node/16602>.
[DVD-Video]
DVD Forum, "DVD-Books: Part 3 DVD-Video Book", November
1995, <http://www.dvdforum.org/>.
[Err7189] RFC Errata, Erratum ID 7189, RFC 8794,
<https://www.rfc-editor.org/errata/eid7189>.
[Err7191] RFC Errata, Erratum ID 7191, RFC 8794,
<https://www.rfc-editor.org/errata/eid7191>.
[FIPS197] National Institute of Standards and Technology (NIST),
"Advanced Encryption Standard (AES)", FIPS PUB 197,
DOI 10.6028/NIST.FIPS.197, November 2001,
<https://csrc.nist.gov/publications/detail/fips/197/
final>.
[FIPS46-3] National Institute of Standards and Technology (NIST),
"Data Encryption Standard (DES)", FIPS PUB 46, October
1999,
<https://csrc.nist.gov/publications/detail/fips/46/3/
archive/1999-10-25>.
[FourCC-RGB]
FOURCC, "RGB pixel formats",
<https://web.archive.org/web/20160609214806/
https://www.fourcc.org/rgb.php>.
[FourCC-YUV]
FOURCC, "YUV pixel formats",
<https://web.archive.org/web/20160609214806/
https://www.fourcc.org/yuv.php>.
[JPEG] ITU-T, "INFORMATION TECHNOLOGY - DIGITAL COMPRESSION AND
CODING OF CONTINUOUS-TONE STILL IMAGES - REQUIREMENTS AND
GUIDELINES", ITU-T Recommendation T.81, September 1992,
<https://www.w3.org/Graphics/JPEG/itu-t81.pdf>.
[libmatroska]
"libmatroska", March 2024,
<https://github.com/Matroska-Org/libmatroska>.
[LZO] Tarreau, W. and R. Rodgman, "LZO stream format as
understood by Linux's LZO decompressor", October 2018,
<https://www.kernel.org/doc/Documentation/lzo.txt>.
[MatroskaCodec]
Lhomme, S., Bunkus, M., and D. Rice, "Matroska Media
Container Codec Specifications", Work in Progress,
Internet-Draft, draft-ietf-cellar-codec-13, 5 May 2024,
<https://datatracker.ietf.org/doc/html/draft-ietf-cellar-
codec-13>.
[MatroskaTags]
Lhomme, S., Bunkus, M., and D. Rice, "Matroska Media
Container Tag Specifications", Work in Progress, Internet-
Draft, draft-ietf-cellar-tags-13, 5 May 2024,
<https://datatracker.ietf.org/doc/html/draft-ietf-cellar-
tags-13>.
[MCF] "MCF specification, introduction",
<http://mukoli.free.fr/mcf/>.
[MSRGB] Microsoft Corporation, "Compression Enumeration", June
2021, <https://learn.microsoft.com/en-
us/openspecs/windows_protocols/ms-wmf/4e588f70-bd92-4a6f-
b77f-35d0feaf7a57>.
[MSYUV16] Microsoft Corporation, "10-bit and 16-bit YUV Video
Formats", November 2022, <https://learn.microsoft.com/en-
us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-
formats>.
[MSYUV8] Microsoft Corporation, "Recommended 8-Bit YUV Formats for
Video Rendering", January 2021,
<https://learn.microsoft.com/en-us/windows/win32/medfound/
recommended-8-bit-yuv-formats-for-video-rendering>.
[RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol",
STD 9, RFC 959, DOI 10.17487/RFC0959, October 1985,
<https://www.rfc-editor.org/info/rfc959>.
[RFC2083] Boutell, T., "PNG (Portable Network Graphics)
Specification Version 1.0", RFC 2083,
DOI 10.17487/RFC2083, March 1997,
<https://www.rfc-editor.org/info/rfc2083>.
[RFC3533] Pfeiffer, S., "The Ogg Encapsulation Format Version 0",
RFC 3533, DOI 10.17487/RFC3533, May 2003,
<https://www.rfc-editor.org/info/rfc3533>.
[RFC4732] Handley, M., Ed., Rescorla, E., Ed., and IAB, "Internet
Denial-of-Service Considerations", RFC 4732,
DOI 10.17487/RFC4732, December 2006,
<https://www.rfc-editor.org/info/rfc4732>.
[RFC9110] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
Ed., "HTTP Semantics", STD 97, RFC 9110,
DOI 10.17487/RFC9110, June 2022,
<https://www.rfc-editor.org/info/rfc9110>.
[SMB-CIFS] Microsoft Corporation, "[MS-CIFS]: Common Internet File
System (CIFS) Protocol", October 2020,
<https://winprotocoldoc.blob.core.windows.net/
productionwindowsarchives/MS-CIFS/%5bMS-CIFS%5d.pdf>.
[SP800-38A]
National Institute of Standards and Technology (NIST),
"Recommendation for Block Cipher Modes of Operation:
Methods and Techniques", DOI 10.6028/NIST.SP.800-38A, NIST
Special Publication 800-38A, December 2001,
<https://nvlpubs.nist.gov/nistpubs/Legacy/SP/
nistspecialpublication800-38a.pdf>.
[SP800-67] National Institute of Standards and Technology (NIST),
"Recommendation for the Triple Data Encryption Algorithm
(TDEA) Block Cipher", DOI 10.6028/NIST.SP.800-67r2, NIST
Special Publication 800-67, November 2017,
<https://nvlpubs.nist.gov/nistpubs/SpecialPublications/
NIST.SP.800-67r2.pdf>.
[Twofish] Schneier, B., Kelsey, J., Whiting, D., Wagner, D., Hall,
C., and N. Ferguson, "Twofish: A 128-Bit Block Cipher",
June 1998,
<https://www.schneier.com/academic/archives/1998/06/
twofish_a_128-bit_bl.html>.
[WebM-Enc] Galligan, F., "WebM Encryption", September 2016,
<https://www.webmproject.org/docs/webm-encryption/>.
[WebVTT] Pieters, S., Pfeiffer, S., Ed., Jaegenstedt, P., and I.
Hickson, "WebVTT: The Web Video Text Tracks Format", W3C
Candidate Recommendation, April 2019,
<https://www.w3.org/TR/2019/CR-webvtt1-20190404/>.
Appendix A. Historic Deprecated Elements
As Matroska has evolved since 2002, many parts that were considered
for use in the format were never used and often incorrectly designed.
Many of the elements that were defined then are not found in any
known files but were part of public specs. DivX also had a few
custom elements that were designed for custom features.
In this appendix, we list elements that have a known ID that SHOULD
NOT be reused to avoid colliding with existing files. These might be
reassigned by IANA in the future if there are no more IDs for a given
size. A short description of what each ID was used for is included,
but the text is not normative.
A.1. SilentTracks Element
type / id: master / 0x5854
path: \Segment\Cluster\SilentTracks
documentation: The list of tracks that are not used in that part of
the stream. It is useful when using overlay tracks for seeking or
deciding what track to use.
A.2. SilentTrackNumber Element
type / id: uinteger / 0x58D7
path: \Segment\Cluster\SilentTracks\SilentTrackNumber
documentation: One of the track numbers that is not used from now on
in the stream. It could change later if not specified as silent
in a further Cluster.
A.3. BlockVirtual Element
type / id: binary / 0xA2
path: \Segment\Cluster\BlockGroup\BlockVirtual
documentation: A Block with no data. It must be stored in the
stream at the place the real Block would be in display order.
A.4. ReferenceVirtual Element
type / id: integer / 0xFD
path: \Segment\Cluster\BlockGroup\ReferenceVirtual
documentation: The Segment Position of the data that would otherwise
be in position of the virtual block.
A.5. Slices Element
type / id: master / 0x8E
path: \Segment\Cluster\BlockGroup\Slices
documentation: Contains slices description.
A.6. TimeSlice Element
type / id: master / 0xE8
path: \Segment\Cluster\BlockGroup\Slices\TimeSlice
documentation: Contains extra time information about the data
contained in the Block. Being able to interpret this element is
not required for playback.
A.7. LaceNumber Element
type / id: uinteger / 0xCC
path: \Segment\Cluster\BlockGroup\Slices\TimeSlice\LaceNumber
documentation: The reverse number of the frame in the lace (0 is the
last frame, 1 is the next to last, etc.). Being able to interpret
this element is not required for playback.
A.8. FrameNumber Element
type / id: uinteger / 0xCD
path: \Segment\Cluster\BlockGroup\Slices\TimeSlice\FrameNumber
documentation: The number of the frame to generate from this lace
with this delay (allows for the generation of many frames from the
same Block/Frame).
A.9. BlockAdditionID Element
type / id: uinteger / 0xCB
path: \Segment\Cluster\BlockGroup\Slices\TimeSlice\BlockAdditionID
documentation: The ID of the BlockAdditional element (0 is the main
Block).
A.10. Delay Element
type / id: uinteger / 0xCE
path: \Segment\Cluster\BlockGroup\Slices\TimeSlice\Delay
documentation: The delay to apply to the element, expressed in Track
Ticks; see Section 11.1.
A.11. SliceDuration Element
type / id: uinteger / 0xCF
path: \Segment\Cluster\BlockGroup\Slices\TimeSlice\SliceDuration
documentation: The duration to apply to the element, expressed in
Track Ticks; see Section 11.1.
A.12. ReferenceFrame Element
type / id: master / 0xC8
path: \Segment\Cluster\BlockGroup\ReferenceFrame
documentation: Contains information about the last reference frame.
See [DivXTrickTrack].
A.13. ReferenceOffset Element
type / id: uinteger / 0xC9
path: \Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceOffset
documentation: The relative offset, in bytes, from the previous
BlockGroup element for this Smooth FF/RW video track to the
containing BlockGroup element. See [DivXTrickTrack].
A.14. ReferenceTimestamp Element
type / id: uinteger / 0xCA
path: \Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceTimestamp
documentation: The timestamp of the BlockGroup pointed to by
ReferenceOffset, expressed in Track Ticks; see Section 11.1. See
[DivXTrickTrack].
A.15. EncryptedBlock Element
type / id: binary / 0xAF
path: \Segment\Cluster\EncryptedBlock
documentation: Similar to SimpleBlock (see Section 10.2), but the
data inside the Block are Transformed (encrypted and/or signed).
A.16. MinCache Element
type / id: uinteger / 0x6DE7
path: \Segment\Tracks\TrackEntry\MinCache
documentation: The minimum number of frames a player should be able
to cache during playback. If set to 0, the reference pseudo-cache
system is not used.
A.17. MaxCache Element
type / id: uinteger / 0x6DF8
path: \Segment\Tracks\TrackEntry\MaxCache
documentation: The maximum cache size necessary to store referenced
frames in and the current frame. 0 means no cache is needed.
A.18. TrackOffset Element
type / id: integer / 0x537F
path: \Segment\Tracks\TrackEntry\TrackOffset
documentation: A value to add to the Block's Timestamp, expressed in
Matroska Ticks -- i.e., in nanoseconds; see Section 11.1. This
can be used to adjust the playback offset of a track.
A.19. CodecSettings Element
type / id: utf-8 / 0x3A9697
path: \Segment\Tracks\TrackEntry\CodecSettings
documentation: A string describing the encoding setting used.
A.20. CodecInfoURL Element
type / id: string / 0x3B4040
path: \Segment\Tracks\TrackEntry\CodecInfoURL
documentation: A URL to find information about the codec used.
A.21. CodecDownloadURL Element
type / id: string / 0x26B240
path: \Segment\Tracks\TrackEntry\CodecDownloadURL
documentation: A URL to download information about the codec used.
A.22. CodecDecodeAll Element
type / id: uinteger / 0xAA
path: \Segment\Tracks\TrackEntry\CodecDecodeAll
documentation: Set to 1 if the codec can decode potentially damaged
data.
A.23. TrackOverlay Element
type / id: uinteger / 0x6FAB
path: \Segment\Tracks\TrackEntry\TrackOverlay
documentation: Specify that this track is an overlay track for the
Track specified (in the u-integer). This means that when this
track has a gap on SilentTracks, the overlay track should be used
instead. The order of multiple TrackOverlay matters; the first
one is the one that should be used. If the first one is not
found, it should be the second, etc.
A.24. AspectRatioType Element
type / id: uinteger / 0x54B3
path: \Segment\Tracks\TrackEntry\Video\AspectRatioType
documentation: Specifies the possible modifications to the aspect
ratio.
A.25. GammaValue Element
type / id: float / 0x2FB523
path: \Segment\Tracks\TrackEntry\Video\GammaValue
documentation: Gamma value.
A.26. FrameRate Element
type / id: float / 0x2383E3
path: \Segment\Tracks\TrackEntry\Video\FrameRate
documentation: Number of frames per second. This value is
informational only. It is intended for constant frame rate
streams and should not be used for a variable frame rate
TrackEntry.
A.27. ChannelPositions Element
type / id: binary / 0x7D7B
path: \Segment\Tracks\TrackEntry\Audio\ChannelPositions
documentation: Table of horizontal angles for each successive
channel.
A.28. TrickTrackUID Element
type / id: uinteger / 0xC0
path: \Segment\Tracks\TrackEntry\TrickTrackUID
documentation: The TrackUID of the Smooth FF/RW video in the paired
EBML structure corresponding to this video track. See
[DivXTrickTrack].
A.29. TrickTrackSegmentUID Element
type / id: binary / 0xC1
path: \Segment\Tracks\TrackEntry\TrickTrackSegmentUID
documentation: The SegmentUUID of the Segment containing the track
identified by TrickTrackUID. See [DivXTrickTrack].
A.30. TrickTrackFlag Element
type / id: uinteger / 0xC6
path: \Segment\Tracks\TrackEntry\TrickTrackFlag
documentation: Set to 1 if this video track is a Smooth FF/RW track.
If set to 1, MasterTrackUID and MasterTrackSegUID should be
present, and BlockGroups for this track must contain
ReferenceFrame structures. Otherwise, TrickTrackUID and
TrickTrackSegUID must be present if this track has a corresponding
Smooth FF/RW track. See [DivXTrickTrack].
A.31. TrickMasterTrackUID Element
type / id: uinteger / 0xC7
path: \Segment\Tracks\TrackEntry\TrickMasterTrackUID
documentation: The TrackUID of the video track in the paired EBML
structure that corresponds to this Smooth FF/RW track. See
[DivXTrickTrack].
A.32. TrickMasterTrackSegmentUID Element
type / id: binary / 0xC4
path: \Segment\Tracks\TrackEntry\TrickMasterTrackSegmentUID
documentation: The SegmentUUID of the Segment containing the track
identified by MasterTrackUID. See [DivXTrickTrack].
A.33. ContentSignature Element
type / id: binary / 0x47E3
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption\ContentSignature
documentation: A cryptographic signature of the contents.
A.34. ContentSigKeyID Element
type / id: binary / 0x47E4
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption\ContentSigKeyID
documentation: This is the ID of the private key that the data was
signed with.
A.35. ContentSigAlgo Element
type / id: uinteger / 0x47E5
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption\ContentSigAlgo
documentation: The algorithm used for the signature.
A.36. ContentSigHashAlgo Element
type / id: uinteger / 0x47E6
path: \Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\Co
ntentEncryption\ContentSigHashAlgo
documentation: The hash algorithm used for the signature.
A.37. CueRefCluster Element
type / id: uinteger / 0x97
path: \Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefCl
uster
documentation: The Segment Position of the Cluster containing the
referenced Block.
A.38. CueRefNumber Element
type / id: uinteger / 0x535F
path: \Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefNu
mber
documentation: Number of the referenced Block of Track X in the
specified Cluster.
A.39. CueRefCodecState Element
type / id: uinteger / 0xEB
path: \Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefCo
decState
documentation: The Segment Position of the Codec State corresponding
to this referenced element. 0 means that the data is taken from
the initial TrackEntry.
A.40. FileReferral Element
type / id: binary / 0x4675
path: \Segment\Attachments\AttachedFile\FileReferral
documentation: A binary value that a track/codec can refer to when
the attachment is needed.
A.41. FileUsedStartTime Element
type / id: uinteger / 0x4661
path: \Segment\Attachments\AttachedFile\FileUsedStartTime
documentation: The timestamp at which this optimized font attachment
comes into context, expressed in Segment Ticks, which are based on
TimestampScale. See [DivXWorldFonts].
A.42. FileUsedEndTime Element
type / id: uinteger / 0x4662
path: \Segment\Attachments\AttachedFile\FileUsedEndTime
documentation: The timestamp at which this optimized font attachment
goes out of context, expressed in Segment Ticks, which are based
on TimestampScale. See [DivXWorldFonts].
A.43. TagDefaultBogus Element
type / id: uinteger / 0x44B4
path: \Segment\Tags\Tag\+SimpleTag\TagDefaultBogus
documentation: A variant of the TagDefault element with a bogus
element ID; see Section 5.1.8.1.2.4.
Authors' Addresses
Steve Lhomme
Email: slhomme@matroska.org
Moritz Bunkus
Email: moritz@bunkus.org
Dave Rice
Email: dave@dericed.com
|