ffmpeg降低帧率时会获得哪一帧 [英] Which frame does ffmpeg get when reducing the frame rate

查看:75
本文介绍了ffmpeg降低帧率时会获得哪一帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些视频,希望每2秒转换为帧图像.

I have some video that I would like to convert to images of frames every 2 sec.

例如如果视频以15 fps的速度播放7秒钟,我想获取第1、31、61、91帧.

E.g. If the video is 7 seconds long at 15 fps I would like to get frames 1, 31, 61, 91.

命令:

ffmpeg -i foo.mp4 -r 0.5  -f image2 -vcodec mjpeg foo%d.jpg

似乎可以执行我想要的操作,但是它得到的是哪个帧?1、31、61、91或30、60、90或13、43、73、103?

appears to do what I want, but which frame does it get? 1, 31, 61, 91 or 30, 60, 90 or 13, 43, 73, 103?

推荐答案

第一张图片将来自第一帧.

The first image will be from the very first frame.

请注意,您可能会获得一张或多张预期的图像.我相信这是因为四舍五入和/或ffmpeg创建了最终图像.例如:您的视频真的长7秒吗?还是7.63秒长?

Note that you very well may get an image or two more that you expect. I believe this is because of rounding and/or that ffmpeg creates a final images. E.g.: Is your video really 7s long? Or is it 7.63s long?

这篇关于ffmpeg降低帧率时会获得哪一帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆