映像にアルファチャンネルがあるときにalphaextractを使えばグレーで取り出すことができる。同時にフォーマットもGRAYに変換される。同じ効果のフィルタにextractplanes=aがありこれも同様にグレーで出力される。0に近いほど透過し、値が大きくなるほど透過しない。 各映像チャンネルを分離する extractplanes 基本コマンド 0000bf(青)の透過した部分を黒で、透過しない部分を白の alphaextract.png で出力する。指定するオプションはない。 ffmpeg -f lavfi -i smptebars=d=1 -vf colorkey=0x0000bf:.01:.1,alphaextract -vframes 1 alphaextract.png 公式ドキュメント:FFmpeg Filters Documentation : alphaextract
![アルファチャンネルをグレーで出力する alphaextract | ニコラボ](https://cdn-ak-scissors.b.st-hatena.com/image/square/8d63160556b8dac2c4f1ec859b0fcc5e44e01ab9/height=288;version=1;width=512/https%3A%2F%2Fnico-lab.net%2Fwp-content%2Fuploads%2F2023%2F01%2F240x240_1_1.jpg)