Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用FFMPEG(C#)从视频中获取特定帧_C#_Video_Ffmpeg_Frames - Fatal编程技术网

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

使用FFMPEG(C#)从视频中获取特定帧,c#,video,ffmpeg,frames,C#,Video,Ffmpeg,Frames,我希望使用ffmpeg从视频中获取每个指定帧。 从现在起,我有以下代码: "-i example.mp4 -vf fps=30,select='between(t,2,3)' -vsync 0 image%d.bmp" 它在指定的secounds之间生成帧,但我希望按帧的数量获取帧,例如:每3帧、每10帧或每10帧。框架 有什么方法可以做到这一点吗?使用 "-i example.mp4 -vf select='not(mod(n,5))' -vsync 0 image%d.bmp" 这将每5

我希望使用ffmpeg从视频中获取每个指定帧。 从现在起,我有以下代码:

"-i example.mp4 -vf fps=30,select='between(t,2,3)' -vsync 0 image%d.bmp"
它在指定的secounds之间生成帧,但我希望按帧的数量获取帧,例如:每3帧、每10帧或每10帧。框架

有什么方法可以做到这一点吗?

使用

"-i example.mp4 -vf select='not(mod(n,5))' -vsync 0 image%d.bmp"
这将每5帧生成一次(0,5,10,15…)


(删除了fps过滤器。它可以复制或删除源中的帧)。

谢谢,这正是我要找的。有没有办法把速度提高一点?没有。大部分时间都花在注销上。如果将选定的帧保存到AVI
-c:v bmp out.AVI,则可以保存约25%。