mextractor can extract media metadata to YAML and read them
Project description
mextractor: media metadata extractor
Videos and images can be large.
Installation
Download and install from PyPi with pip
:
pip install mextractor
If you are extracting metadata from videos, install additional dependencies:
pip install mextractor[video-extract]
Usage
Please back up your files before using them with the package, things might break during runtime causing corruption.
Command line interface (CLI)
Copy directory to a new directory while extracting media info and a single frame from videos in subdirectories:
mextractor video-subdirs <path_to_root>
Programmatically
These functions are useful when integrating mextractor to your own package. You can also use it for quick scripts, see the mextractor.workflows
submodule for inspiration.
Extract and dump metadata
Video
from mextractor.workflow import extract_and_dump_video
metadata = extract_and_dump_video(dump_dir, path_to_video, include_image, greyscale, lossy_compress_image)
Image
from mextractor.workflow import extract_and_dump_image
metadata = extract_and_dump_image(dump_dir, path_to_image, include_image, greyscale, lossy_compress_image)
Load media
Video
import mextractor
video_metadata = mextractor.load(mextractor_dir)
print(video_metadata.average_fps)
print(video_metadata.frames)
print(video_metadata.resolution)
print(video_metadata.video_length_in_seconds)
Image
import mextractor
image_metadata = mextractor.load(mextractor_dir)
print(image_metadata.resolution)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mextractor-5.1.0.tar.gz
.
File metadata
- Download URL: mextractor-5.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.6.59
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e01f927c94db4f62f4bbc19764715c64711d103d535d269cf00826743d160a4f |
|
MD5 | 4ca128a3c643c9bd669f0a1a1008fa63 |
|
BLAKE2b-256 | 46e616018b20bc62e499ec489147adf4e03d68c0edaa5d300f6f9c773b7c7274 |
File details
Details for the file mextractor-5.1.0-py3-none-any.whl
.
File metadata
- Download URL: mextractor-5.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.6.59
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 948e435cfaa21cf765e36a88e9002309896ba318c1b1d8c1b984fe93b276cb36 |
|
MD5 | 611d9f828817f346ce0c99aaea501508 |
|
BLAKE2b-256 | aa4aa7675ffa2548a06ebf1f9f7d44e7f12409033f9c786123bfbb2e35612e14 |