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
Built Distribution
File details
Details for the file agl_frame_extractor-0.1.0.tar.gz
.
File metadata
- Download URL: agl_frame_extractor-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9985ff5107b4572593cf43f88adb62dea1201546a171baf5176e090e388568c6 |
|
MD5 | ddec7a35e9ec5f35bf9b2ec9cf9fbf07 |
|
BLAKE2b-256 | e0a2f8672986d2d7b00dacde183ee72a1d584d72d04170be7936c3f587483c5d |
File details
Details for the file agl_frame_extractor-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: agl_frame_extractor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f4ca46400a7a530139289f01bfecb907b99977dfaf32a2348050ee62fef9b23 |
|
MD5 | 133c755fc0023f35229d5e82a836d5fc |
|
BLAKE2b-256 | a97ac37a1c550b3f23f31274066fe5c31f92ac3126f427338907fc869e406a83 |