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

Does NVIDIA's Vulkan Video Encoder allow directly using raw GPU framebuffers? #122

Open
Arcitec opened this issue Dec 10, 2024 · 1 comment

Comments

@Arcitec
Copy link

Arcitec commented Dec 10, 2024

Here's my desired scenario:

  • NVIDIA driver on Linux.
  • Render a game frame with Vulkan on the GPU.
  • Pass that GPU's raw memory framebuffer directly to the Vulkan Video encoder API.
  • Encode the framebuffer as a video frame, without ever needing to copy the raw framebuffer as a roundtrip through the CPU/system RAM.
  • So the raw frame never leaves the device. Vulkan directly starts hardware-encoding the in-memory framebuffer that already exists inside the GPU itself.

In other words, doing 100% on-device encoding without transferring raw frames to the system, exactly like what NVIDIA's own NvFBC + NVENC APIs are capable of, but in a universal way.

Is this possible with NVIDIA's Linux driver, using the new Vulkan Video Encoder APIs?

@zlatinski
Copy link
Contributor

Yes, it is possible to do that.
You have two options here:

  • Render the game in YUV-color space or
  • Do a color conversion from (A)RGB to YCbCr image before the encoder, using a compute shader.

I'm in the process of adding a compute filter to the sample for pre-processing before encoding that will also support RGB to YCbCr conversion.

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

No branches or pull requests

2 participants