--- id: pymediainfo version: "7.0.1" license: MIT license_treatment: permissive maintenance: dormant --- # pymediainfo — A Python wrapper for the MediaInfo library. License: permissive · Maintenance: dormant · Downloads: 2.6M/mo ## 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 above — 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 pip install pymediainfo uv add pymediainfo 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_current - Install friction: medium - Maintenance: dormant - Downloads: 2.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags extract video metadata, read media file properties, parse audio information, get image dimensions and format, multimedia file analysis, mediainfo python wrapper, extract codec and bitrate, media-metadata, multimedia-analysis [View on SkillFed](https://skillfed.io/packages/pymediainfo) · [View on PyPI](https://pypi.org/project/pymediainfo/)