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
mextractor-5.0.0.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for mextractor-5.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d210230f2e9a01cf6aa4dc2c04318271554921df5ad92d99d968d08102f75be |
|
MD5 | b6cf2faf6a89d4944f6793cebb4ecb37 |
|
BLAKE2b-256 | 39dc3600c5bb3ae15dcbcd5a5299c6ade392bb2ccea617ba28c4dfb28961de3c |