The payload of the PES packets of a PID, put back together, is an elementary stream: a sequence of units each with its own header. The explorer lists the units in two places: in the payload of each packet in the tree, and in the Elementary streams tab for the whole window of a PID. It reads headers and never decodes pictures: a frame or slice is listed with its type, and keyframes are marked.
Video
| Codec | Units found by | Parsed |
|---|---|---|
| MPEG-1 and MPEG-2 video (stream types 01, 02) | Start codes 000001xx | sequence_header (size, aspect ratio, frame rate, bit rate), sequence_extension and picture_coding_extension (profile and level, progressive, chroma format, picture structure, field order), group_of_pictures_header (time code, closed GOP, broken link), picture_header (temporal_reference, I, P, B or D picture type, vbv_delay; I pictures are keyframes), user_data (ATSC GA94 captions and AFD named), sequence_end_code. Slices are counted out of the list. |
| H.264 / AVC (1B, 1F, 20, 23, 26) | Annex B start codes, NAL header | nal_ref_idc and type of every NAL unit; SPS (profile, level, size with cropping, chroma format, reference frames, frame_mbs_only, frame rate from the VUI), PPS ids and entropy coder, access unit delimiter picture types, SEI payload types (and ATSC closed caption triplets), slice_type (P, B, I, SP, SI), first_mb_in_slice and pps_id. IDR slices are keyframes. |
| H.265 / HEVC (24, 25, 28 to 2B, 31) | Annex B start codes, two-byte NAL header | Type name (TRAIL, TSA, STSA, RADL, RASL, BLA, IDR, CRA, VPS, SPS, PPS, AUD, EOS, EOB, FD, SEI), nuh_layer_id, TemporalId; SPS profile_tier_level (profile, tier, level), chroma format and size; PPS dependent slice and extra header bits; AUD pic_type; first_slice_segment_in_pic_flag and pps_id; the slice_type (B, P or I) of the first slice of each picture, read past the PPS's extra slice header bits. IRAP pictures (types 16 to 21) are keyframes. |
AV1 (registration AV01) | OBU headers with sizes | OBU type; sequence header (profile, level, maximum frame size, still picture, timing info, operating points); frame header frame_type (KEY, INTER, INTRA_ONLY, SWITCH) and show_existing_frame; metadata types. Key frames are keyframes. |
| MPEG-4 visual, VC-1, AVS (10, EA, 42) | Start codes | The start code names; MPEG-4 VOP coding type (I, P, B, S). |
Audio
| Codec | Frames found by | Parsed |
|---|---|---|
| MPEG audio layers I, II, III (03, 04) | Syncword and header | MPEG version, layer, bit rate, sampling rate, channel mode, frame length |
| AAC in ADTS (0F) | ADTS syncword | Object type, sampling rate, channel configuration, frame length, CRC |
| AAC in LATM / LOAS (11) | 56E syncword and 13-bit length | Length of each AudioMuxElement; the configuration (object type, rate, channels) from the first frame that carries it |
| AC-3 and E-AC-3 (81, 87, 84, A1, or 06 with descriptor 6A or 7A) | Syncword 0B77 | AC-3 or E-AC-3, sampling rate, blocks, bit rate, frame size, coding mode |
| DTS (82, 85, 86, 8A, A2, or 06 with descriptor 7B or registration DTS1, DTS2, DTS3) | Core or extension substream syncword | Core frame sample rate, samples and frame size; extension substreams noted |
HDMV LPCM, Blu-ray (80 with registration HDMV) | The 16-bit audio_data_payload_size in each 4-byte header, chained from the first place where three headers follow each other | Channel assignment (1 mono, 3 stereo, 4 L C R, 5 L R S, 6 L C R S, 7 L R Ls Rs, 8 L C R Ls Rs, 9 5.1, 10 and 11 6.1 and 7.1), sampling frequency (48, 96 or 192 kHz), bits per sample (16, 20 or 24) and the start flag of every frame; the channels are stored in pairs, so an odd count has one padding channel |
| Dolby TrueHD and MLP (83) | The 4-bit parity nibble and 12-bit length in 16-bit words that start each access unit | Length and input timing of every access unit; in a major sync (F8726FBA TrueHD, F8726FBB MLP): sampling rate, channel field, the B752 signature, flags, variable rate flag, peak data rate and substream count |
Opus in MPEG-TS (06 with registration Opus) | The control header: the 11-bit prefix 7FE0, trim and extension flags, the access unit size (255 steps) | Size, start and end trim and the packet's TOC (mode SILK, hybrid or CELT, bandwidth, frame length, stereo, frame count) |
Subtitles, teletext and captions
- DVB subtitles (EN 300 743): data_identifier 20 and subtitle_stream_id, then every segment with its type (10 page composition, 11 region composition, 12 CLUT definition, 13 object data, 14 display definition, 15 disparity signalling, 16 alternative CLUT, 80 end of display set), page_id and length; the time out and state of a page composition.
- EBU teletext (EN 300 472): data_identifier and every data unit (02 non-subtitle, 03 subtitle, and the VBI unit ids), with field, line, magazine and row from the Hamming 8/4 coded address, the page number and header of row 0 and the text of the other rows.
- ARIB STD-B24 captions (a stream whose PMT carries a data_component descriptor with id 0008, or that begins with data_identifier 80 or 81): every PES packet is a data group. The explorer reads the caption management data (languages and display format) and the statement data units, and decodes the text with the ARIB 8-unit character code.
Closed captions
The Captions tab lists, in time order and every row paged, the captions found in the stream. For MPEG-2 video the cc_data is in the user data after the picture header (start code 000001B2, GA94, type code 3); for H.264 and HEVC it is in an SEI message of payload type 4 (ITU-T T.35, country B5, provider 0031, GA94). The triplets are put into display order by the PTS of the PES packet of their picture, then decoded:
- CEA-608 (cc_type 0 and 1: the two fields of line 21): the channels CC1 to CC4 and TEXT1 to TEXT4, with the control codes in pairs (the second copy of a repeated code is ignored), preamble address codes (row, indent), mid-row codes, the special and extended character sets (an extended character backs up one column), tab offsets, backspace, delete to end of row, and the pop-on (RCL and EOC), roll-up (RU2 to RU4 and CR) and paint-on (RDC) modes. A row is written when the displayed text changes: on EOC, on a roll or erase of typed text. XDS packets (field 2: current and future programme, channel, miscellaneous and public service classes) are listed with the programme name, network name, call letters, length and time of day decoded and the other types as bytes.
- CEA-708 (cc_type 2 and 3: DTVCC packets): the packet is reassembled from its triplets, split into service blocks (service numbers 1 to 6, and the extended service numbers), and each service's commands are run: C0 (ETX, BS, FF, CR, HCR, EXT1 and the parameter bytes of the others), G0, G1, the G2 extension set and the G3 icon, C1 window commands (CW0 to CW7, DF0 to DF7 with row and column counts and the visible flag, CLW, DSW, HDW, TGW, DLW, DLY, DLC, RST, and SPA, SPC, SPL, SWA skipped with their parameters). A row is written for the text of the visible windows when ETX arrives or a window is cleared, shown, hidden, deleted or reset.
Audio playback
The Sound tab plays MPEG audio (layers I to III), AAC (ADTS and LATM), AC-3, E-AC-3 and DTS (including DTS-HD, as far as the shared DTS decoder goes) with the same decoders the .mp3, .aac, .ac3 and .dts viewers use, Opus with the shared Opus decoder (the trims of each access unit applied), and Blu-ray LPCM, whose samples are read straight from the frames (16 bits in two bytes, 20 and 24 bits in three, big-endian, interleaved by channel). Opus and LPCM are tested against FFmpeg's decode, like the others. The PES payloads of the PID in the scanned window are cut into frames by the syncwords above and decoded about a third of a second at a time, so a long programme is drawn and played without holding it. The length is counted once from the frame headers.
Seeking behind the current position restores the decoder at the nearest saved PES boundary (every 262,144 samples). At each such boundary the player keeps a copy of everything the decoder carries from one frame to the next: for MPEG audio the overlap of the inverse transform, the synthesis filter buffers and the Layer III bit reservoir (the last bytes of main data that the next frame may point back into); for AAC the overlap of the last window, the window shape, the predictor and LTP history, the SBR and PS state (QMF histories, envelopes, the decorrelator delays) and the noise generator; for AC-3 and E-AC-3 the overlap of every channel and the noise generator; for DTS the filter histories. After a restore the decode is the same as the uninterrupted one, sample for sample (checked for MP2, MP3, AAC LC, HE-AAC v1 and v2, AC-3 and E-AC-3). Each elementary stream can also be handed over as a file of its own, from the start of the whole file in windows, and opened in the matching viewer.
Not described
Known, not yet covered
- Viewer: picture data is not decoded (no video is drawn), and slice headers are read to the slice type only. HEVC slice types are read for the first slice of each picture only (the later slices of a picture need the SPS's coding tree size for their address), VPS contents beyond the id are not decoded, and the AV1 frame header is read to frame_type only.
- Viewer: AC-4, MPEG-H 3D audio, BDAV subtitle streams (PGS, IGS, text), Dirac, JPEG 2000, VVC and EVC are named and found by stream type but not parsed or played; AC-4 is another session's work. Dolby TrueHD and MLP have their access unit and major sync fields read, but no decoder is available here to play them (the substream, restart and block headers, the lossless coding and the matrixing are not parsed).
- Viewer: E-AC-3 dependent substreams are skipped when playing (only the first independent substream sounds); AAC with a changing configuration mid-stream and DTS Express (LBR) are not followed. Opus streams with a channel configuration other than mono or stereo (the channel_config_code of the Opus extension descriptor, multistream mappings) are decoded as mono or stereo from the first TOC. HDMV LPCM channels are in the stored order of the disc, not remapped to a speaker layout. A seek back in Opus decodes again from the beginning of the window (Opus has no restart points); LPCM seeks directly.
- Viewer: the pictures of DVB subtitles, ARIB bitmap and DRCS data units and teletext pages are counted and listed, not rendered. CEA-608 and CEA-708 caption text is decoded without its styling: colours, italics, underline, flashing, window position and pen size are read and skipped, not shown. The XDS content advisory and the other XDS types that are not named above are shown as bytes.