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

Ubuntu 使用ffmpeg创建stopmotion视频-渲染时出错,ubuntu,ffmpeg,rendering,Ubuntu,Ffmpeg,Rendering,我目前正在使用ffmpeg和我制作的一些脚本创建一个stopmotion视频。虽然在上一个剪辑中,我试图渲染,但我已经编辑了几个帧。我正在使用的方法以前已经工作过了,所以我确信它与GIMP更改文件有关。我使用.png图像。这是我得到的命令和输出: ffmpeg-sameq-f image2-r7-i“$src_dir/frame-%06d.png”-r25“$dest_dir/$file_name.avi” 输出: ffmpeg version 0.8.1-4:0.8.1-0ubuntu1, C

我目前正在使用ffmpeg和我制作的一些脚本创建一个stopmotion视频。虽然在上一个剪辑中,我试图渲染,但我已经编辑了几个帧。我正在使用的方法以前已经工作过了,所以我确信它与GIMP更改文件有关。我使用.png图像。这是我得到的命令和输出:

ffmpeg-sameq-f image2-r7-i“$src_dir/frame-%06d.png”-r25“$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%
“[缓冲区@0x1b88860]不支持动态更改帧属性”


我能做些什么来解决这个问题?感谢您的帮助:)

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

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


谢谢大家!

不要使用
-sameq
。它并不意味着“相同的质量”,您将其作为输入选项应用,这不是典型的惯例。使用
-qscale
代替值2-5。您可以使用ffmpeg比较原始图像和GIMP图像:
ffmpeg-i frame-003582.png-i frame-004286.png