Skip to content

libobs: Add UYVA pixel format support #12125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Lordmau5
Copy link
Contributor

@Lordmau5 Lordmau5 commented May 4, 2025

Description

This pull request is heavily based on this one which was recently closed due to inactivity: #10345

For readability reasons I'm going to be copying all of its information into this one, too.

This change adds the YUVA pixel format, which is a 4:2:2:4 semi-planar with packed YUV data in one place and a second plane with only alpha data as documented here: docs.ndi.video/docs/sdk/frame-types
Note that best I can tell, NDI is the only software that uses this pixel format, and other software may use YUVA to refer to a different format. I am open to suggestions of alternative names for this format in OBS.

Motivation and Context

NDI uses an unusual format for pixel data with transparency, and obs-ndi was silently ignoring the alpha plane of that format leading to these bug reports :DistroAV/DistroAV#937 and DistroAV/DistroAV#983

The motivation and context for making a new PR is due to the inactivity on the previous one as well as missing formatting, rebasing and compilation issues.

Additionally, this PR also includes a small oversight in the pixel shader (format_conversion.effect) as well as bringing UYVA support into a 2 more places (OBSBasic.cpp and video-fourcc.c)

How Has This Been Tested?

The original PR has been tested on Windows and macOS using one OBS instance sending a source with transparency over NDI (which already worked correctly) and another instance receiving (along with a small patch to obs-ndi to use the new format which I will submit as a PR on that side after this has been merged)

This PR has been tested only on Windows but with the same approach (small patch to DistroAV, formerly known as obs-ndi)

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate. (<- Unsure how squashing works with co-authoring so I didn't do this yet)
  • I have included updates to all appropriate documentation.

@Lordmau5 Lordmau5 marked this pull request as ready for review May 4, 2025 17:40
@Lordmau5 Lordmau5 force-pushed the feat/uyva-format branch from 8a508b3 to 723b641 Compare May 5, 2025 09:29
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.

2 participants