# About 02\_video\_dec\_cuda

**URL:** <https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764>\
**Category:** Jetson Nano\
**Tags:** mmapi\
**Created:** [August 7, 2020, 1:06am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764 "2020-08-07T01:06:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![453342321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@453342321](https://forums.developer.nvidia.com/u/453342321)\
**Post date:** [August 7, 2020, 1:06am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/1 "2020-08-07T01:06:36Z")

</div>

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!!!

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 7, 2020, 2:26am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/3 "2020-08-07T02:26:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![453342321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@453342321](https://forums.developer.nvidia.com/u/453342321)\
**Post date:** [August 7, 2020, 2:31am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/4 "2020-08-07T02:31:13Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 7, 2020, 3:37am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/5 "2020-08-07T03:37:41Z")

</div>

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_.

---

<div class="post-metadata">

**Author:** ![453342321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@453342321](https://forums.developer.nvidia.com/u/453342321)\
**Post date:** [August 7, 2020, 3:45am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/6 "2020-08-07T03:45:12Z")

</div>

@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;

```

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 7, 2020, 6:45am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/7 "2020-08-07T06:45:46Z")

</div>

Hi,  
Yes, please look at definition in _nvbuf\_utils.h_:

```auto
/**
 * 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.

---

<div class="post-metadata">

**Author:** ![453342321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@453342321](https://forums.developer.nvidia.com/u/453342321)\
**Post date:** [August 7, 2020, 7:20am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/8 "2020-08-07T07:20:58Z")

</div>

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](https://developer.nvidia.com/embedded/downloads#?tx=%24product,jetson_nano)

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 7, 2020, 8:06am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/9 "2020-08-07T08:06:54Z")

</div>

Hi,  
Now the samples are installed through SDKManager.

> **[JetPack SDK](https://developer.nvidia.com/embedded/jetpack)**
>
> Builds end-to-end accelerated AI applications and supports edge AI development.

After the installation, the samples are in

```auto
/usr/src/jetson_multimedia_api

```

---

<div class="post-metadata">

**Author:** ![453342321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@453342321](https://forums.developer.nvidia.com/u/453342321)\
**Post date:** [August 7, 2020, 11:07am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/10 "2020-08-07T11:07:41Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 9, 2020, 10:41pm UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/11 "2020-08-09T22:41:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![453342321](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@453342321](https://forums.developer.nvidia.com/u/453342321)\
**Post date:** [August 12, 2020, 7:08am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/12 "2020-08-12T07:08:13Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 12, 2020, 9:17am UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/13 "2020-08-12T09:17:25Z")

</div>

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

> [@\[Gstreamer\] nvvidconv, BGR as INPUT](https://forums.developer.nvidia.com/t/gstreamer-nvvidconv-bgr-as-input/83355/2):
>
> Hi, It is limitation of hardware VIC engine. You have to use videoconvert plugin in the usecase. We have [DS4.0.1](https://devtalk.nvidia.com/default/topic/1063437/deepstream-sdk/announcing-deepstream-sdk-4-0-1/) for deep learning usecases. You may also check it and may be able to apply to your usease.

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 5:35pm UTC](https://forums.developer.nvidia.com/t/about-02-video-dec-cuda/145764/15 "2021-10-18T17:35:36Z")

</div>

Closed on October 18, 2021, 5:35pm UTC


