Source: Fix alpha transparency in Low/Lowest - #1477
Conversation
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
|
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) |
|
I was able to duplicate the problem with UYVA. This does indeed fix the issue. The only problem is OBS obsoleted the obs_properties_add_button, which is causing the Linux build to fail. I will make a PR to fix that (call obs_properties_add_button2 instead) and then merge that into master before approving this and merging it to master. |
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_BGRAfor all latency modes. Non-alpha sources still decode zero-copy to UYVY (same asfastest); alpha sources are converted to BGRA by the NDI runtime.Notes:
developand was lost in the 6.0.0 rewrite — no shipped release contains it. This PR extends the same approach to Lowest as well.VIDEO_FORMAT_UYVAin libobs (libobs: Add YUVA pixel format obsproject/obs-studio#10345, closed unmerged). This is a minimal alternative that works with stock OBS today.Seeking Testerslabel so CI packages test installers?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.