nopenpilot/tools/lib/mkvparse
George Hotz 29ac3da7b8 merge in tools 2020-01-17 10:07:22 -08:00
..
README.md merge in tools 2020-01-17 10:07:22 -08:00
__init__.py merge in tools 2020-01-17 10:07:22 -08:00
mkvgen.py merge in tools 2020-01-17 10:07:22 -08:00
mkvindex.py merge in tools 2020-01-17 10:07:22 -08:00
mkvparse.py merge in tools 2020-01-17 10:07:22 -08:00

README.md

Simple easy-to-use hacky matroska parser

Define your handler class:

class MyMatroskaHandler(mkvparse.MatroskaHandler):
    def tracks_available(self):
        ...

    def segment_info_available(self):
        ...

    def frame(self, track_id, timestamp, data, more_laced_blocks, duration, keyframe_flag, invisible_flag, discardable_flag):
        ...

and mkvparse.mkvparse(file, MyMatroskaHandler())

Supports lacing and setting global timecode scale, subtitles (BlockGroup). Does not support cues, tags, chapters, seeking and so on. Supports resyncing when something bad is encountered in matroska stream.

Also contains example of generation of Matroska files from python

Subtitles should remain as text, binary data gets encoded to hex.

Licence=MIT