从图像创建视频时,每秒会降低ffmpeg的图像速度 [英] slow ffmpeg's images per second when creating video from images

查看:76
本文介绍了从图像创建视频时,每秒会降低ffmpeg的图像速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个演示视频的一系列屏幕截图,我想将它们放到视频中.我为此使用ffmpeg.命令为ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4 demo.avi.但是,视频长度比我想要的短,并且移动非常快.如何指定我每秒想要多少张图像?我尝试了-r参数,但是没有用.

I have a series of screenshots from a demo that I want to put in a video. I am using ffmpeg for this purpose. The command is ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4 demo.avi. However, the video length is shorter than what I want, and it moves very fast. How do I specify how many images per second I want? I tried the -r argument but that did not work.

推荐答案

您可以通过调整演示时间戳"(PTS)来更改视频速度. 就您而言:

You can change video speed by adjusting the "presentation time stamp" (PTS). In your case:

ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4  -vf "setpts=5*PTS" demo.avi

您将获得比普通视频慢5倍的视频.

You'll get video, which plays 5 times slower, than normal video.

如果要使其速度提高5倍:

If you want to make it 5 times faster:

ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4  -vf "setpts=(1/5)*PTS" demo.avi

这篇关于从图像创建视频时,每秒会降低ffmpeg的图像速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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