mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 11:32:21 +08:00
c0866d9edb
* "The commit-hook project sounds interesting though. I would definitely merge something that runs flake8 and pylint on the modified files!" - pd0wm, https://github.com/commaai/openpilot/pull/1575#issuecomment-634974344 * add pylint to pre-commit and make everything pass * Remove uncommented stuff Co-authored-by: J <user@4800.lan> old-commit-hash: bd0643424357864287ae0485da03f66df85e1fb1
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