Easy embeddable MP4 mux/demux library.
Fork notice: this fork carries fuzzer-found memory-safety and denial-of-service fixes for the demuxer (
MP4D_openand friends): null-pointer derefs from track-less boxes, integer overflows in allocation-size math, unbounded file-controlled allocations, and O(n²) parsing hangs. Found with libFuzzer + ASan/UBSan against malformed inputs. See the commit history for details on each fix. Upstream appears unmaintained; these patches are offered there via pull request.
Muxing can be done using 3 modes. Default mode uses one big mdat chunk:
This is most efficient mode, but disadvantage is that we need go back and patch mdat chunk size. This can be a problem in some cases, for example if stream transfered over network. To workaround this sequential mode is used:
This mode do not make any backwards seek. And last mode is fragmented aka fMP4.
This mode stores track information first and spreads indexes across all stream, so decoding can start before whole stream available. This mode is sequential too and usually used by browsers and HLS streaming.
- https://github.com/darkskygit/minimp4.rs - rust bindings
- https://github.com/aspt/mp4
- https://github.com/l30nnguyen/minimum_mp4_muxer
- https://github.com/DolbyLaboratories/dlb_mp4demux
- https://github.com/DolbyLaboratories/dlb_mp4base
- https://github.com/ireader/media-server/tree/master/libmov
- https://github.com/wlanjie/mp4
- https://github.com/MPEGGroup/isobmff
- http://www.itscj.ipsj.or.jp/sc29/open/29view/29n7644t.doc
- http://atomicparsley.sourceforge.net/mpeg-4files.html
- http://cpansearch.perl.org/src/JHAR/MP4-Info-1.12/Info.pm
- https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html
- http://xhelmboyx.tripod.com/formats/mp4-layout.txt


