About a jetson community project example using nvdec, nvjpg hardware decoder


nvdec, nvjpg In addition to the sample code using a hardware decoder
Jetson Community Projects
nvdec, nvjpg Can you tell if there are any projects that use hardware decoders?
First, I haven’t looked for it, so I ask.

It is difficult to use decoder by receiving jpg and h264 streaming in real time.

Could you please tell me if there is a reference model to reference?

Looks like you have two sources. One is H264 stream and the other is MJPEG stream. There is no existing sample for this usecase and you would need to implement it by referring to 00_video_decode and 06_jpeg_decode. Since h264 decoding and jpeg decoding run on different hardware blocks, if you create individual threads,it should achieve the performance listed in developer guide.

1 Like

Thank you for your answer.

Can you tell me what is difference of NV12, NVMM:NV12 ?

Thank you.



It seems that yuv420 is not supported on H264 and H265. However, in the code below, if pixfmt==2, I want to know why I put it.

If we want to use memcpy without writing to the file, can we use number 2 in NvUtils.cpp?

Thank you.

The decoder output is NV12 and it calls NvBufferTransform() to convert to other format. There is an option of selecting format:

-f <out_pixfmt>      1 NV12, 2 I420, 3 NV16, 4 NV24 [Default = 1]

And the mapping is

    if (ctx->out_pixfmt == 1)
      input_params.colorFormat = NvBufferColorFormat_NV12;
    else if (ctx->out_pixfmt == 2)
      input_params.colorFormat = NvBufferColorFormat_YUV420;
    else if (ctx->out_pixfmt == 3)
      input_params.colorFormat = NvBufferColorFormat_NV16;
    else if (ctx->out_pixfmt == 4)
      input_params.colorFormat = NvBufferColorFormat_NV24;
1 Like