来自png的ffmpeg ... PNGS子集出错? [英] ffmpeg from pngs... Error with subset of PNGS?

查看:131
本文介绍了来自png的ffmpeg ... PNGS子集出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将要转换为电影的大约1200 png.其中有些缺失:即-_00003.png,_00005.png存在,但是1、2和4不存在.

I have about 1200 pngs that I'm converting into a movie. Some of them are missing: i.e. - _00003.png, _00005.png exist, but 1, 2, and 4 do not.

以下命令适用于其他数据集,但不适用于我当前的png组:

The following command works for other datasets, but not my current set of pngs:

ffmpeg -i pngs/_*.png -y -vcodec mpeg4 -pix_fmt yuv420p -r 25 -filter:v 'setpts=1.2*PTS' p3SN.mp4

我收到此错误:

Output #61, image2, to 'pngs/_00096.png':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #61:0: Video: png, rgba, 3240x2160 [SAR 3937:3937 DAR 3:2], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.107.100 png
Output #62, image2, to 'pngs/_00097.png':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #62:0: Video: png, rgba, 3240x2160 [SAR 3937:3937 DAR 3:2], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.107.100 png
[png @ 0x7fae93170e00] ff_frame_thread_encoder_init failed
Error initializing output stream 63:0 -- Error while opening encoder for output stream #63:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

图像_00097.png中的

.如果我将其删除,则稍后会发生(105).

at image _00097.png. If I remove it, it just happens a little later (105).

我已经通过查看图像的尺寸等检查了图像,并且此范围内的所有图像看起来都一样(我使用_0009?.png进行了检查).

I've checked the images by looking at their dimensions, etc. and all of them in this range look the same (I checked all those with _0009?.png).

知道为什么会这样吗?

这是有问题的文件(中间)和之前/之后的文件:

Here's the offending file (middle) and the one before/after:

推荐答案

您的命令将使用第一个输入覆盖所有输入文件.这是为什么在使用 -y 时会格外小心的示例,它会自动覆盖文件而不会询问您.

Your command will overwrite all of the input files with the first input. This is an example of why to use caution when using -y which will automatically overwrite files without asking you.

您需要告诉 ffmpeg 使用全局模式:

ffmpeg -y -pattern_type glob -framerate 25/1.2 -i "pngs/_*.png" -vcodec mpeg4 -pix_fmt yuv420p -r 25 p3SN.mp4

  • 我相信glob模式选项在Windows上不起作用,但是如果它等效于Linux cat 命令,则可以通过管道传递输出: cat * .png |ffmpeg -i-output.mp4
  • 如果需要,可以使用 -framerate -r 代替setpts.
    • I believe the glob pattern option does not work on Windows, but if it has an equivalent to the Linux cat command you can pipe the output: cat *.png | ffmpeg -i - output.mp4
    • You can use -framerate and -r instead of setpts if desired.
    • 这篇关于来自png的ffmpeg ... PNGS子集出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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