FFMPEG多个文件模式无法在单个命令中运行 [英] FFMPEG multiple file pattern not working in single command
问题描述
我想在单个ffmpeg命令中添加多个文件序列,以下是我的代码,正在创建视频,但是仅使用了第一个图像序列,而第二个被忽略了
I want to add multiple file sequences in single ffmpeg command, below is my code, video is getting created but only first image sequence is getting used, second is getting ignored
ffmpeg -y -i input.mp4 -start_number 0000001 -i 1/%07d.png -i 2/%07d.png -filter_complex "[0][1]overlay=x=10:y=10:enable='between(t,0,3)'[v1];[v1][2]overlay=x=10:y=10:enable='between(t,3.8561422222222,6.9761777777778)'[v2]" -map "[v2]" -map 0:a out.mp4
现在的问题是FFMPEG想要连续的图像,我没有连续图像,每个文件夹中都有以 0000001.png
开头的图像,如何在不改变图像的情况下完成此操作>
Now the problem is FFMPEG wants continous images, which i don't have i have images starting from 0000001.png
in each folder, how can i accomplish this without changing much in my images
推荐答案
尝试使用glob模式处理不一致的编号,并使用setpts填充PTS,这样在显示叠加层之前就不会对其进行消耗:
Try the glob pattern to deal with inconsistent numbering and pad the PTS with setpts so the overlay doesn't get consumed before it is displayed:
ffmpeg -y -i input.mp4 -pattern_type glob -i "1/*.png" -pattern_type glob -i "2/*.png" -filter_complex "[0][1]overlay=x=10:y=10:enable='between(t,0,3)'[v1];[2]setpts=PTS+3.856/TB[fg];[v1][fg]overlay=x=10:y=10:enable='between(t,3.8561422222222,6.9761777777778)'[v2]" -map "[v2]" -map 0:a out.mp4
这篇关于FFMPEG多个文件模式无法在单个命令中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!