M2TS
Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.
Blu-ray BDAV Transport Stream.
At a glance
| Original creator | Blu-ray Disc Association |
| First published | 2006 |
| Purpose | The transport stream of Blu-ray (BDAV) and AVCHD video: MPEG-2 transport packets with a four-byte arrival timestamp in front of each. |
| Extensions | .m2ts |
| Poka parser | poka-m2ts |
| Viewer | poka-metadata-card-viewer |
| Depth tier | Metadata card (see Depth tiers) |
| Breadth tier | B4 Summary (see Breadth tiers) |
How much Poka reads
B4 Summary. The container and metadata are read and summarised (counts, properties, structure), but the main content is not rendered.
Confidence: high (the reviewer read the code and a test that proves the claim). Basis: Reviewed 2026-10-16: parsers/poka-m2ts/src/lib.rs (stride detection, PAT and multi-packet PMT reassembly, PID census, arrival timestamps), tests/timing.rs and tests/samples.rs over 3 corpus clips (first 2 MB of Atmos, AVCHD and Dolby Vision discs) plus a plain .ts reference. Metadata card of structure and codec line-up only; no video or audio decoded. Covers BDAV 192-byte and plain 188-byte transport streams.
What Poka does not read
- No video or audio is decoded
- Resolution, frame rate, aspect ratio, audio channel layout and language are not read (PMT descriptors are skipped)
- Duration is only the arrival-timestamp span: a lower bound for a file large enough to contain a wrap (about 99 MB at 20 Mbit/s), since the number of wraps is not counted (PCR is not used)
- Only the first 200000 packets are walked
- Other service tables (SIT, EIT, SDT) are not read
- Blu-ray playlist and clip info files (MPLS, CLPI) are separate files and not read
- Stream types outside a 21-entry table show as a hex number
- Subtitle and graphics streams are counted, not decoded
- Corpus clips are cut at 2 MB so large real discs are untested
Background
The Library of Congress describes M2TS as a modification of the MPEG-2 transport stream used by BDAV on Blu-ray discs and by AVCHD camcorders. The Blu-ray Disc Association released the first version of the Blu-ray format in 2006; AVCHD, from Sony and Panasonic, was announced the same year. Poka measures the packet stride (192 bytes, or 188 for a plain transport stream) instead of assuming it, counts packets per PID, and reassembles the program tables across packets to name each stream's codec. A Blu-ray PMT often spans two packets, and reading one packet only would find no programmes at all. The duration comes from the first and last arrival timestamps. The 30-bit clock wraps about every 40 seconds, which at the 20 Mbit/s a Blu-ray is authored for is roughly 99 MB of file, so only a file at least that large is reported as a lower bound; a shorter one cannot have wrapped. Timestamps that go backwards inside a file are reported as giving no duration at all. No video is decoded.
Versions
| Version | Identifier | Poka | Note |
|---|---|---|---|
| BDAV / AVCHD transport stream | 192-byte packets, sync byte 0x47 at offset 4 |
Read | Stream structure and codecs only. |
Libraries
Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.
- oxideav-bluray (candidate; MIT; Rust; https://github.com/OxideAV/oxideav-bluray) — Reads .m2ts 192-byte BDAV packets, strips header to 188-byte TS; also BDMV/UDF/playlists; v0.0.4 Sep 2026, very young.
- oxideav-mpegts (candidate; MIT; Rust; https://github.com/OxideAV/oxideav-mpegts) — Pure Rust MPEG-TS demuxer (188-byte packets, PAT/PMT, PES), intended for Blu-ray m2ts pipelines; v0.0.3.
- bdinfo-rs-core (candidate; LGPL-2.1-or-later; Rust; https://github.com/agentjp/bdinfo-rs) — Blu-ray analyser with its own M2TS demuxer and codec scanners; has a WebAssembly build; v4.0.0.
- mpeg2ts-reader (candidate; MIT OR Apache-2.0; Rust; https://github.com/dholroyd/mpeg2ts-reader) — Mature TS parser (v0.18.2) but 188-byte packets only; README says m2ts 192-byte framing is not handled, so strip the 4-byte prefix first.
Sources
- https://www.loc.gov/preservation/digital/formats/fdd/fdd000636.shtml
- parsers/poka-m2ts/src/lib.rs