Skip to content
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

Support GPU format/colourspace conversion #11337

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

Conversation

dsaedtler
Copy link
Contributor

@dsaedtler dsaedtler commented Oct 2, 2024

Description

Extends GPU scaling to also handle colourspace or format conversions to enable shared-texture encoding with heterogenous output formats.

Motivation and Context

#11336 falls back to shared memory encoders, which are less efficient, this aims to fix that by extending the conversion capabilities.

In theory this would also allow recording HDR locally and streaming SDR, among other use cases that people might have.

Will need some additional discussion related to function naming and implemenation of the new texture availability check.

How Has This Been Tested?

Streamed to Twitch while recording 444 locally as well as streaming SDR while recording HDR locally.

This is part of the closed beta Twitch Enhanced Broadcasting build and seems to work fine so far.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)
  • Performance enhancement (non-breaking change which improves efficiency)

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.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added the Enhancement Improvement to existing functionality label Oct 5, 2024
@dsaedtler dsaedtler force-pushed the rodney/gpu-colour-conversion branch 3 times, most recently from 033130d to decb9f6 Compare October 5, 2024 20:37
@dsaedtler dsaedtler marked this pull request as ready for review October 5, 2024 20:37
@Lain-B
Copy link
Collaborator

Lain-B commented Oct 5, 2024

Haven't tested it but this seems straight forward and simple.

@dsaedtler dsaedtler force-pushed the rodney/gpu-colour-conversion branch 2 times, most recently from 91418d6 to 1510213 Compare October 15, 2024 14:48
@dsaedtler dsaedtler force-pushed the rodney/gpu-colour-conversion branch 2 times, most recently from c71b130 to 1f20630 Compare October 22, 2024 18:48
Copy link
Member

@derrod derrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I amended this PR based on Twitch beta feedback.

Edit: Forgot to switch accounts, but whatever.

UI/multitrack-video-output.cpp Outdated Show resolved Hide resolved
@dsaedtler dsaedtler force-pushed the rodney/gpu-colour-conversion branch 2 times, most recently from 7117695 to a6e19f0 Compare October 22, 2024 20:06
@dsaedtler dsaedtler force-pushed the rodney/gpu-colour-conversion branch 2 times, most recently from 555f463 to 381132f Compare October 30, 2024 08:26
dsaedtler and others added 7 commits November 3, 2024 09:51
Unlike obs_nv12/p010_tex_active() this accurately reflects the texture
availability in the mix associated with the encoder.
Use the recently added `obs_encoder_video_tex_active()` API
for AMD AMF-based encoders, similar to the recent commit for
obs-nvenc. This allows the OBS canvas to use non-NV12 pixel
formats (such as I444) while the multitrack video encoders will
use NV12 or P010 textures converted using the GPU.
Also sets Rec. 709/limited defaults for multitrack output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants