Run2 Video Frame Extraction

Extracts all key frames from a video file into a specified output directory using FFmpeg.

cxcscmu Updated

File contents

Overview

This skill extracts keyframes (I-frames) from video files into individual PNG files. This is useful for object detection over time.

Usage

To extract keyframes as PNG files, use the following command:

ffmpeg -i <input_file> -vf "select='eq(pict_type,PICT_TYPE_I)'" -fps_mode vfr -vsync vfr /root/keyframes_%03d.png
  • -i: Input video file.
  • -vf "select='eq(pict_type,PICT_TYPE_I)'": Select only I-frames.
  • -fps_mode vfr: Specifies variable frame rate mode for keyframes.
  • -vsync vfr: Maintains synchronization by setting variable frame rate.
  • /root/keyframes_%03d.png: Output filename pattern.

cxcscmu/SkillLearnBench commit 3f5722b882

Frequently asked questions

npx get-skill add cxcscmu/run2-video-frame-extraction