Bounded offline MPEG-2 TS program structure and media timestamp inspection
git clone https://github.com/xubowen1234/moontsinspect.git
cd moontsinspect
node scripts/check-toolchain.cjsmoon test --target wasm-gc
moon run examples/inventory --target wasm-gc
moon run cmd/inspect --target js -- --summary fixtures/synthetic.ts
node scripts/cli-smoke.cjs
node scripts/crosscheck.cjslet inspector = @ts.Inspector::new().unwrap()
inspector.feed(bytes, fn(event) { println(@ts.event_json(event).stringify()) })
inspector.finish(fn(event) { println(@ts.event_json(event).stringify()) })
let inventory = inspector.program_maps()moon run cmd/inspect --target js -- recording.ts
moon run cmd/inspect --target js -- --summary recording.ts
moon run cmd/inspect --target js -- --recover recording.tspub struct Continuity {
// private fields
}pub struct ElementaryStream {
stream_type : Int
pid : Int
descriptors : Array[Descriptor]
} derive(Eq, Debug)pub(all) enum InspectEvent {
Issue(Diagnostic)
ProgramsChanged(Array[ProgramRef])
ProgramMapChanged(Pmt)
MediaClock(pid~ : Int, offset~ : Int64, ClockSample)
PesTimestamp(pid~ : Int, PesHeader)
} derive(Eq, Debug)pub struct Inspector {
// private fields
}pub struct PacketReader {
// private fields
}fn PacketReader::feed(self : PacketReader, chunk : Bytes, emit : (Result[Packet, Diagnostic]) -> Unit) -> Unitpub struct Pat {
section : LongSection
programs : Array[ProgramRef]
network_pid : Int?
} derive(Eq, Debug)pub struct PcrClock {
// private fields
}fn PcrClock::observe(self : PcrClock, ticks : Int64, discontinuity? : Bool) -> Result[ClockSample, Diagnostic]pub struct PesAssembler {
// private fields
}fn PesAssembler::feed(self : PesAssembler, payload : Bytes, start : Bool, offset : Int64, emit : (Result[PesHeader, Diagnostic]) -> Unit) -> Unitpub struct Pmt {
section : LongSection
pcr_pid : Int
descriptors : Array[Descriptor]
streams : Array[ElementaryStream]
} derive(Eq, Debug)pub struct RecoveryReader {
// private fields
}fn RecoveryReader::feed(self : RecoveryReader, bytes : Bytes, emit : (Result[Packet, Diagnostic]) -> Unit) -> Unitpub struct SectionAssembler {
// private fields
}fn SectionAssembler::feed(self : SectionAssembler, payload : Bytes, start : Bool, offset : Int64, emit : (Result[LongSection, Diagnostic]) -> Unit) -> Unitpub struct TableCollector {
// private fields
}fn TableCollector::accept(self : TableCollector, section : LongSection) -> Result[Array[LongSection]?, Diagnostic]fn mpeg_crc32(bytes : Bytes) -> UIntInstall
Download zipBounded offline MPEG-2 TS program structure and media timestamp inspection