Converting batch of images using NvBufSurfTransform

Please provide complete information as applicable to your setup.

• V100
• DS5.0 Docker
• 7.0.0
• 440.64

Hi all, I am using the sample code from here, it works correctly when the batch size = 1, but for batch size != 1 it modifies only the first frame in a batch.

For example, for batch size = 4 it will modify only 0th, 4th and 8th frame while leaving the rest as they were.

I think that the problem is that NvBufSurfTransform will modify only the first frame and I could not find a way to tell it which frame I want to modify. Could someone provide an example how to modify all frames in a batch using NvBufSurfTransform or any other way?


Yeah, the sample code only work well when batch size = 1. that example used to demo how to modify the nvbufsurface using opencv and write back the change to original NV12 frame.
For batch size > 1, you can refer gstdsexample_optimized.cpp-> scale_and_fill_data.
I will update a sample which can work for BS>1 later.

Thanks, I read though the example and basically I had to set numFilled to the correct value and allocate appropriate memory buffers suitable for my batch size in order to make it work for batchsize > 1