Skip to content

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

@tvercaut

Description

@tvercaut
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions