Skip to content

Source: Fix alpha transparency in Low/Lowest#1477

Open
scr512 wants to merge 1 commit into
DistroAV:masterfrom
scr512:fix-alpha-low-latency
Open

Source: Fix alpha transparency in Low/Lowest#1477
scr512 wants to merge 1 commit into
DistroAV:masterfrom
scr512:fix-alpha-low-latency

Conversation

@scr512

@scr512 scr512 commented Jul 18, 2026

Copy link
Copy Markdown

Disclosure: this fix was diagnosed, implemented and tested with the help of an AI coding agent (LLM). All results were reproduced and reviewed by a human before submission.

Fixes #937.

Problem: NDI sources carrying alpha (ProPresenter, FreeShow, vTube Studio, …) lose transparency when the source latency mode is Low or Lowest.

Root cause: with NDIlib_recv_color_format_fastest, the NDI runtime decodes alpha-carrying streams to UYVA (UYVY + separate alpha plane). ndi_source_thread_process_video2() maps UYVA → VIDEO_FORMAT_UYVY, silently discarding the alpha plane. Verified with a local probe receiver against a BGRA test source: UYVY_BGRA → BGRA with alpha intact; fastest → UYVA.

Fix: request NDIlib_recv_color_format_UYVY_BGRA for all latency modes. Non-alpha sources still decode zero-copy to UYVY (same as fastest); alpha sources are converted to BGRA by the NDI runtime.

Notes:

Testing: built for macOS (6.2.1) and Windows x64 (this branch); verified alpha checkerboard and real ProPresenter/FreeShow feeds render with transparency in Normal, Low, and Lowest. Plugin loads cleanly; no new warnings.

With NDIlib_recv_color_format_fastest, the NDI runtime decodes
alpha-carrying streams to UYVA (UYVY + separate alpha plane), and
ndi_source_thread_process_video2() mapped UYVA to VIDEO_FORMAT_UYVY,
silently dropping the alpha plane.

Request NDIlib_recv_color_format_UYVY_BGRA for all latency modes:
non-alpha sources still decode zero-copy to UYVY, while alpha sources
are converted to BGRA by the NDI runtime, preserving transparency.

Fixes DistroAV#937
@Lordmau5

Copy link
Copy Markdown
Contributor

Gave this a test in my local developer environment.

I feel there might've been some changes in one of the recent NDI SDK builds that seems to be either fixing it or improving performance for converting to BGRA and sending. That, or it still uses higher bandwidth than UYVA, unsure.

I don't have time to thoroughly test it for those differences but on a quick glance it works and I don't seem to be noticing increased latency even in the low and lowest modes (though it does feel like low is very similar to lowest, I don't remember what else the difference was under the hood in DistroAV's code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: NDI transparency does not work when using low/lowest latency

2 participants