About 02_video_dec_cuda

hi everyone,when i run the jetson nano samples 02_video_dec_cuda,i found that if my dec h264 file is bt709 ,the 02_video_dec_cuda will report that error ,
libv4l2_nvvidconv (0):(1688) (ERROR) : NvDdkVicConfigure Failed
libv4l2_nvvidconv (0):(1710) (ERROR) : NVVIDCONV ERROR 2

my test run command is sudo ./video_dec_cuda 1080P.h264 H264 -o tt.yuv --input-nalu --disable-rendering

if the dec h264 file is bt601,that will dec ok,so i want to know whether the nano 02_video_dec_cuda can not dec bt709 h264 stream
thanks for your help!!!

Hi,
Please use NvBufferTransform(). We encourage users to use NvBuffer APIs. NvVideoConverter is kept for backward compatibility and no longer upgraded.

@DaneLLL,hi ,thanks for your help,if i want to convert the dec yuv to bgr ,so i just can found that samples 07_video_convert can fix this,but that sample alsa use the NvVideoConverter ,so how can i do

Hi,
We have updated 07_video_convert in r32.4.3. If you use previous release, please check how NvBufferTransform() is used in 00_video_decode.

@DaneLLL,you mean we can modify that follow source coder about that input_params.colorFormat to NvBufferColorFormat_ABGR32,then wo can use the NvBufferTransform to convert yuv to bgr?

input_params.payloadType = NvBufferPayload_SurfArray;
input_params.width = crop.c.width;
input_params.height = crop.c.height;
input_params.layout = NvBufferLayout_Pitch;
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;

input_params.nvbuf_tag = NvBufferTag_VIDEO_CONVERT;

Hi,
Yes, please look at definition in nvbuf_utils.h:

/**
 * Transforms one DMA buffer to another DMA buffer.
 * This function can support transforms for copying, scaling, fliping, rotating, and cropping.
 * @param[in] src_dmabuf_fd DMABUF FD of source buffer
 * @param[in] dst_dmabuf_fd DMABUF FD of destination buffer
 * @param[in] transform_params transform parameters
 *
 * @return 0 for sucess, -1 for failure.
 */
int NvBufferTransform (int src_dmabuf_fd, int dst_dmabuf_fd, NvBufferTransformParams *transform_params);

Source buffer is from decoder and you need to allocate destination buffer in NvBufferColorFormat_ABGR32. After calling NvBufferTransform(), you will get RGBA buffer.

thanks for your help ,above that you write the that We have updated 07_video_convert in r32.4.3
so where can i download tha r32.4.3 source code,i can not found at the follow link
https://developer.nvidia.com/embedded/downloads#?tx=$product,jetson_nano

Hi,
Now the samples are installed through SDKManager.

After the installation, the samples are in

/usr/src/jetson_multimedia_api

@DaneLLL, ok,thanks for your help,last question is that i want to know whether other samples for example the video dec ,jpeg dec ,It’s better not to use the NvVideoConverter::createVideoConverter to create convert,and use the NVBUF_TRANSFORM_API to fix it

Hi,
Yes, please use NvBufferTransform() function for conversion/scaling/cropping.

@DaneLLL,hi i want to know whether the NvBufferTransform() can conversion the yuv to ABGR32 or XRGB32,if i do not want the alpha,just bgr 24bit data,so that NvBufferTransform can fix it

Hi,
32-bit ABGR32 and XRGB32 are supported in NvBufferTransform(). 24-bit BGR is not supported. It is limitation of hardware VIC engine. Please check