Video Frame Extractor
Run this skill to convert videos into JPG frames for downstream inspection or dataset preparation.
Inputs
- •
input_dir: Directory containing videos to process. - •
time_interval: Seconds between frame timestamps. Default:30.
Behavior
- •Discover video files in
input_dir(optionally recursive). - •For each video, create output folder
<video_parent>/<video_filestem>/. - •Extract frames as JPG at timestamps
0, interval, 2*interval, .... - •Always include first frame and last frame.
- •Keep original video resolution (no scaling filter).
- •Process multiple videos in parallel with configurable workers.
- •Randomly sample output directories/images and validate sample images with
ffprobe.
Commands
Basic run:
bash
python3 scripts/extract_video_frames.py /path/to/videos
Custom interval and workers:
bash
python3 scripts/extract_video_frames.py /path/to/videos --time-interval 15 --workers 8
Recursive search + deterministic QA sampling:
bash
python3 scripts/extract_video_frames.py /path/to/videos --recursive --sample-dirs 5 --sample-images 4 --seed 123
Rehearsal Command
Use the user-provided rehearsal input:
bash
python3 scripts/extract_video_frames.py /ssd5/downloaded-video-playlist/mibao/downloads --time-interval 30 --recursive
Script Reference
- •
scripts/extract_video_frames.py- •Requires
ffmpegandffprobeinPATH - •Supported video extensions:
.mp4,.mkv,.avi,.mov,.webm,.flv,.m4v,.mpg,.mpeg,.ts - •Exit code
0when all processed videos succeed - •Exit code
1when one or more videos have extraction issues - •Exit code
2for invalid inputs or missing binaries
- •Requires
Notes
- •The script writes JPG files directly under each per-video folder.
- •Filename pattern encodes frame order and timestamp.
- •Random QA sampling validates JPEG codec and dimensions on sampled files.