使用ffmpeg转换图像序列 [英] convert image sequence using ffmpeg

查看:66
本文介绍了使用ffmpeg转换图像序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用ffmpeg使用以下语法将jpeg序列转换为视频

I have been using ffmpeg to convert a sequence of jpegs to a video using the following syntax

ffmpeg -f image2 -i frame%d.jpg -vcodec mpeg4 -b 800k video.avi

它可以正常工作,但是如果文件名不是从0开始,然后以升序顺序进行,则会得到奇怪的结果.例如,目录中的第一个文件是frame1,最后一个文件是fram61.我应该指出,即时通讯始终使用按乱序排列的jpeg列表.例如名为frame1,fram2,fram3等的文件列表.

it works a treat, however if the filenames dont start at 0 and then pursue in accending order I get weird results. for example the first file in the directory is frame1 and last file is fram 61.I should point out that im always using a list of jpegs which accend in incrental order. for example a list of files called frame1, fram2, fram3 etc.

以下工作正常

frame1.jpg to frame9.jpg

frame1.jpg至fra​​me10.jpg从frame2.jpg到frame8.jpg从frame2.jpg到frame10.jpg从frame2.jpg到frame11.jpg从frame2.jpg到frame17.jpg从frame2.jpg到frame20.jpg从frame2.jpg到frame30.jpg从frame2.jpg到frame61.jpg

frame1.jpg to frame10.jpg frame2.jpg to frame8.jpg frame2.jpg to frame10.jpg frame2.jpg to frame11.jpg frame2.jpg to frame17.jpg frame2.jpg to frame20.jpg frame2.jpg to frame30.jpg frame2.jpg to frame61.jpg

以下内容无效

26 to 57 fail

11至61失败10至61失败20至61失败24至61失败

11 to 61 fail 10 to 61 fail 20 to 61 fail 24 to 61 fail

我可以修改ffmpeg的参数,以便无论文件名如何都能制作视频?(帧%d)

Can I modify the arguments for ffmpeg so that it will make the video regardless of the filenames? (frame%d)

推荐答案

您可以重命名所有jpeg文件,以便编号始终从零开始并且没有空格.

You could rename all jpeg files so the numbering always starts at zero and there are no gaps.

这篇关于使用ffmpeg转换图像序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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