pymp4
Python parser for MP4 boxes
What it is and what it does
pymp4 is a Python parser and builder for MP4 box structures, the fundamental building blocks of MP4 files. It wraps the construct library to provide a declarative interface for reading and writing MP4 metadata boxes—the hierarchical structures that describe video codecs, audio properties, timing, and other file-level attributes. You use it to inspect what's inside an MP4 file at the binary level or to programmatically construct valid MP4 box data.
The package is lightweight and has low install friction, depending only on construct. It targets developers who need to work with MP4 internals rather than high-level video playback or encoding. The codebase is in Beta status and has been dormant since late 2023, so it is stable for its current scope but receives no active maintenance.
Use it for:
- Extract codec and format metadata from MP4 files without decoding video frames.
- Validate or repair MP4 box structures in automated media processing pipelines.
- Build custom MP4 headers or metadata boxes for streaming or archival workflows.
- Inspect ftyp (file type), moov (movie), and mdat (media data) box hierarchies for debugging.
- Integrate MP4 parsing into media analysis or transcoding tools that need binary-level access.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and builds MP4 box structures from binary data using the construct library, enabling programmatic inspection and manipulation of MP4 file metadata.
Yes, if you need to parse or build MP4 box structures at the binary level and can tolerate dormant maintenance. The package is lightweight, has no known vulnerabilities, and uses a permissive license. Install only if you are comfortable with no active bug fixes or feature development; for production use, verify that its scope matches your MP4 variant and box types.
Install
pymp4 on PyPI
pip
pip install pymp4uv
uv add pymp4poetry
poetry add pymp4Installing pymp4
Before you install
Low friction installation with a single runtime dependency (construct). The package is dormant—last commit was 2023-11-30 and no release for over 1195 days—so expect no active maintenance or bug fixes.
License in practice
Apache-2.0 is permissive, allowing commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
from pymp4.parser import Box
from io import BytesIO
# Parse MP4 box from binary data
ftyp = Box.parse(b'\x00\x00\x00\x18ftypiso5\x00\x00\x00\x01iso5avc1')
print(ftyp.type, ftyp.major_brand)
# Build MP4 box from dictionary
data = Box.build(dict(type=b"ftyp", major_brand="iso5", minor_version=1, compatible_brands=["iso5", "avc1"]))
Verify before relying
- Whether the package handles all MP4 box types or only a subset of the specification.
- Current compatibility with modern MP4 variants and encoding standards beyond what the classifiers indicate.
- Whether dormancy means the package is stable and complete or abandoned and at risk of bitrot.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.7,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — construct |
| Maintenance | dormant — 1,195 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 931,562/month — #4,701 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymp4-1.4.0-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
construct-classesParses binary data into Python dataclasses and…
permissive · top 15,000 on PyPI
sphinxcontrib-videoA Sphinx extension that embeds HTML5 videos…
permissive · top 15,000 on PyPI
moviepyMoviePy is a Python library for video editing…
permissive · top 5,000 on PyPI
ffmpyffmpy is a Python wrapper around FFmpeg that…
permissive · top 5,000 on PyPI
dissect.cstructParse binary data using C-like structure…
permissive · top 15,000 on PyPI
construct-typingAdds type hints and static type checking…
permissive · top 5,000 on PyPI
ffmpegWraps FFmpeg and FFprobe command-line tools to…
permissive · top 15,000 on PyPI
tinytagReads metadata (artist, title, duration,…
permissive · top 5,000 on PyPI
python-xmp-toolkitRead and write XMP metadata in image and…
permissive · top 15,000 on PyPI
pydubPydub provides a high-level Python interface…
permissive · top 5,000 on PyPI