【问题标题】:How to convert a lump set of PPM files to a single .mp4 video using ffmpeg如何使用 ffmpeg 将一组 PPM 文件转换为单个 .mp4 视频
【发布时间】:2021-08-04 13:10:04
【问题描述】:

我正在尝试使用 ffmpeg 将一些 .ppm 文件转换为单个视频。图片被列为image10.ppmimage20.ppm,一直到image2000.ppm

基本上一个文件夹中有200张image(1-200)0.ppm格式的图片。

我已使用cd 导航到包含图像的正确文件夹,终端将此文件夹显示为我所在的目录。

在终端输入以下命令:

ffmpeg -r 10 -f image2 -s 500x500 -i image%04d.ppm -vcodec libx264 -crf 25  -pix_fmt yuv420p presentation_video.mp4

我收到错误消息:

[image2 @ 0x7ff36180ba00] Could find no file with path 'image%04d.ppm' and index in the range 0-4
image%04d.ppm: No such file or directory

我错过了什么?我刚刚下载了 ffmpeg,对命令行界面来说总体来说还算新。

【问题讨论】:

    标签: ffmpeg


    【解决方案1】:

    您的图像输入文件名不包含前导零,例如image0002.ppm,因此请使用序列模式image%d.ppm

    ffmpeg -framerate 10 -i image%d.ppm -c:v libx264 -crf 25 -vf "scale=500:500,format=yuv420p" -movflags +faststart output.mp4
    

    有关序列模式的更多详细信息,请参阅image demuxer documentation

    【讨论】:

      猜你喜欢
      • 2012-01-20
      • 1970-01-01
      • 2018-02-14
      • 1970-01-01
      • 2010-12-22
      • 2015-07-02
      • 1970-01-01
      • 2017-07-22
      • 2012-02-20
      相关资源
      最近更新 更多