Description
This library uses ffmpeg to check if a file (such as an mkv video) is corrupt. Any errors generated by ffmpeg when reading the file are assumed to be caused by file corruption.
Installation
pip3 install mediachecker
The ffmpeg command must also be available on your system (and PATH).
Usage
from mediachecker import AVFile
f = AVFile('some_file_to_check.mp4')
file_is_good = f.is_good()
By default, we only scan the first audio track of the file. This should be relatively fast. Alternatively, you can do:
file_is_good = f.is_good(method='full')
which will probably be slower.
If you want to see the output that was generated by ffmpeg, you can use write_log:
file_is_good = f.is_good(write_log=True)
This will save any errors to some_file_to_check.mp4.log.
CLI
Installing the mediachecker package also creates a command-line tool called check_media.
Run check_media -h for help using it. Example usage:
$ check_media -r -l /path/to/my/media/
That will recursively search for media in /path/to/my/media/, scan
each file (using the default method), and write logs for all of them.
TODO
-
Add more command line options
-
Add more tests
-
Enable HW acceleration, e.g.
ffmpeg -hwaccel cuda ... -
Enable debug statements regarding progress, etc.
Metadata
Release files for mediachecker 2022.9.19
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 | Actions |
|---|---|---|---|---|
| mediachecker-2022.9.19.tar.gz | 63.9 MB | Without provenance | Details for mediachecker-2022.9.19.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mediachecker-2022.9.19-py3-none-any.whl | Python 3 | none | any | Details for mediachecker-2022.9.19-py3-none-any.whl |
Total release size: 63.9 MB
Release files / mediachecker-2022.9.19.tar.gz
| Download URL | mediachecker-2022.9.19.tar.gz |
|---|---|
| Size | 63.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50166f0f4270642eaf64e25733b07d56d24888e65524f91d546c0225da6b0b1e
|
|
BLAKE2b-256 checksum How to use checksums |
a15acdb112820f1953ac0be39d17f5cddb0bd20ff5a270673241a552f924ec27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Release files / mediachecker-2022.9.19-py3-none-any.whl
| Download URL | mediachecker-2022.9.19-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ff450d38711f6bd9040b94ce7ec616f0da427f2393599f800c47a7abc8fcf70
|
|
BLAKE2b-256 checksum How to use checksums |
ba5577d40d7d19ca6e846fde5a8055c8a043ea71eb86374838d0c4eb4a4463fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for mediachecker 2022.9.19
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.