FFmpeg从放置在不同文件夹中的图像制作视频 [英] FFmpeg making video from images placed in different folders

查看:544
本文介绍了FFmpeg从放置在不同文件夹中的图像制作视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从FFmpeg的图像制作视频。我想知道我是否可以将图像放置在不同的文件夹中。像第一张图像放在folder1中,而folder2中的其他图像可以使用folder1和folder2中的两个图像来制作具有任意顺序的两个图像的单个视频。只想知道我可以使用来自两个不同文件夹的图像制作单个视频。如是。是否可以这样做?

解决方案

是的,可以在命令(-i)上指定多个输入,但是在你的情况下更容易,因为订单不算,是使用'concat''过滤器



https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join, %20merge)%20media%20files



它将创建一个包含folder1的所有图像的视频,以及所有的folder2等...
concat过滤器有两种方法:

  ffmpeg -i concat:file1 | file2 etc .... 

  ffmpeg  - f concatii列表... 

对于图像序列,它看起来只是第二种方法的工作。
所以首先创建一个文件来描述你的内容(运行触摸文件并用 nano文件编辑它)并使用以下语法来指定文件的位置以及其命名语法:

  file'./folder1/im% 03d.jpg'
file'./folder2/im%03d.jpg'

保存该文件( nano 将与 CTRL + X
现在运行以下命令:

  ffmpeg -f concat -i list out.mp4 

ffmpeg将使用您的文件作为输入,并在编码过程中按顺序推送所有图像


I am making video from images in FFmpeg. I want to know if I can make video from images placed in different folders. Like first image is placed in folder1 and other in folder2 can I use both images in folder1 and folder2 to make a single video having both images in any order. Just want to know can I use images from two different folders to make a single video. if yes. Than how can i do that?

解决方案

Yes it's possible, you can specify several input on the command (-i) but the more easy in your case as the order doesn't count, is to use the 'concat' ' filter

https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files

it will create a video with all images of folder1 and after all folder2, etc... The concat filter come with 2 methods:

ffmpeg -i concat:file1|file2 etc ....

and

ffmpeg -f concat -i list etc...

for image sequence it look like only the 2nd method work. so first create a file to describe your content (run touch file and edit it with nano file) and use the following syntax to specify where your file are and which is their naming syntax:

file './folder1/im%03d.jpg'
file './folder2/im%03d.jpg'

save the file (under nano it will be with CTRL+X) and now run the following command:

ffmpeg -f concat -i list out.mp4

ffmpeg will use your file as input and push sequentially all your image in the encoding process

这篇关于FFmpeg从放置在不同文件夹中的图像制作视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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