NvDdkVicConfugure failed, nvbuffer_transform Failed

I’m using the below code to resize NvBuffer

bool PreviewConsumerThread::doResize(int inputFd, int *outputFdPtr) {
        /* create resize NvBuffer */
        NvBufferCreateParams resizeBufParams = {0};
        int32_t resizeWidth = RESIZE_SIZE.width();
        int32_t resizeHeight = RESIZE_SIZE.height();

        resizeBufParams.payloadType = NvBufferPayload_SurfArray;
        resizeBufParams.width = resizeWidth;
        resizeBufParams.height = resizeHeight;
        resizeBufParams.layout = NvBufferLayout_Pitch;
        resizeBufParams.colorFormat = NvBufferColorFormat_ABGR32;
        resizeBufParams.nvbuf_tag = NvBufferTag_NONE;

        if (-1 == NvBufferCreateEx(outputFdPtr, &resizeBufParams)) {
            printf("Failed to create resize NvBuffer\n");
            return false;

        /* do resize */
        NvBufferTransformParams resizeTransParams;
        memset(&resizeTransParams, 0, sizeof(resizeTransParams));
        resizeTransParams.transform_flag = NVBUFFER_TRANSFORM_FILTER;
        resizeTransParams.transform_filter = NvBufferTransform_Filter_Bilinear;

        if (-1 == NvBufferTransform(inputFd, *outputFdPtr,
                                    &resizeTransParams)) {
            printf("Failed to convert the resize buffer\n");
            return false;

        return true;

it works well if my target size is > 240x136. If width is <= 240 or height <= 136, it will just throw

NvDdkVicConfigure Failed
nvbuffer_transform Failed

My input image is 3864x2180, I roughly calculated the ratio is around 16 for both width and height. Is this a hard limit for the algorithm? When I’m using opencv resize with bilinear interpolation, it’s ok to resize to any image size. Not sure what’s the rationale behind this implementation.

Also tried nearest interpolation, it’s the same.

Yes, this is the constraint of hardware converter. The ratio of downscaling cannot exceed 16.

Hi, what’s the recommended way to do downsample when the ratio exceed 16? firstly downsample to 1/16 and then do another downsample?

Doing downsampling twice should work. To get optimal performance, you can run VIC at max clock by referring to this post:
Nvvideoconvert issue, nvvideoconvert in DS4 is better than Ds5? - #3 by DaneLLL

Cool, interesting. So when I’m doing NvBuffer resize, it’s actually directly using VIC? apart from what you mentioned in the link, I don’t need to change any code correct?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.