Skip to content

egopost: convert NVDEC frames to yuv420p before RGB - #1336

Merged
shaosu-nvidia merged 1 commit into
egopost/1.0-containerfrom
ssx/container-color-space
Oct 23, 2026
Merged

shaosu-nvidia merged 1 commit into
egopost/1.0-containerfrom
ssx/container-color-space

Conversation

@shaosu-nvidia

@shaosu-nvidia shaosu-nvidia commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

NVDEC (h264_cuvid, vp9_cuvid) returns NV12. swscale converts NV12 to RGB by a different path than the yuv420p the software decoders produce, even though the decoded YUV is identical (H.264 decoding is bit exact). On the README example the FFmpeg runtime's RGB frames therefore differed from the OpenCV path by 0.77/255 on average (up to 33), and the model amplified that into a 0.35 mm mean vertex difference (up to 6.4 mm) and different detector boxes.

Convert NVDEC frames to yuv420p first, then to RGB, for the *_cuvid decoders. The frames then match the software path bit for bit, and with matching library versions the pipeline output is identical to a run on the OpenCV path (boxes identical, hand poses bit-identical, other arrays within 4e-7). The software decoders are unchanged.

Fixes #(issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

Checklist

  • I have read and understood the contribution guidelines
  • I have run the linter and formatter with SKIP=check-copyright-year pre-commit run --all-files
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix/feature works (or explained why not)
  • I have signed off all my commits (git commit -s) per the DCO

NVDEC (h264_cuvid, vp9_cuvid) returns NV12. swscale converts NV12 to RGB by a
different path than the yuv420p the software decoders produce, even though the
decoded YUV is identical (H.264 decoding is bit exact). On the README example the
FFmpeg runtime's RGB frames therefore differed from the OpenCV path by 0.77/255
on average (up to 33), and the model amplified that into a 0.35 mm mean vertex
difference (up to 6.4 mm) and different detector boxes.

Convert NVDEC frames to yuv420p first, then to RGB, for the *_cuvid decoders.
The frames then match the software path bit for bit, and with matching library
versions the pipeline output is identical to a run on the OpenCV path (boxes
identical, hand poses bit-identical, other arrays within 4e-7). The software
decoders are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Shao Su <shaoxiangs@nvidia.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@shaosu-nvidia
shaosu-nvidia merged commit 330fa41 into egopost/1.0-container Oct 23, 2026
80 of 102 checks passed
@shaosu-nvidia
shaosu-nvidia deleted the ssx/container-color-space branch October 23, 2026 22:58

This branch was successfully deployed

1 active deployment
dev — 92b336fd Deployed Oct 23, 2026 by shaosu-nvidia via publish-wheel #5991
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants