Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mextractor-6.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

mextractor-6.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file mextractor-6.0.0.tar.gz.

File metadata

  • Download URL: mextractor-6.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.6.59

File hashes

Hashes for mextractor-6.0.0.tar.gz
Algorithm Hash digest
SHA256 44e50b0732c280bba3416faa65bccde345b05ef7e869d6c8bf33886edc10c551
MD5 4e2cfa12b2b191cfbab6cfd738c2c003
BLAKE2b-256 72ad88139652bf0c9d816bf257cb750787df198a5ace2b477f3f02964b050b40

See more details on using hashes here.

File details

Details for the file mextractor-6.0.0-py3-none-any.whl.

File metadata

  • Download URL: mextractor-6.0.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

Hashes for mextractor-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c861fbf3228051260344837cec6d34d2b9f0fb08e6364fe7c155f82ec701b5d
MD5 9cbaf0446438e09a30e212990b290394
BLAKE2b-256 4e4c99b9e6b3efafeec44ea44cc0f63fa53068817601049d1aaa1474d16be9a5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page