使用ffmpeg创建stopmotion视频 - 渲染时出错

时间:2012-05-29 21:57:08

标签: ubuntu ffmpeg rendering

我正在使用ffmpeg和我制作的一些脚本创建一个stopmotion视频。虽然在我试图渲染的最后一个片段中,我有几个我编辑过的帧。我正在使用的方法之前已经有效,所以我确定它与GIMP改变了文件有关。我使用.png-images。这是我得到的命令和输出:

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]不支持动态更改帧属性”

我该怎么做才能解决这个问题?任何帮助表示赞赏:)

1 个答案:

答案 0 :(得分:0)

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

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

谢谢!