It would be useful to be able to dump mkv file to some text (like in mkvinfo -v), edit it and reconstruct back, leaving binary data as hex dumps, for example.
Something like:
$ mkv2xml < test.mkv > test.xml
$ head test.xml
<EBML>
<EBMLVersion>1</EBMLVersion>
<MaxIdLen>4</<MaxIdLen>
<MaxSizeLen>8</MaxSizeLen>
<DocType>matroska</DocType>
<DocTypeVersion>2</DocTypeVersion>
<DocTypeReadVersion>2</DocTypeReadVersion>
<Segment>
<Tracks>
<Track>
<TrackNumber>1</TrackNumber>
<CodecID>V_MJPEG</CodecID>
<Video><PixelWidth>320</PixelWidth><PixelHeight>240</PixelHeight></Video>
</Track>
</Tracks>
<Cluster>
<Timecode>5.023</TimeCode>
<SimpleBlock track="1" time="5.045">
ffd8fffe001a80......
$ xml2mkv < test.xml | mplayer -cache 100 -
This can be useful to simplify writing [debugging] tools work with video without actually messing with muxing/demuxing details, just by looking at output.
Implemented myself in Python: https://github.com/vi/mkvparse
Can convert to xml, change something (with xml2/2xml, for example), convert back and play in one pipeline.
Example XML file: http://vi-server.org/pub/xml2mkv_test.xml
Trimmed (even more) snippet here: