Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Warn when a video input declares alpha but decodes fully opaque

Đang mở
#3,226 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
audio-video-rtc

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

triage/needs-triage
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.webm declares an alpha channel but decodes fully opaque. Transparency will not composite. If this should be transparent, re-export with -pix_fmt yuva420p and 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

Ngôn ngữ chính
TypeScript
Star
54.1k
Fork
4.9k
Merge trung bình
7 giờ 29 phút
Pull request đã merge (30 ngày)
778

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của heygen-com/hyperframes

Tất cả issue của heygen-com/hyperframes

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.