Dissecting media file formats with Kaitai Struct
Media file formats grow progressively more and more complex every year and supporting them all requires tremendous effort of all the FOSS developers. It's a problem that concerns not only low-level library developers, but higher level software as well: for example, audio sequencer or video editor developer will still need solid understanding of underlying media file format structure to be able to debug any problems with it (like non-standard chunks inserted by some properitary software). We'd want to present Kaitai Struct, a new free/open source solution for file format dissecting, visualization and parsing. It is "write one - run everywhere" solution, where one needs to specify declarative file format spec once, and then compile it into ready-made parsing library in a large variety of supported target languages. And our visualization tools make Kaitai Struct work like "Wireshark for media files".
Kaitai Struct started as an in-house tool in 2014 and was initially released as open-source project to public at March-April, 2016, supporting only 2 target languages: Java and Ruby. Since then, we've collected 400+ stars a GitHub, hundreds of praising testimonials, got about a dozen of contributors, implemented support for 8 languages, got a handful of useful tools, like console visualizer, GUI visualizer, Web IDE, etc.
Kaitai Struct is frequently compared to proprietary template-enabled hex editors (like 010 Editor, Synalize It! or Hexinator), but goes one step forward: it's not only about highlighting entities in hex dump, but also it can automatically generate working API from spec, which accelerates work of file formats considerably and greatly reduces human factor errors when developing parsers by hand. One's guaranteed to get exactly the same parsing result both in visualizer and using the compiled API. And, what's important, it's free and open source.
Some other comparable projects include BinPAC (but it's C++ only), Preon (which is Java-only), PADS (which targets only C & Haskell), and Construct (Python only). In comparison, Kaitai Struct offers cross-language support, and includes visualization tools.
For media file dissection, we have a growing collection of well-known media file formats (including MP4 / QuickTime .mov, AVI, GIF, JPEG, PNG, TIFF, etc), and other interesting file formats (like executables, byte-code, network protocols, etc, etc). We hope that open media software developers would find Kaitai Struct to be a helpful ally in their arsenal of tools to deal with the diverse world of modern file formats.
|Mikhail Yakshin (GreyCat)|