← 返回
未分类 中文

ffmpeg

Extract key frames (I-frames) from video files using FFmpeg command line tool. Use this skill when the user needs to pull out keyframes, thumbnails, or impor...
使用FFmpeg命令行从视频文件中提取关键帧(I帧)。当用户需要获取关键帧、缩略图或其他重要图像时使用此技能。
lnj22
未分类 clawhub v0.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 334
下载
💾 0
安装
1
版本
#latest

概述

FFmpeg Keyframe Extraction

Extract key frames (I-frames) from video files using FFmpeg CLI.

Prerequisites

  • FFmpeg installed and available in PATH
  • Input video file (MP4, MKV, AVI, MOV, etc.)

Methods

Method 1: Select Filter (More Control)

ffmpeg -i <input_video> -vf "select='eq(pict_type,I)'" -vsync vfr <output_pattern>
Method 2: Skip Frame (Faster)

ffmpeg -skip_frame nokey -i <input_video> -vsync vfr <output_pattern>
Key Options
Option	Description
-i <file>	Input video file
-vf "select='eq(pict_type,I)'"	Filter selecting only I-frames
-skip_frame nokey	Skip decoding non-keyframes (performance)
-vsync vfr	Variable frame rate, prevents duplicates
-q:v <n>	Quality (1-31, lower = better, for JPEG)
-frame_pts 1	Use presentation timestamp in filename
Output Patterns
frame_%03d.png - PNG sequence (frame_001.png, frame_002.png...)
frame_%03d.jpg - JPEG sequence
frame_%d.bmp - BMP sequence
Examples
Basic PNG extraction:

ffmpeg -i video.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr keyframe_%03d.png

High-quality JPEG:


ffmpeg -i video.mp4 -skip_frame nokey -vsync vfr -q:v 2 keyframe_%03d.jpg

With timestamps:


ffmpeg -i video.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr -frame_pts 1 keyframe_%d.png


To specific directory:

ffmpeg -i video.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr ./output/keyframe_%03d.png


## Notes
Method 2 (-skip_frame nokey) is faster as it skips decoding non-keyframes
Method 1 offers more filtering flexibility (can combine with other filters)
Keyframe frequency depends on video encoding settings
Use -vsync vfr to avoid duplicate frames in output

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-07 22:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ffmpeg-video-editing

lnj22
剪切、裁剪、合并和分割视频文件——基础视频编辑操作
★ 0 📥 455

pptx

lnj22
Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creati
★ 0 📥 428

ffmpeg-audio-processing

lnj22
提取、标准化、混合和处理音频轨道,进行音频操控与分析
★ 0 📥 431