Best way to record YUV 422 10 bit video from hdmi

Hi!

I have a use case where I need to record input 10-bit 422 HDMI using Jetson TX2 chip. Currently, I have managed to do it using gstreamer omxh265enc plugin in 8-bit 420 format, but it doesn’t quite cut it…

I see that omxh265enc can do 10-bit 420 format as well, but how do I pass in data in this format for it? v4l2src and nvv4l2src doesn’t offer I420_10BE src. Am I missing something?

I did notice in JetPack 4.6 Release “Support for YUV444 8, 10 bit encoding and decoding”. Will that work with Jetson TX2 as well? Could that be the solution for me to get the best quality recording?

Thanks a lot!

Hi,
YUV444 8/10 bit encoding is lossless encoding, so bitrate is high and cannot be controlled. IF you would like to give it a try, please refer to this post:
Can tx2nx decode YUV444? - Jetson & Embedded Systems / Jetson TX2 - NVIDIA Developer Forums

For your use-case, a possible solution is to convert to YUV420 10-but and encode into h265 stream. Please also check 01_video_encode.

Thanks for explaining new YUV444 encoding.

It is still unclear to me how to get 10-bit video feed into gstreamer with jetson.

nvv4l2camerasrc doesn’t offer it

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
                 format: { (string)UYVY }
         interlace-mode: { (string)progressive, (string)interlaced }
              framerate: [ 0/1, 2147483647/1 ]

and v4l2src doesnt offer it as well.

I’m currently on R32 (release), REVISION: 4.3

Hi,
YUV422 10 bit is not supported in v4l2src plugin. If you would like to use gstreamer, have to capture YUV420 8 bit data.

For using jetson_multimedia_api, a possible solution is to capture data in YUV422 10 bit into CPU buffer, and convert/copy to YUV420 10 bit NvBuffer. There is memory copy in this case.

An optimal solution on Jetson platforms is to have source in YUV422 8 bit such as YUYV or UYVY.

Could I modify nvv4l2camerasrc and add YUV422 10 bit support? From what I see that would be the best solution for my problem.

Maybe you know if someone has done anything similar and open sourced their solution? That would give me a head start on solving this. Using 8 bit is not really an option in my case :(

Thanks!

Hi,
There is no existing solution and you would need to implement/experiment it. A possible solution is to create NvBuffer in this format:

    /** BT.601 colorspace - Y/CbCr 4:2:2 10-bit semi-planar. */
  NvBufferColorFormat_NV16_10LE,

And check if your source can capture frame data into the buffer directly. Would need to consider pitch. Please call NvBufferGetParams() to get pitch,width,height of the buffer.

Once you can capture data into NvBuffer, the next step is to customize nvvidconv to support NvBufferColorFormat_NV16_10LE to NvBufferColorFormat_NV12_10LE conversion. And then can link to nvv4l2h265enc.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.