# Blank gap between multiple imencode()

**URL:** <https://forum.opencv.org/t/blank-gap-between-multiple-imencode/7591>\
**Category:** C++\
**Tags:** cuda, imgproc, imgcodecs\
**Created:** [February 16, 2022, 5:57am UTC](https://forum.opencv.org/t/blank-gap-between-multiple-imencode/7591 "2022-02-16T05:57:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kelvin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/kelvin/32/4509_2.png) [@Kelvin](https://forum.opencv.org/u/Kelvin)\
**Post date:** [February 16, 2022, 5:57am UTC](https://forum.opencv.org/t/blank-gap-between-multiple-imencode/7591/1 "2022-02-16T05:57:26Z")

</div>

Hi guys,

We are accelerating the encoding process with CUDA, and when we obtain the nsight system report, we find that there are multiple gaps between imencode() interface.

In the frontend, we just call the imencode() Python interface many times.  
We don’t know if the gap happens before or after imencode(), but the gap length increases with the image size.

So does anyone know what happens in the blank gap, and could we do some optimizations?

 ![268370b68bf680303bd05ec73927074](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/c/c0c3fd70407a2bc689225663bb7e970b7303a2a8.png)
