Features
- Formatted data from ffprobe/mediainfo
- Fallback data in case ffprobe/mediainfo cannot get data
- Identical data structure
- Full compatability with Python 3
Install
pip install PyProbe
Usage
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,
}
]
}
Metadata
Release files for PyProbe 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| PyProbe-0.1.2.tar.gz | 7.6 kB | Without provenance | Details |
Release files / PyProbe-0.1.2.tar.gz
| Download URL | PyProbe-0.1.2.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c4b0b7cb008851f3bd2629702bcf54f62d5284ee0556069cdbf1097f6866ce9
|
|
BLAKE2b-256 checksum How to use checksums |
cd0a60e89a889adf6e43667eac62d055930507b9b5f5cce8418d1ca210e10699
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8
|
Security for PyProbe 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.