---
title: "Comment by Vidlify on \"How to Remove a Video Background and Keep a Real Transparent Video (WebM Alpha, ProRes 4444, or PNG Frames)\" | Hashnode"
description: "Nice detail that the ALPHA_MODE tag alone proves nothing. One thing I tested: what happens with your YMIN/YMAX command if someone forgets -c:v libvpx-vp9 before"
url: "https://hashnode.com/posts/remove-video-background-keep-real-transparency-webm-prores-png/6b0a3748cdb423b1ef4e7983/comment/6b0a3a53921667934aa23e20"
---

[Discussion](https://hashnode.com/posts/remove-video-background-keep-real-transparency-webm-prores-png/6b0a3748cdb423b1ef4e7983)

Comment [How to Remove a Video Background and Keep a Real Transparent Video (WebM Alpha, ProRes 4444, or PNG Frames)](https://hashnode.com/posts/remove-video-background-keep-real-transparency-webm-prores-png/6b0a3748cdb423b1ef4e7983)

[Vidlify](https://hashnode.com/@vidlify)

[8h ago](https://hashnode.com/posts/remove-video-background-keep-real-transparency-webm-prores-png/6b0a3748cdb423b1ef4e7983/comment/6b0a3a53921667934aa23e20)

Nice detail that the ALPHA\_MODE tag alone proves nothing. One thing I tested: what happens with your YMIN/YMAX command if someone forgets -c:v libvpx-vp9 before -i? On FFmpeg 6.1.1 it does not quietly print 255/255. alphaextract fails with "Requested planes not available", because the native decoder hands over yuv420p without an alpha plane. So the check fails loudly instead of giving a false "opaque". Swapping YMIN/YMAX for YAVG also gives you the opaque share of the frame: a 320x240 test with a 160x120 opaque box came out at YAVG 63.75, which is exactly 25 percent of 255.

[river jiang](https://hashnode.com/@riverjiang)

[7h ago](https://hashnode.com/posts/remove-video-background-keep-real-transparency-webm-prores-png/6b0a3748cdb423b1ef4e7983/comment/6b0a3a53921667934aa23e20#reply-6b0a478dfcdfad7644e2030c)

Thanks for testing this! Agreed: with the native decoder, alphaextract fails loudly with "Requested planes not available" (same on FFmpeg 7.1.5 here), which is the safer failure. YAVG is a nice shortcut for the opaque share. One caveat for real footage: soft edges and hair are partly transparent, so YAVG/255 is the average opacity rather than a strict opaque-pixel count. For a quick visual check without the command line, the transparency checker linked in the article shows the same thing in the browser.

[Vidlify](https://hashnode.com/@vidlify)

[1h ago](https://hashnode.com/posts/remove-video-background-keep-real-transparency-webm-prores-png/6b0a3748cdb423b1ef4e7983/comment/6b0a3a53921667934aa23e20#reply-6b0a97be382777934ab281df)

Good point, YAVG/255 is average opacity, not a pixel count. For the strict count you can threshold the alpha before measuring: `alphaextract,lutyuv=y='if(gte(val\,250)\,255\,0)',signalstats`. On a test frame with a quarter fully opaque, a quarter at 50 percent alpha and half transparent, plain YAVG gave 95.75 (average opacity), the thresholded version 63.75 (exactly 25 percent fully opaque), and with `gt(val\,5)` it gave 127.5 (50 percent at least slightly visible). The 250 and 5 cutoffs leave a little room for compression noise near 255 and 0.
