【问题标题】:FFmpeg source files wild cardFFmpeg 源文件通配符
【发布时间】:2018-03-28 22:09:53
【问题描述】:

我正在使用 FFmpeg 将一系列图像文件加入到电影文件中。

文件从XYZ00000.PNGXYZ00001.PNG 等开始。我在 FFmpeg 命令行中将它们称为XYZ%05d.PNG

效果很好。

但是,如果我删除前(例如)30 个帧,那么我的帧图像从 XYZ00031.PNG 开始,FFmpeg 无法构建并出现错误;

[image2 @ 00000000043f2b40] Could find no file with path 'XYZ%05d.PNG' and index in the range 0-4
XYZ%05d.PNG: No such file or directory

我可以使用备用通配符让 FFmpeg 从最低编号的帧开始吗?

如果我将XYZ00031.PNG 重命名为XYZ00000.PNG,则构建工作正常,但仅添加单个第一帧。它会忽略其他帧。

【问题讨论】:

    标签: ffmpeg


    【解决方案1】:

    使用-start_number

    ffmpeg -start_number 30 -framerate 24 -i XYZ%05d.PNG output.mp4
    

    来自documentation

    start_number
    设置与图像文件模式匹配的文件的索引以开始读取。默认值为 0。

    或全局模式

    ffmpeg -pattern_type glob -i -framerate 10  "*.png" out.mkv
    

    此方法可能不适用于 Windows。

    【讨论】:

    • start_number 仍然要求文件从 0 开始。它确实允许跳过前 n 帧。我不会删除我不想添加的文件,而是保留它们并使用 start_frame。
    • @Some1Else 例如,如果目录中的第一个文件是 img_0030.png,则对我有用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多