Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Dump mpegts files as XML, decoding various headers
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

ts2xml reads mpegts file from stdin and dumps it as special XML file containing packets with their headers.

ts2xml is stateful: it reads PATs and PMTs and remembers how PIDs should be handled.

Example of resulting XML file:


The primary use cases of the tool are:

  • Learning about MpegTS and PES formats
  • Debugging issues with MpegTS

Example invocation (extract raw stream of pid 0x100 to file):

./ < q.ts | xml2 | grep 'packet/pid\|/data=' | grep -A 1 '/pid=0x100' | grep 'data=' | cut -f 2- -d= | tr -d '\n' | xxd -r -p | pv > q.raw

If you want xml2ts for the reverse conversion, open an issue on Github or wait until I need it for myself.

For mkv2xml and xml2mkv see

Something went wrong with that request. Please try again.