# Video Image Compositor API

**URL:** <https://forums.developer.nvidia.com/t/video-image-compositor-api/74825>\
**Category:** Jetson AGX Xavier\
**Created:** [May 16, 2019, 7:50pm UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825 "2019-05-16T19:50:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![thorntonc](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@thorntonc](https://forums.developer.nvidia.com/u/thorntonc)\
**Post date:** [May 16, 2019, 7:50pm UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825/1 "2019-05-16T19:50:08Z")

</div>

According to [NVIDIA Xavier - Compositor](https://developer.ridgerun.com/wiki/index.php?title=Xavier/Processors/HDAV_Subsystem/Compositor) it should be possible to use the VIC to offload distortion correction and other operations from the CPU. However, I don’t see any API for doing this - is this exposed somewhere and I just can’t find the docs?

Thanks

---

<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:** [May 17, 2019, 2:25am UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825/2 "2019-05-17T02:25:40Z")

</div>

Hi,  
Please refer to APIs in tegra\_multimedia\_api/include/nvbuf\_utils.h

```auto
/**
 * Composites multiple input DMA buffers to one output DMA buffer.
 * This function can support composition of multiple input frames to one composited output.
 * @param[in] src_dmabuf_fds array of DMABUF FDs of source buffers to composite from
 * @param[in] dst_dmabuf_fd DMABUF FD of destination buffer for composition
 * @param[in] composite_params composition parameters
 *
 * @return 0 for success, -1 for failure.
 */
int NvBufferComposite (int *src_dmabuf_fds, int dst_dmabuf_fd, NvBufferCompositeParams *composite_params);

```

---

<div class="post-metadata">

**Author:** ![michael\_gruner](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/michael_gruner/32/327877_2.png) [@michael\_gruner](https://forums.developer.nvidia.com/u/michael_gruner)\
**Post date:** [May 17, 2019, 2:29am UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825/3 "2019-05-17T02:29:37Z")

</div>

Updated link:

> **[NVIDIA Xavier - Compositor](https://developer.ridgerun.com/wiki/index.php?title=Xavier%2FProcessors%2FHDAV_Subsystem%2FCompositor)**
>
> Jetson Xavier is a powerful platform from NVIDIA supported by RidgeRun Engineering

---

<div class="post-metadata">

**Author:** ![thorntonc](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@thorntonc](https://forums.developer.nvidia.com/u/thorntonc)\
**Post date:** [May 17, 2019, 2:31am UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825/4 "2019-05-17T02:31:47Z")

</div>

I’m still missing how this would let me do things like barrel distortion correction - AFAIK that API just allows you to merge various ROIs from input buffers and place them into an output buffer?

---

<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:** [May 17, 2019, 2:39am UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825/5 "2019-05-17T02:39:54Z")

</div>

Hi,

> [@](#):
>
> I’m still missing how this would let me do things like barrel distortion correction

This is not supported.

You may start with tegra\_multimedia\_api samples first. The samples are installed to /usr/src/ through SDK Manager.

---

<div class="post-metadata">

**Author:** ![michael\_gruner](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/michael_gruner/32/327877_2.png) [@michael\_gruner](https://forums.developer.nvidia.com/u/michael_gruner)\
**Post date:** [May 17, 2019, 2:47am UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825/6 "2019-05-17T02:47:07Z")

</div>

A couple of suggestions:

- Use OpenGL shaders to do the correction. GStreamer has great OpenGL support and in Xavier you can achieve full hd resolutions easily.
- Use nvivafilter and do the correction via CUDA. I’m sure there are a lot of open reference implementations you can refer to.

---

<div class="post-metadata">

**Author:** ![thorntonc](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@thorntonc](https://forums.developer.nvidia.com/u/thorntonc)\
**Post date:** [May 17, 2019, 3:14am UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825/7 "2019-05-17T03:14:20Z")

</div>

We’re already putting a pretty heavy load on the GPU for our ML pipelines, so we were looking to offload to the available hardware. Thanks for the suggestions though.

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 18, 2021, 6:24pm UTC](https://forums.developer.nvidia.com/t/video-image-compositor-api/74825/8 "2021-10-18T18:24:39Z")

</div>

Closed on October 18, 2021, 6:24pm UTC


