Warn when a video input declares alpha but decodes fully opaque
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- audio-video-rtc
Research direction
Start by tracing the existing video-probing path around VideoMetadata.hasAlpha and the libvpx-vp9 alpha extraction mentioned in the issue. Use the provided ffmpeg alphaextract command to compare decoded alpha, and decide whether to inspect the first frame or a sample. Done means a warning identifies declared-but-fully-opaque alpha without blocking rendering.
Written by the indexing model from the issue text.
Description
Problem
A video whose container says it has alpha, but whose alpha plane decodes fully opaque, composites as a solid black rectangle over whatever is beneath it. We render it correctly — there is nothing to see through — but nothing anywhere tells the user their file is the problem, so it presents as a rendering bug.
#3220 is the worked example. The reporter built a repro repository with an opaque control clip, tested both the local CLI and the cloud renderer, and verified alpha_mode=1 with ffprobe before filing. They still could not reach the answer, because the tag they checked is exactly the thing that lies.
alpha_mode=1 is metadata and can outlive the alpha it describes. A remux can preserve the tag while dropping the BlockAdditional sidecar that carries the alpha plane, so the file keeps promising transparency it no longer contains.
Why this is cheap for us to catch
We already probe every video input, and VideoMetadata.hasAlpha already exists (pixelFormatHasAlpha(pixelFormat) || alphaMode === "1"). We also already extract alpha-capable codecs to PNG through libvpx-vp9, so a decoded frame with an alpha channel is in hand on this path anyway.
The missing step is noticing that the alpha channel is uniformly opaque and saying so.
Proposed
When a video input declares alpha but its decoded alpha plane is uniformly 255, emit a warning naming the file, something to the effect of:
avatar.webmdeclares an alpha channel but decodes fully opaque. Transparency will not composite. If this should be transparent, re-export with-pix_fmt yuva420pand avoid remuxing afterward, which can drop the alpha sidecar while keeping the tag.
Warning only, never an error. An opaque video used as a full-frame background is perfectly legitimate, so this cannot block a render.
Worth deciding: whether to check the first frame only (cheap, catches the common case) or sample a few (catches a clip that is opaque at the head and transparent later). First-frame-only is probably the right trade, but it should be a decision rather than an accident.
Verification
Users can already check by hand, and the warning should agree with this:
ffmpeg -c:v libvpx-vp9 -i in.webm -vf alphaextract -frames:v 1 out.png
Uniformly white means no transparency. Black and white means real alpha.
Filed off #3220.
— Rames Jusso
- Dominant language
- TypeScript
- Stars
- 54.1k
- Forks
- 4.9k
- Avg merge
- 7h 29m
- Merged PRs (30d)
- 778
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from heygen-com/hyperframes
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
heygen-com/hyperframes#5027 ·
Maintainers usually reply within 1 day
-
fix(producer): propagate useGpu to HDR layered streaming encoderPossibly taken @Monster-GM claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
heygen-com/hyperframes#5002 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
heygen-com/hyperframes#4702 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Studio catalog prompt editor has no accessible namePossibly taken @lorenzozanee claimed this 11 days ago. Openbug difficulty/easy triage/ready
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
heygen-com/hyperframes#4384 ·
Maintainers usually reply within 1 day
-
lint: validate composition variables declared on supported root elementsMay be free again A pull request for this issue was closed without being merged. Openbug difficulty/easy triage/ready
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
heygen-com/hyperframes#4383 ·
Maintainers usually reply within 1 day
All issues in heygen-com/hyperframes
Similar issues
-
level/task reporter/qa type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
wazuh/wazuh-dashboard-plugins#9310 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cybersemics/treecrdt#267 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
wiz-sec-public/backstage-plugin-wiz#16 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
solana-foundation/solana-com#2245 ·
Maintainers usually reply within 1 day