video-frame-extractor
Science Score: 31.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.9%) to scientific vocabulary
Keywords
Repository
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Video Frame Extractor
Overview
This Python script extracts frames from video files at a specified frame rate (FPS) and saves them in the desired image format (.jpg, .jpeg, .png, .tif). The script can be run interactively or with command-line parameters.
Features
- Supports multiple video formats (
.mp4,.avi,.mov,.mkv). - Allows users to specify the desired FPS for frame extraction.
- Supports multiple output image formats (
.jpg,.jpeg,.png,.tif). - Provides an interactive prompt if no command-line arguments are given.
- Uses
tqdmfor progress tracking.
Requirements
Ensure you have the following dependencies installed:
bash
pip install opencv-python tqdm
Usage
Run with Interactive Mode
Run the script using Python:
bash
python Video-Frame-Extractor.py
The script will prompt for:
- Input directory: The directory containing video files.
- Output directory: The directory where extracted frames will be saved.
- Desired FPS: The frame rate for extraction.
- Output Image Format: Users can choose between .jpg, .jpeg, .png, .tif.
Run with Command-Line Parameters
Alternatively, users can provide all parameters in one command:
bash
python Video-Frame-Extractor.py --input_dir path/to/videos --output_dir path/to/output --fps 5 --img_format jpg
Example
- Assume the following directory structure before running the script:
/videos ├── video1.mp4 ├── video2.avi - Running the script interactively and providing the
/videosdirectory as input and/framesas output:Enter the input directory containing videos: /videos Enter the output directory for extracted frames: /frames Enter the desired frames per second (FPS): 5 Select the output image format: 1: jpg 2: jpeg 3: png 4: tif Enter the format number: 1 - The extracted frames will be saved in:
/frames ├── video1 │ ├── frame_0000.jpg │ ├── frame_0001.jpg ├── video2 ├── frame_0000.jpg ├── frame_0001.jpg
Code Functionality
- Reads video files from the input directory.
- Extracts frames at the specified FPS.
- Saves frames in the user-specified image format.
- Uses
tqdmto display a progress bar. - Handles both interactive and command-line executions.
LICENSE
This project is licensed under the MIT License.
Owner
- Name: Yu-Cheng Chang
- Login: Yucheng0208
- Kind: user
- Location: Taiwan
- Company: @H-C-Studio @TSVS-Special-Topic-Group
- Website: Building...
- Twitter: Ryan_02_08
- Repositories: 3
- Profile: https://github.com/Yucheng0208
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Chang" given-names: "Yu-Cheng" orcid: "https://orcid.org/0000-0003-1301-9192" title: "Video-Frame-Extractor" license: MIT version: 1.0.0 doi: 10.5281/zenodo.1234 date-released: 2025-04-08 url: "https://github.com/Yucheng0208/Video-Frame-Extractor"
GitHub Events
Total
- Watch event: 1
- Push event: 9
- Create event: 2
Last Year
- Watch event: 1
- Push event: 9
- Create event: 2