Skip to main content

Extract metadata from video files using ffprobe or mediainfo

Project description


  • Formatted data from ffprobe/mediainfo
  • Fallback data in case ffprobe/mediainfo cannot get data
  • Identical data structure
  • Full compatability with Python 3


pip install PyProbe


import pyprobe
parser = pyprobe.VideoFileParser(ffprobe="/usr/bin/ffprobe", includeMissing=True, rawMode=False)
data = parser.parseFfprobe(inputFile)

This code will return a dictionary of values (as described below).

  • includeMissing Will remove values where ffprobe/mediainfo does not return data
  • rawMode Will make each value the raw output from ffprobe/mediainfo, which will be a string (except resolution, which is a tuple of strings).

There are also two helper functions provided to create more nicely formatted data -

>>> import pyprobe
>>> pyprobe.timeToTuple(12345.44)
(3, 25, 45, 440)
>> pyprobe.sizeStr(12345678.99)
'11.8 MB'

Data format

    "path": str,
    "bit_rate": int,
    "duration": float,
    "size": int,
    "videos": [
            "aspect_ratio": str,
            "bit_rate": int,
            "codec": str,
            "format": str,
            "framerate": float,
            "pixel_format": str,
            "resolution": (
                int # Width,
                int # Height
    "audios": [
            "bit_rate": int,
            "channel_count": int,
            "channel_layout": str,
            "codec": str,
            "format": str,
            "sample_rate": int # Hz
    "subtitles": [
            "codec": str,
            "language": str
    "chapters": [
            "title": str,
            "start": float,
            "end": float,

Project details

Download files

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

Files for PyProbe, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size PyProbe-0.1.2.tar.gz (7.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page