An open API service indexing awesome lists of open source software.

https://github.com/vi/ts2xml

Dump mpegts files as XML, decoding various headers
https://github.com/vi/ts2xml

Last synced: about 1 year ago
JSON representation

Dump mpegts files as XML, decoding various headers

Awesome Lists containing this project

README

          

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:




0x0

13
1
0

1
0x1000





0x1000

23
1
0
0x100
0x1b
0x100


0xf
0x101





0x100


0.7


mpeg_video_0
6233
1.4
0000000109f000000001674d400d92420283f6022000000c800002ed



0x100

63e1537ea562e18bead16ab34ee33af6f2d9ef7a6ef856cd54fb2b8f

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):

./ts2xml.py < 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](https://github.com/vi/ts2xml/issues/new?title=Please+add+xml2ts) on Github or wait until I need it for myself.

For mkv2xml and xml2mkv see https://github.com/vi/mkvparse