small-teton

mpeg-ts-analyzer

small-teton

An MPEG-2 Transport Stream analyzer that checks compliance with ISO/IEC 13818-1 timing requirements, supporting both 188-byte and 192-byte TS packets.

v2.1.1
Published at
Aug 15, 2026
37
Stars
398
Download
Synced at
18d ago

Latest release

v2.1.1Aug 15, 2026, 07:11 AM
Downloads slow? Switch the source anytime above

README

Project Overview

mpeg-ts-analyzer is an MPEG-2 Transport Stream analyzer (ISO/IEC 13818-1). It parses TS packets and checks whether the stream conforms to the following requirements defined in the specification:

Key Features

  • Timing compliance checks: Max PCR interval should be no greater than 100 ms; PCR-PTS max gap (end-to-end delay) should be no greater than 1000 ms; PTS/DTS anomalies (timestamps going backward, 33-bit wraparound, large forward jumps) are detected and reported
  • Structure dumping: Supports dumping TS header and payload, adaptation field (including PCR), PSI tables (PAT/PMT) with CRC32 validation, PMT ES info descriptors (ISO 639 language, registration, AVC/HEVC video, AAC audio, teletext, DVB subtitling), PES header with PTS/DTS timestamps
  • PCR jitter analysis: Per-interval deviation from the expected PCR
  • Continuity_counter validation: Per-PID error summary
  • Auto-detected packet size: Supports both 188-byte TS packets and 192-byte M2TS packets (BDAV format)
  • Multi-program support: Lists all programs; use --program to analyze a specific program
  • Additional features: --dump-bitrate summarizes per-PID average/peak bitrate; --list-programs lists programs without PES analysis

Target Audience

  • Broadcast engineers and video streaming developers who need to check MPEG-2 TS stream timing compliance
  • Developers who need to analyze TS packet structures

Quick Start

  • Homebrew (macOS/Linux): brew install small-teton/tap/mpeg-ts-analyzer
  • Debian/Ubuntu: Download the .deb package from Releases and install
  • RHEL/CentOS/Fedora: Download the .rpm package and install
  • Alpine: Download the .apk package and install
  • Go install: go install github.com/small-teton/mpeg-ts-analyzer/v2@latest
  • Basic usage: mpeg-ts-analyzer [input file path] [flags]

Core Advantages

  • Purpose-built for timing compliance: Directly gives a pass/fail result for PCR interval and PCR-PTS gap
  • Compared to ffprobe: ffprobe exposes PTS/DTS but not PCR, making PCR-related checks impossible
  • Compared to TSDuck: TSDuck provides raw timestamps but still requires scripting for interval/gap computation
  • Spec-level field dump: Every field is printed exactly as defined in ISO/IEC 13818-1

System Requirements

  • OS: Cross-platform (macOS, Linux)
  • Architectures: Not explicitly listed; linux_amd64 prebuilt packages are provided

Release history

Sort