Color format configuration setup for NvEncoder

Hello,

I’m working on the encoding of video captured from a TC358743-based CSI-HDMI bridge and transmitting these frames through RTSP using Live555.

I have a working driver, where I can see locally the video using a locally installed VLC application.

I have a working RTSP streamer using the Nvidia hardware encoder (NvEncoder). I use the example 12 from Jetson Multimedia API samples directory.

When I use an USB webcam to stream, everything works fine.

When I use the CSI-HDMI bridge, the image colors are not correct.

Checking VLC execution during the local capture, I can see that the frames are captured using the YUV422 format, which is different from what is needed by the encoder. I believe that’s the reason for the strange color output.

I tried to change on the driver side, without success.

My question is how is the best approach to implement the conversion from YUV422P to YUV420M and provide the correct input for the encoder, considering the example 12_camera_v4l2_cuda case?

Best regards,

Flavio

hello flavio.alves,

may I also know what does the abnormal rendering results looks like.

there is no existing CUDA sample for YUV422 to YUV420 conversion.
you my call NvBufferTransform() for the conversion, which is perform on the hardware converter VIC.
please see-also… /usr/src/jetson_multimedia_api/samples/unittest_samples/transform_unit_sample/

Hi @JerryChang ,

Thank you for your response. I looked into the sample application you advised and I could see that the NvBufferTransform function is already in place on the reference sample 12_camera_v4l2_cuda.

My input buffer colorFormat setting was not correctly initialized, and that’s why my video was full of greens and roses. Once I initialized correctly the colorFormat attribute at input_params, everything started to work.

Best regards,

Flavio

thanks for updating, are we able to close this discussion thread?

1 Like

Yes. Absolutely. Thank you very much.

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