You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何同时使用palettegen=stats_mode=single与paletteuse=new和paletteuse=dither?

Webm转GIF:解决抖动参数添加失败与色彩范围不足问题

1. 修正单FFmpeg命令脚本(添加抖动效果)

你之前重复调用paletteuse的写法错误,只需在同一个paletteuse滤镜中合并指定new=1和抖动参数即可。修正后的完整脚本:

forfiles /s /m *.webm /c "cmd /c ffmpeg -y -i "@FILE" -lavfi palettegen=stats_mode=single[pal],[0:v][pal]paletteuse=new=1:dither=bayer:bayer_scale=3 "GIF_@FNAME".gif"
  • 说明:paletteuse的参数支持合并书写,new=1启用单帧调色板更新,dither=bayer:bayer_scale=3开启拜耳抖动并设置强度,无需拆分滤镜链。

2. 解决双命令脚本的色彩范围问题

第二个脚本色彩范围不达预期,是因为palettegen默认基于全局帧统计生成调色板,无法覆盖单帧内全部色彩。给palettegen添加stats_mode=single参数即可解决:

forfiles /s /m *.webm /c "cmd /c ffmpeg -y -i "@FILE" -vf palettegen=stats_mode=single palette.png && ffmpeg -i "@FILE" -i palette.png -filter_complex paletteuse=dither=bayer:bayer_scale=3 -r 60 "GIF_@FNAME".gif && del palette.png"
  • 额外优化:末尾添加del palette.png,自动清理临时调色板文件,避免冗余文件堆积。

内容的提问来源于stack exchange,提问作者Astro Space Moth

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 06:15:43