使用 FFMPEG (C#) 从视频中获取特定帧

Get the specific frame from a video using FFMPEG (C#)

我想使用 ffmpeg 从视频中获取每个指定的帧。 从现在开始我有这个代码:

"-i example.mp4 -vf fps=30,select='between(t,2,3)' -vsync 0 image%d.bmp"

它在指定秒数之间生成帧,但我想按帧数获取帧,例如:每 3 帧或每 10 帧。

有什么办法吗?

使用

"-i example.mp4 -vf select='not(mod(n,5))' -vsync 0 image%d.bmp"

这将每 5 帧生成一次 (0,5,10,15...)

(删除了 fps 过滤器 .. 从源中复制或丢弃帧)。