skillfed

pymp4

Python parser for MP4 boxes

pymp4 v1.4.0 931.6K downloads/30d#4,701 on PyPI94
Permissive license Apache-2.0 DORMANT released

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 pymp4

uv

uv add pymp4

poetry

poetry add pymp4

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Multimedia :: Sound/AudioTopic :: Multimedia :: VideoTopic :: Utilities

Tags

mp4 box parsermp4 file structure parsingmp4 metadata extractionbinary mp4 parsingmp4 toolkitconstruct-based mp4
mp4-parsingbinary-formatmedia-metadata

More Utilities packages