Skip to main content

Implementation of a parser for MP4 in pure python.

Project description

yapyMP4

Open In Colab

Why another one?

"Yet Another Parser in Python for Mp4"

This was implemented as a "learning exercise" and a thin (metadata reading) interface for the MP4 container format. It is not as complete as other standard tools (such as ffmpeg) but this code aspires to provide some functionality that is only available through c/c++ interfaces for manipulating and getting meta-data about parts of mp4 files.

The initial motivation is/was to be able to request and partially download mp4 files from streaming endpoints (such as youtube) while only downloading the first few bytes of metadata (in order to learn the chunk/sample offsets).

Usage:

(see also the notebook)

from src.ypapymp4 import MP4Atom

# This will throw an error if the class does not find all the expected root nodes if check_offsets_avail is set to true 
root = MP4Atom.init_from_chunk('test.mp4', head_chunk_max_size = 200000,check_offsets_avail = False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yapymp4-0.0.2a0.tar.gz (11.5 kB view hashes)

Uploaded Source

Built Distribution

yapymp4-0.0.2a0-py3-none-any.whl (11.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page