Tool
You want to put a logo or a caption effect on a web page without a background, but sometimes you cannot tell whether the video you received is really transparent. Transparency (the alpha channel) can be hidden by a black background and invisible to the eye. Paste the ffprobe output to read whether alpha is inside, and if it is not, take the command that makes a VP9 alpha WebM.
Paste the output of ffprobe -hide_banner filename, or the -show_streams output, as it is. The text is read only inside this browser.
The text behind the example buttons is fake output that shows the format; it is not a measurement from this site.
Encode command (replace the file names with your own)
ffmpeg -i "input.mov" -c:v libvpx-vp9 -pix_fmt yuva420p -crf 30 -b:v 0 -auto-alt-ref 0 -an "output.webm"Check after encoding (if you see alpha_mode=1, the alpha marker is in)
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,pix_fmt:stream_tags=alpha_mode -of default=nw=1 "output.webm"The default CRF of 30 is only a starting point, and this site has not measured the quality or size of alpha video. To include sound, delete -an and add audio options. -auto-alt-ref 0 is an option that is widely cited as needed for alpha encoding; we could not confirm whether recent builds still need it, so we include it. To see whether your ffmpeg includes libvpx-vp9, use the build capability checker. The numbers for green removal (0.15, 0.05) are starting values and need adjusting for each video.
Encode the same source twice with the same CRF, once without alpha (yuv420p) and once with alpha (yuva420p), enter the two file sizes, and it calculates the increase. Any unit works as long as both use the same one.
This is only the ratio of the two numbers you entered, not a value that applies to other videos.
canPlayType only answers whether the codec can be opened; it does not say whether alpha is drawn as transparent. To see real transparency, play it over a colored background and look with your eyes.
yuva420p, yuva444p12le, rgba or gbrap, has alpha. yuv420p has none.yuv420p. That is why a WebM with alpha can also show yuv420p in pix_fmt; in that case the stream tag alpha_mode=1 is the sign that alpha is inside. This tool reads both.What follows is not something this site tested but generally known information. Before you publish, play it in your target browsers yourself.
<video>, it is usual to convert it to one of the two formats above.<source> elements in order. Note that ‘can open it’ and ‘draws it as transparent’ can differ, so you need to check on a colored background in each browser. You can build the type and codecs strings with the video codec fallback snippet builder.-pix_fmt yuva420p and -c:v libvpx-vp9. Pick what you have in the tool’s ‘What you have’ menu and copy the command.-c:v libvpx-vp9 before the input for the alpha to be read. Without it, you can get a result where the alpha silently disappeared.chromakey filter can turn the background into alpha. The similarity and blend values differ for every video, and hair and semi-transparent edges may not come out clean.alpha_mode=1 appears, and play it over a colored page background to check with your eyes.Carrying alpha means one more alpha video goes into the file, so it is natural for the file to grow. However, this site has not measured how much it grows. It will probably depend on whether the alpha is a simple rectangular logo or semi-transparent smoke and shadows, and we have no number that can be generalized. Instead, encode the same source twice with the same CRF in ③ above and measure it yourself. The only difference is -pix_fmt yuv420p for the file without alpha and -pix_fmt yuva420p for the file with alpha.
The per-codec size measurements on this site (how we measure) are values for 1080p25 clips without alpha, so they do not fit alpha video.