【发布时间】:2020-03-30 19:38:27
【问题描述】:
我想使用 ffmpeg (ffmpeg version 2.8.15-0ubuntu0.16.04.1) 使用调色板从我的 mp4 电影中生成 gif。如果我不使用调色板,一切正常:
$ ffmpeg -i in.mp4 -filter_complex "scale=160:-1" out.gif
...
frame= 2003 fps=251 q=-0.0 Lsize= 21172kB time=00:01:20.12 bitrate=2164.7kbits/s
video:21155kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.077667%
但是使用这样的调色板会导致Buffer queue overflow, dropping 消息和截断的视频
$ ffmpeg -i in.mp4 -filter_complex "[0:v] scale=160:-1, split [a][b];[a] palettegen [p];[b][p] paletteuse" out.gif
....
[Parsed_paletteuse_3 @ 0xc56de0] [framesync @ 0xd1af08] Buffer queue overflow, dropping.
Last message repeated 36 times
[Parsed_paletteuse_3 @ 0xc56de0] [framesync @ 0xd1af08] Buffer queue overflow, dropping.
Last message repeated 106 times
...
[Parsed_palettegen_2 @ 0xc56d40] 255(+1) colors generated out of 1347441 colors; ratio=0.000189
frame= 65 fps=5.4 q=-0.0 Lsize= 1036kB time=00:01:20.12 bitrate= 105.9kbits/s
video:1035kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.124664%
【问题讨论】:
-
确实如此。最终输出显示只处理了
frame= 65。frame= 2003在第一个示例中被处理。