Metadata-Version: 2.4
Name: mprobe
Version: 0.0.1
Summary: Read video and audio metadata using ffprobe or avprobe
Author-email: pi11 <webii@pm.me>
Project-URL: Homepage, https://github.com/pi11/mprobe
Project-URL: Issues, https://github.com/pi11/mprobe/issues
Keywords: video,audio,metadata,ffprobe,avprobe
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: THIRD_PARTY_NOTICES
Dynamic: license-file

mprobe
======

Read video and audio metadata with Python 3.10+ and ffprobe (or avprobe).
Install `FFmpeg <https://ffmpeg.org/download.html>`_ separately and ensure
``ffprobe`` is on your PATH; pip does not install it.

Install and use
---------------

.. code-block:: console

   python -m pip install mprobe

.. code-block:: python

   from mprobe import mediainfo

   info = mediainfo("video.mp4", timeout=30)
   print(info.get("duration"))   # seconds, as a string
   print(info.get("format_name"))

Accepts strings and pathlib paths. Values are strings; ``TAG`` and
``DISPOSITION`` contain dictionaries. Repeated fields use the last stream's
value, then the container's value. Fields vary by file and may be absent.
Missing probes raise ``FileNotFoundError``; invalid or missing media raise
``subprocess.CalledProcessError`` (details in ``stderr``). A timeout raises
``subprocess.TimeoutExpired``.

Inspired by `pydub <https://github.com/jiaaro/pydub>`_.
