gifgen高質(zhì)量 GIF 編碼
gifgen 是高質(zhì)量的 GIF 編碼,可輸出更細(xì)膩的 GIF 圖像。
使用 ffmpeg 對(duì) GIF 進(jìn)行編碼可能很糟糕,因?yàn)?GIF 僅限于 256 種顏色的調(diào)色板,而 ffmpeg 僅使用通用調(diào)色板來覆蓋各種顏色。
gifgen 通過進(jìn)行 2-pass 編碼產(chǎn)生更好的結(jié)果, 第一遍基于每幀的所有像素生成自定義調(diào)色板, 第二遍再使用此調(diào)色板,而不是與 ffmpeg 捆綁的默認(rèn)調(diào)色板對(duì) GIF 進(jìn)行編碼。
ffmpeg 默認(rèn) Gif 效果
gifgen:
用法
$ gifgen -h gifgen 1.2.0 Usage: gifgen [options] [input] Options: -o Output file [input.gif] -f Frames per second [10] -s Optimize for static background -v Display verbose output from ffmpeg -w Scale output with horizontal resolution -b Begin the clip at a given timestamp (in seconds) -d Duration in seconds of the resulting gif, can be combined with at Examples: $ gifgen video.mp4 $ gifgen -o demo.gif SCM_1457.mp4 $ gifgen -sf 15 screencap.mov $ gifgen -sf 15 -w 320 screencap.mov Begin at 3.5 seconds into the video, make the gif using the next 5.5 seconds $ gifgen -b 3.5 -d 5.5 screencap.mov
安裝
蘋果系統(tǒng)
brew install lukechilds/tap/gifgen
Linux
克隆此 repo ,并將 gifgen 復(fù)制/符號(hào)鏈接到您的 PATH 或直接使用 ./gifgen 運(yùn)行腳本, 需要安裝 ffmpeg。
評(píng)論
圖片
表情
