Repository navigation
Reads the program tables, so a capture of a whole transponder is usable
-a now says what is in a recording rather than listing pids: every program, its
pmt and pcr pid, whether it uses a control word, and each of its streams with
a type and a name. -n then works on one of them, looking the pids up in the
pat and the pmt.
This is the limitation that has been in the readme since the first release. A
transponder normally carries several services with their own elementary streams
and their own control words, so a capture of one is the ordinary case rather
than a special one. Without reading the tables there is no way to know which
pids belong to which programme, the control words of the two services are
interleaved through the file, and picking the wrong one gives output that
decrypts cleanly and is not the programme that was asked for. -p sidestepped it
by making a person read the pids off a hex dump first.
The tables are control information and are not scrambled even when the
elementary streams beside them are, so this works on a recording that has not
been decrypted. Sections are assembled across packets, the pointer field is
honoured, and the mpeg crc is checked: a control structure is the one place in
a transport stream where a corrupt byte changes the meaning of everything after
it, and acting on a bad pat means picking the wrong pids silently.
-n used to be accepted and ignored, documented as a count of expected pids. It
now selects a program.
--json -a emits the tables as data, so a front end can offer a service to pick
rather than making a person read pids off a hex dump. tsdec-gui 0.3.0 does
exactly that.
The test fixtures had been building recordings nobody could read: the pat and
pmt were malformed in three separate ways and the pmt pid the pat pointed at
was never sent on. None of it mattered because nothing read the tables, which
is worth noting on its own. tools/mk_multi_ts.py now builds a recording with two
interleaved services and psi_test checks what comes back, including that
decrypting one leaves the other alone.
Verified on Linux, macOS and Windows.