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
| Feature | Default | Description |
|---|---|---|
std | yes | std::error::Error impls |
serde | yes | JSON report output via serde / serde_json |
cli | yes | clap-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§
- cli
cli - CLI subcommands and entry-point (feature
cli).
Structs§
- CcAnomaly
Check - Checks each PID’s continuity_counter for anomalies per §2.4.3.3.
- Codec
Signalling Check - Cross-validates PMT
stream_type(0x1B/0x24/0x0F) against the actual elementary-stream framing. - Finding
- A single diagnostic finding produced by a
Diagnosticcheck. - FpsCadence
Check - Cross-validates VUI-declared frame rate against the measured PES-timestamp sample cadence for every AVC/HEVC video track.
- Interlace
Check - 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.
- Param
Sets Check - Flags an IDR (AVC) / IRAP (HEVC) access unit that appears on the wire before its PID’s SPS+PPS have been observed.
- PatPmt
Version Check - 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_flagsper PES PID. - Report
- A collection of
Findings produced by one or more diagnostics. - Scte35
Check - Checks SCTE-35 splice insertion consistency across the stream.
- Sync
Byte Check - Checks that every 188-byte TS packet starts with
0x47(the MPEG-TS sync byte). - Watch
State - 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 toreport. - 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
Diagnosticagainst a TS buffer.