Skip to main content

Crate media_doctor

Crate media_doctor 

Source
Expand description

media-doctor — media diagnostics harness for DVB / MPEG-2 Transport Streams.

An extensible lint-style analysis framework: individual Diagnostics each check one rule against a TS byte-stream, producing Findings that feed into a Report. A trivial built-in SyncByteCheck proves the harness.

§Feature flags

FeatureDefaultDescription
stdyesstd::error::Error impls
serdeyesJSON report output via serde / serde_json
cliyesclap-based CLI binary, incl. watch (issue #665)

§Quick start (library)

use media_doctor::{Diagnostic, Report, SyncByteCheck};

let mut report = Report::new();
let diag = SyncByteCheck;
diag.run(&[0x47, 0x00, 0x00, 0x10], &mut report);
assert!(report.findings().is_empty());

Modules§

clicli
CLI subcommands and entry-point (feature cli).

Structs§

CcAnomalyCheck
Checks each PID’s continuity_counter for anomalies per §2.4.3.3.
CodecSignallingCheck
Cross-validates PMT stream_type (0x1B/0x24/0x0F) against the actual elementary-stream framing.
Finding
A single diagnostic finding produced by a Diagnostic check.
FpsCadenceCheck
Cross-validates VUI-declared frame rate against the measured PES-timestamp sample cadence for every AVC/HEVC video track.
InterlaceCheck
Surfaces AVC frame_mbs_only_flag == 0 (interlaced coding tools enabled) on every PMT-declared H.264 PID’s first decodable SPS.
Location
Packet / byte-stream location for a diagnostic finding.
ParamSetsCheck
Flags an IDR (AVC) / IRAP (HEVC) access unit that appears on the wire before its PID’s SPS+PPS have been observed.
PatPmtVersionCheck
Tracks PAT and PMT version_number changes across the stream.
PcrCheck
Checks PCR repetition and discontinuity per PID.
PtsCheck
Checks decode-timestamp monotonicity and forbidden PTS_DTS_flags per PES PID.
Report
A collection of Findings produced by one or more diagnostics.
Scte35Check
Checks SCTE-35 splice insertion consistency across the stream.
SyncByteCheck
Checks that every 188-byte TS packet starts with 0x47 (the MPEG-TS sync byte).
WatchState
The continuous ingest + metrics accumulator driving media-doctor watch.

Enums§

Severity
Severity of a diagnostic finding.

Traits§

Diagnostic
A pluggable diagnostic check that examines a Transport Stream byte buffer.

Functions§

check_container_codec
Run every ISOBMFF/CMAF codec-level check against bytes, appending findings to report.
check_dash_mpd
Validate a DASH MPD XML text, appending findings for each violation.
check_hls_playlist
Validate an HLS playlist text, appending findings for each violation.
check_playlist
Validate an HLS playlist, appending findings for each violation.
run_all
Run every registered Diagnostic against a TS buffer.