Emby Emby Emby Learn
  • Emby Home
  • Video
  • Audio
  • Media Files
    • Subtitles and captions
    • Photos and images
    • Metadata and discovery
    • Libraries and media collections
    • Playback and streaming
    • Media hardware acceleration
    • Displays and AV connections
    • Live TV and recording
  1. Emby Learn
  2. Media files and containers
  3. Container structure
  4. Track and programme descriptions
  5. MPEG-TS program tables (PAT and PMT)
Search Results for

    Show / Hide Table of Contents

    MPEG-TS Program Tables: PAT and PMT

    PAT and PMT describe which transport-stream packets belong to each programme and what media those packets carry.

    Join a television transport stream halfway through a programme. Packets are arriving with many different PIDs, or packet identifiers. The receiver needs to learn which identifiers belong to the selected service before it can choose video and sound.

    The discovery route begins with the Program Association Table (PAT) on PID 0. It maps programme numbers to the PIDs carrying their Program Map Tables (PMTs). Each PMT then describes that programme's components.

    A PAT maps programme 7 to a PMT, whose entries identify separate video and audio packet identifiers.

    Programme 7 and the nonzero PIDs are an example. The PAT's PID 0 is defined by MPEG systems.

    Programme discovery: PAT, PMT, and component PIDs

    1. Filter packets on PID 0 and assemble the PAT section.
    2. Find programme 7's entry: its PMT is carried on PID 0x0100.
    3. Filter that PID and assemble the PMT.
    4. Read its components: video at PID 0x0101 and audio at PID 0x0102 in this example.
    5. Use the stream descriptions and descriptors to route those components to the appropriate decoders.

    The transport headers identify packets, while tables describe what their identifiers mean. A PID is an address within this multiplex, not a globally meaningful name for an audio codec. Another recording can use different PIDs for the same kinds of component.

    A table section can occupy more than one transport packet. The receiver assembles it using section framing and can check its CRC before accepting the description. Repetition lets receivers discover the structure after joining, and table versions distinguish updated descriptions from repeats of the same information.

    A clock and several component timelines

    The PMT also names the PID carrying the programme clock reference (PCR). Here it is the video PID. PCR observations help a receiver relate packet delivery to the programme's clock; PTS and DTS then schedule presentation and decoding of the media against timing derived from that system.

    PCR need not be on a separate stream with its own pictures or sound. It can be carried in an adaptation field of packets that also belong to a media PID. That separates the clock's role from the audio/video payload's role.

    When the programme changes

    A service can add an audio component or change its assigned PID. A receiver observing the updated PMT can adjust the set of streams it follows. A short examination containing an old table, or not enough repeated signalling, can give an incomplete view.

    This is useful when inspecting a television recording for Emby. A transport file can preserve multiple programme groupings, and the first video found is not automatically the wanted service. Programme-aware inspection follows the same hierarchy: programme identity, its component PIDs and descriptions, then the properties of the selected media.

    The programme number is a systems grouping. The film or episode name displayed in a library is descriptive information at another layer.

    See Also

    • Streams and Tracks
    • Multiplexing and Demultiplexing
    • Media Probing

    References

    • ITU-T H.222.0 / ISO/IEC 13818-1: MPEG systems
    • FFmpeg n8.1 MPEG-TS demuxer: PAT and PMT parsing
    On this Page
    2026 © EMBY LLC. Please see our terms of use and privacy policy.
    Back to Top