How to change YUV422P to YUV420P

Hello:
Code is from : camera_v4l2_cuda.cpp - jetson multimedia api like:

 // Convert the camera buffer from YUV422 to YUV420P
 if (-1 == NvBufferTransform(ctx->g_buff[v4l2_buf.index].dmabuff_fd, ctx->render_dmabuf_fd, &transParams))

So How to get plane num and each plane's size from render_dmabuf_fd?
What if take output_plane's buffer fd(NvVideoEncoder) into the  NvBufferTransform's second parm,it would automatically convert the yuv format for encoder engine?

Does Nvidia has a CUDA FUNCTION such as change YUV422PtoYUV420P?

thanks

Hi,
We suggest call NvBufferTransform() for the conversion. It is done on the hardware converter VIC. If you use CUDA the loading is moved to GPU.

If you would like to move the conversion to GPU, there is no existing sample for YUV422 to YUV420 conversion. Some samples for converting to BGR/RGBA:
jetson-utils/cuda at 1ee0494b196b488b4b95e89fa2d72366d3cf4879 · dusty-nv/jetson-utils · GitHub

1 Like