Skip to main content

Extracts frames from .mov files

Project description

agl-frame-extractor

Description

agl_frame_extractor is a Python package designed to extract individual frames and metadata from .MOV video files. This package is highly useful for researchers and clinicians who require frame-by-frame analysis of video data. With applications ranging from medical research to training simulations, the package aims to improve standards and classifications in gastrointestinal endoscopy by enhancing objectivity and reproducibility.

Features

  • Extracts individual frames from .MOV files and saves them as PNG images.
  • Gathers video metadata including total number of frames, frames per second, and video duration.
  • Offers optional multithreading support for faster frame extraction.
  • Generates a log file to record the extraction process.

Installation

To install this package, clone the repository and run the following command in the repository root:

pip install -e .

Usage

Basic Usage

from video_frame_extractor.extractor import VideoFrameExtractor

input_folder = "input_videos"
output_folder = "output_frames_metadata"

extractor = VideoFrameExtractor(input_folder, output_folder)
extractor.extract_frames_and_metadata()

# If you want to extract png files instead of jpgs:
input_folder = "input_videos"
output_folder = "output_frames_metadata"

extractor = VideoFrameExtractor(input_folder, output_folder, image_format='png')
extractor.extract_frames_and_metadata()

Multithreaded Usage

To enable multithreading for faster frame extraction:

from video_frame_extractor.extractor import VideoFrameExtractor

input_folder = "input_videos"
output_folder = "output_frames_metadata"

extractor = VideoFrameExtractor(input_folder, output_folder, use_multithreading=True)
extractor.extract_frames_and_metadata()

Dependencies

  • OpenCV
  • tqdm

Logging

The package generates a log file video_frame_extraction.log in the directory where it is executed. This log file contains detailed information about the extraction process.

Contributing

We welcome contributions to improve this package. Please follow the standard GitHub pull request process. Make sure to document your code thoroughly, keeping in mind that the package targets an academic audience focused on research.

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

agl_frame_extractor-0.1.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

agl_frame_extractor-0.1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file agl_frame_extractor-0.1.1.tar.gz.

File metadata

  • Download URL: agl_frame_extractor-0.1.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.12.0 Windows/11

File hashes

Hashes for agl_frame_extractor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf2e309b508bb3c4bde142f575e75b3bb7fa165d2fc5abe27d8d9e351c3b3e24
MD5 ea8c21e94bac6100f10f666cd7f3f43d
BLAKE2b-256 2f4abb0eceea00e7a7460fe168a667e20621ecc11eb090dbe1223e8edab453bd

See more details on using hashes here.

File details

Details for the file agl_frame_extractor-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agl_frame_extractor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9691237131b43d7242102da5d6c2d294fcc50b4d367663ecd8085e2f6c300a71
MD5 b23d2824a17bf4a266c768bab3ed2fc3
BLAKE2b-256 c163e425f905f42e5a39f07c88377eb88d4977dfa219339e506a99d8120333df

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