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

[Feature] Support 10 bit YUV video in cv::cudacodec::VideoWriter and cv::cudacodec::VideoReader #3727

Open
tvercaut opened this issue Apr 25, 2024 · 0 comments

Comments

@tvercaut
Copy link

System information (version)
  • OpenCV => 4.9
Detailed description

10 bit video encoding is becoming more mainstream and is supported in nvdec / nvenc. It would thus be great to also support it in cudacodec.

As discussed in https://forum.opencv.org/t/status-and-usage-of-cudacodec-videowriter/17396, 10 bit YUV images could be represented as 16bit integers with the 10 most significant bits corresponding to the actual data.

The relevant nvdec/nvenc pixel formats are:

    NV_ENC_BUFFER_FORMAT_YUV420_10BIT                    = 0x00010000,  /**< 10 bit Semi-Planar YUV [Y plane followed by interleaved UV plane]. Each pixel of size 2 bytes. Most Significant 10 bits contain pixel data. */
    NV_ENC_BUFFER_FORMAT_YUV444_10BIT                    = 0x00100000,  /**< 10 bit Planar YUV444 [Y plane followed by U and V planes]. Each pixel of size 2 bytes. Most Significant 10 bits contain pixel data.  */

https://github.com/FFmpeg/nv-codec-headers/blob/9934f17316b66ce6de12f3b82203a298bc9351d8/include/ffnvcodec/nvEncodeAPI.h#L385-L386

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

1 participant