Add video encode/decode round-trip sample#27
Conversation
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.
There was a problem hiding this comment.
💡 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".
| nri::QueueFamilyDesc queueFamilies[] = { | ||
| {nullptr, 1, nri::QueueType::GRAPHICS}, | ||
| {nullptr, 1, nri::QueueType::VIDEO_ENCODE}, | ||
| {nullptr, 1, nri::QueueType::VIDEO_DECODE}, | ||
| }; |
There was a problem hiding this comment.
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 👍 / 👎.
682a319 to
b056394
Compare
9375a04 to
e6195c3
Compare
Summary
Adds a
VideoEncodeDecodesample 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 onNRI_VIDEO_VERSION >= 1so older NRI trees skip cleanly instead of failing at compile time.Details
Validation
VideoEncodeDecodein Release.VULKAN,D3D12H264,H265,AV1--debugNRI --debugAPI0with no filterederror,Failed,Invalid,VUID, crash, or exception lines.nri_video_tests: 69 tests run, 69 passed.