如何指定无序图像列表? [英] How to specify unordered image list?

查看:78
本文介绍了如何指定无序图像列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试弄清楚如何指定要转换为视频的图像的特定列表.我确实知道我们可以做类似的事情:

I'm trying to figure out how to specify a specific list of images to be converted into a video. I do know that we can do something like:

ffmpeg -i image_04%d.png

这将从文件夹中选择与序列匹配的所有图像.但是在我的情况下,图像文件不一定按照其名称所暗示的顺序排列.原因是订单保留在数据库上,文件名本质上是数据库的行ID.

That would pick all the images from the folder that match the sequence. However in my case the image files are no necessarily in the order as its name implies. The reason is that the order is kept on a database and the file names are essentially the database row id.

如何指定正确的输入顺序?我本质上是从代码而不是从命令行调用ffmpeg的.因此,也欢迎对代码进行任何更改.

How could I specify the correct input sequence? I'm essentially calling ffmpeg from code and not from the command line. So any changes ideas to the code are also welcomed.

谢谢!

推荐答案

好,解决方案是修补image2类,以支持带有可供选择的数字的列表.我提供给ffmpeg输入文件模式以及具有指定顺序的数字数组,以读取输入.效果很好.

Well, the solution was to patch the image2 class to support a list with the numbers to pick from. Than I provided to ffmpeg the input file pattern along with an array of numbers with the specified order to read the input. This worked perfectly.

这篇关于如何指定无序图像列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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