Skip to content

Add video encode/decode round-trip sample#27

Open
Daedie-git wants to merge 21 commits into
NVIDIA-RTX:mainfrom
Daedie-git:codex/video-encode-decode-sample
Open

Add video encode/decode round-trip sample#27
Daedie-git wants to merge 21 commits into
NVIDIA-RTX:mainfrom
Daedie-git:codex/video-encode-decode-sample

Conversation

@Daedie-git
Copy link
Copy Markdown

Summary

Adds a VideoEncodeDecode sample that exercises the NRIVideo encode/decode round-trip path with a compute-generated animated NV12 source and a decoded preview.

The sample supports H.264, H.265, and AV1 via --codec, uses the same backend-agnostic NRIVideo flow for Vulkan and D3D12, and gates the target on NRI_VIDEO_VERSION >= 1 so older NRI trees skip cleanly instead of failing at compile time.

Details

  • Adds the animated NV12 generation/conversion shader and sample integration.
  • Creates video sessions, parameters, pictures, bitstream buffers, encode feedback readback, and decode submission through NRIVideo.
  • Uses Annex-B header generation for H.264/H.265 and AV1 encode-to-decode metadata preparation.
  • Uses aligned NV12 upload/readback layouts based on device texture-copy alignment requirements.
  • Displays separate generated-source and decoded-preview panels plus independent video/preview status text.

Validation

  • Built VideoEncodeDecode in Release.
  • Ran 12 sample configurations for 1000 frames each:
    • APIs: VULKAN, D3D12
    • Codecs: H264, H265, AV1
    • Modes: normal and --debugNRI --debugAPI
  • All sample runs exited 0 with no filtered error, Failed, Invalid, VUID, crash, or exception lines.
  • Built and ran Fury nri_video_tests: 69 tests run, 69 passed.

BjornSAIM added 2 commits May 5, 2026 23:43
Adds the VideoEncodeDecode sample with an animated compute-generated NV12 source, GPU encode/decode round-trip display, and CLI codec selection for H.264, H.265, and AV1.

Uses the backend-neutral NRIVideo flow across Vulkan and D3D12: video sessions and pictures, encode feedback readback, decode picture state queries, Annex-B header generation, AV1 metadata preparation, and aligned NV12 upload/readback layouts.

Integrates the sample into CMake, shader configuration, README, and NRI submodule expectations, gating the target on the required NRIVideo version so older NRI trees skip cleanly.
Point the NRIFramework submodule at the branch that uses NRI video-queues, remove the local NRI override documentation, and apply formatting cleanup to the video sample.
@Daedie-git Daedie-git marked this pull request as ready for review May 5, 2026 22:36
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d9afd66d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Source/VideoEncodeDecode.cpp Outdated
Comment on lines +461 to +465
nri::QueueFamilyDesc queueFamilies[] = {
{nullptr, 1, nri::QueueType::GRAPHICS},
{nullptr, 1, nri::QueueType::VIDEO_ENCODE},
{nullptr, 1, nri::QueueType::VIDEO_DECODE},
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Defer requesting video queues until after capability checks

On adapters/backends that do not expose video encode or decode queues, this requests VIDEO_ENCODE and VIDEO_DECODE queues during nriCreateDevice, so initialization can fail before TryInitializeVideo() reaches its queueNum check and reports that video is unavailable. That makes the sample abort instead of running the graphics/preview path with a clear status on unsupported hardware; create the device with the graphics queue first, then request video queues only after confirming the adapter supports them.

Useful? React with 👍 / 👎.

@Daedie-git Daedie-git force-pushed the codex/video-encode-decode-sample branch from 682a319 to b056394 Compare May 6, 2026 10:17
@Daedie-git Daedie-git force-pushed the codex/video-encode-decode-sample branch from 9375a04 to e6195c3 Compare May 21, 2026 10:27
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