2017-04-04 225 views
0

首先,我从Google Images获得这个具有透明alpha通道的gif。如何将gif转换为保存alpha通道的webm?

原来这里是GIF(在新标签中打开它,看看透明度):

enter image description here

这里是它的情况下,打在我的屏幕上的记录不会显示在右浏览器:

enter image description here

然后我运行下面的脚本将其转换为WebM功能,这正是我所需要的游戏框架,我使用。

avconv -f gif img.gif img.webm 

但它不保持透明度。下面是一个正确的透明WEBM的重叠(水,从https://phaser.io/examples/v2/video/alpha-webm拍摄)

enter image description here

白框不应该被周围出现的宝石。

回答

1

首先转换成GIF为PNG帧:

convert img.gif img%03d.png 

然后将它们组合成使用此命令WEBM(我得这种外部的帮助):

ffmpeg -framerate 25 -f image2 -i ./img%03d.png -c:v libvpx -pix_fmt yuva420p img.webm 

enter image description here

相关问题