skillfed

pymediainfo

A Python wrapper for the MediaInfo library.

pymediainfo v7.0.1 2.6M downloads/30d#3,003 on PyPI360
Permissive license MIT DORMANT released

What it is and what it does

pymediainfo is a Python wrapper around the MediaInfo library that extracts detailed metadata from multimedia files. It parses video, audio, image, and other media tracks into structured Python objects with attributes like bitrate, frame rate, codec, duration, and dimensions. The package supports Linux, macOS, and Windows, with wheels bundling MediaInfo for common architectures; however, it requires the external MediaInfo library to be present on the system to actually parse files—without it, the package can only process pre-generated XML output from MediaInfo.

You use it by calling `MediaInfo.parse()` with a file path, which returns a `MediaInfo` object containing a list of `Track` objects. Each track's attributes are dynamically populated during parsing and can be accessed directly or converted to a dictionary. The package also supports text output similar to the command-line `mediainfo` tool and can parse existing MediaInfo XML strings directly.

Use it for:

  • Extract video codec, bitrate, frame rate, and duration from media files for transcoding pipelines or quality assessment
  • Retrieve image dimensions, format, and file size for thumbnail generation or asset validation workflows
  • Batch analyze audio tracks to identify channel layout, sample rate, and compression mode for media library cataloging
  • Parse pre-generated MediaInfo XML output when the MediaInfo binary is not available on the deployment system
  • Build media validation tools that check file properties against expected specifications before processing

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pymediainfo extracts detailed metadata from multimedia files by wrapping the MediaInfo library, parsing video, audio, and image properties into structured Python objects.

Yes, if you need to extract multimedia metadata in Python and can ensure the MediaInfo library is installed on your system. The package is stable (Production/Stable status), supports modern Python versions (3.9–3.13), has no known vulnerabilities, and carries a permissive MIT license. However, maintenance is dormant and the external MediaInfo dependency adds installation complexity; verify that your deployment environment can satisfy this requirement before adopting.

Install

pymediainfo on PyPI

pip

pip install pymediainfo

uv

uv add pymediainfo

poetry

poetry add pymediainfo

Installing pymediainfo

Before you install

Medium install friction: wheels are available for Linux x86-64/ARM64, macOS x86-64/ARM64, and Windows x86/x86-64, but the package requires the external MediaInfo library to be present on the system to parse files. Maintenance is dormant (548 days since last release), though the repository remains active with a recent commit on 2025-02-12.

License in practice

MIT license is permissive and imposes no significant restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

from pymediainfo import MediaInfo

media_info = MediaInfo.parse("/path/to/file.mp4")
for track in media_info.tracks:
    print(f"Track type: {track.track_type}, Bit rate: {track.bit_rate}")

The MediaInfo library must be installed on your system; pymediainfo cannot parse media files without it. Wheels bundle MediaInfo for common platforms, but Linux distribution packages or system installation may be required on other systems.

Verify before relying

  • Performance characteristics when parsing large files or batch processing multiple media files
  • Completeness of metadata extraction across different media formats and codecs
  • Whether dormant maintenance status affects compatibility with newer MediaInfo library versions

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance dormant — 548 days since the last release
Last repo commit
First released
Downloads 2,551,681/month — #3,003 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pymediainfo-7.0.1-py3-none-macosx_10_10_universal2.whl; pymediainfo-7.0.1-py3-none-manylinux_2_27_aarch64.whl; pymediainfo-7.0.1-py3-none-manylinux_2_27_x86_64.whl; pymediainfo-7.0.1-py3-none-win32.whl; pymediainfo-7.0.1-py3-none-win_amd64.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

extract video metadataread media file propertiesparse audio informationget image dimensions and formatmultimedia file analysismediainfo python wrapperextract codec and bitrate
media-metadatamultimedia-analysis

More Utilities packages