0

我目前正在 ffmpeg 和我制作的一些脚本的帮助下创建一个定格动画视频。尽管在上一个剪辑中我尝试渲染,但我已经编辑了几帧。我使用的方法以前有效,所以我确定它与 GIMP 更改文件有关。我使用 .png 图像。这是我得到的命令和输出:

ffmpeg -sameq -f image2 -r 7 -i "$src_dir/frame-%06d.png" -r 25 "$dest_dir/$file_name.avi"

输出:

ffmpeg version 0.8.1-4:0.8.1-0ubuntu1, Copyright (c) 2000-2011 the Libav developers
  built on Mar 22 2012 05:09:06 with gcc 4.6.3
This program is not developed anymore and is only provided for compatibility. Use avconv instead (see Changelog for the list of incompatible changes).
Input #0, image2, from '/mnt/storage/selected_frames/005-Middag-Animation/frame-%06d.png':
  Duration: 00:00:02.85, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: png, bgra, 1280x720, 7 fps, 7 tbr, 7 tbn, 7 tbc
File '/mnt/storage/Videoklipp//005-Middag-Animation.avi' already exists. Overwrite ? [y/N] y
Incompatible pixel format 'bgra' for codec 'mpeg4', auto-selecting format 'yuv420p'
[buffer @ 0x1b88860] w:1280 h:720 pixfmt:bgra
[avsink @ 0x1b8a480] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x1b8ab80] w:1280 h:720 fmt:bgra -> w:1280 h:720 fmt:yuv420p flags:0x4
Output #0, avi, to '/mnt/storage/Videoklipp//005-Middag-Animation.avi':
  Metadata:
    ISFT            : Lavf53.21.0
    Stream #0.0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 2 kb/s, 25 tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
[buffer @ 0x1b88860] Changing frame properties on the fly is not supported.
    Last message repeated 6 times
frame=   13 fps=  0 q=0.0 Lsize=     524kB time=2.20 bitrate=1951.2kbits/s    
video:517kB audio:0kB global headers:0kB muxing overhead 1.323318%

“[buffer @ 0x1b88860] 不支持动态更改帧属性”

我能做些什么来解决这个问题?任何帮助表示赞赏:)

4

1 回答 1

0

感谢 LordNeckbeard 的评论,我注意到 ffmpeg 已将视频拆分为具有“bgra”色彩空间的 png,而 GIMP 使用“rgb24”保存了 png。我为解决这个问题所做的是从 GIMP(过滤器 -> 批处理 -> 批处理...)运行批处理作业,并在同一个视频(已编辑和未编辑)中加载我想要的所有图像并选择展平图像以便进行更改并保存图像,使它们都使用 rgb24。

然后我可以运行命令以成功制作视频(使用 -qscale 1 而不是 -sameq,如 LordNeckbeard 建议的那样)。

谢谢!

于 2012-05-30T17:34:33.500 回答