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.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mextractor-6.0.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for mextractor-6.0.2.tar.gz
Algorithm Hash digest
SHA256 c62c6610b5fb15d9f7b25b0af181a7205c2e450dda4191335e25d38cafa06781
MD5 a0c7dc75c4ade07ee306d470544c57d0
BLAKE2b-256 478a6581047028b849a09c60a0a16e9ad6f5ca0e4d547bbb808245a320d6d96f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mextractor-6.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 090546b98935e640dedbc368c46cd149b742ad48f65934d642b3d14719773a31
MD5 4adb2f333291e779c989d71e3d6f5a6c
BLAKE2b-256 14d78bbbf960d61c760421ad68cc172a31d1942474cd16a503f3273b229b3b66

See more details on using hashes here.

Supported by

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