mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 02:52:04 +08:00
12a306021d
old-commit-hash: 29aaa44740b5dae3c1cc0c273c72c7eb53135e5e
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