我尝试使用下面的这些解决方案,但没有成功:
我的 GIF 动画有 13.5MB。我的电脑有 16GB RAM 内存。我有 8 个 AMD Ryzen 7 2700X CPU。我收到错误:
$ convert -limit memory 2MB -limit map 2MB -limit area 1000MB -delay 2 -loop 0 "Bug do pagamento.gif" Extraídos/bug.png
convert: unable to write pixel cache '/tmp/magick-RSymnnZRmXzueDXGI3ehEtIiUkBcymGa': Sem espaço livre no dispositivo @ error/cache.c/WritePixelCachePixels/5830.
convert: corrupt image `Bug do pagamento.gif' @ error/gif.c/DecodeImage/505.
convert: corrupt image `Bug do pagamento.gif' @ error/gif.c/ReadGIFImage/1368.
convert: no images defined `Extraídos/bug.png' @ error/convert.c/ConvertImageCommand/3285.
zsh: exit 1 convert -limit memory 2MB -limit map 2MB -limit area 1000MB -delay 2 -loop 0
convert -limit memory 2MB -limit map 2MB -limit area 1000MB -delay 2 -loop 0 2,75s user 2,73s system 99% cpu 5,505 total
使用LANG=C
:
$ LANG=C convert -limit memory 2MB -limit map 2MB -limit area 1000MB -delay 2 -loop 0 "Bug do pagamento.gif" Extraídos/bug.png
convert: unable to write pixel cache '/tmp/magick-RlftdgBD6MZCwArQzkuz5QI-kJtui7yk': No space left on device @ error/cache.c/WritePixelCachePixels/5830.
convert: corrupt image `Bug do pagamento.gif' @ error/gif.c/DecodeImage/505.
convert: corrupt image `Bug do pagamento.gif' @ error/gif.c/ReadGIFImage/1368.
convert: no images defined `Extraídos/bug.png' @ error/convert.c/ConvertImageCommand/3285.
zsh: exit 1 LANG=C convert -limit memory 2MB -limit map 2MB -limit area 1000MB -delay 2
LANG=C convert -limit memory 2MB -limit map 2MB -limit area 1000MB -delay 2 2,84s user 2,60s system 99% cpu 5,454 total
tmpfs
:
LANG=C df -h /tmp
Filesystem Size Used Avail Use% Mounted on
tmpfs 7,9G 7,2M 7,9G 1% /tmp
答案1
我终于转向ffmpeg
谁来做这项工作。
这是我用来将 24M 视频转换为 2.8M gif 的命令。
ffmpeg -i <input_file>.mp4 -r 15 -vf scale=512:-1 out.gif