nvvideosink is causing "Wrong surface count in ConvertBuffer"

Hi all,

we have a problem when using nvvideosink. The pipeline is running, but we are flooded with “Wrong surface count in ConvertBuffer”.

This is our code:

// Build pipeline
    m_pPipeline = gst_pipeline_new("pipeline");

    m_testSource        = gst_element_factory_make("videotestsrc", "testsrc");
    GstElement* vc      = gst_element_factory_make("videoconvert", "vc");
    m_testSourceFilter  = gst_element_factory_make("capsfilter", "testsrc_filter");

    m_nvVideoConv       = gst_element_factory_make("nvvideoconvert", "vidconv");
    m_nvVideoConvFilter = gst_element_factory_make("capsfilter", "vidconv_filter");
    
    m_sink              = gst_element_factory_make("nvvideosink", "nvvideosink");

    // add elements to pipeline
    gst_bin_add_many(   GST_BIN (m_pPipeline), 
                        m_testSource,
                        vc,
                        m_testSourceFilter,
                        m_nvVideoConv,
                        m_nvVideoConvFilter,
                        m_sink,
                        NULL);

    g_object_set(   G_OBJECT(m_sink), 
                    "display", _display,
                    "stream", _eglstream,
                    "sync", false,
                    "async", false,
                    NULL);    

    // Set caps.
    m_testSourceFilterCaps = gst_caps_from_string("video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)60/1, format=(string)I420");
    g_object_set(G_OBJECT(m_testSourceFilter), "caps", m_testSourceFilterCaps, NULL);                                                

    m_nvVideoConvFilterCaps = gst_caps_from_string("video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)60/1, format=(string)I420");
    g_object_set(G_OBJECT(m_nvVideoConvFilter), "caps", m_nvVideoConvFilterCaps, NULL);                                                

    // Linking.
    if (!gst_element_link_many( m_testSource,
                                vc,
                                m_testSourceFilter,
                                m_nvVideoConv,
                                m_nvVideoConvFilter,
                                m_sink,
                                nullptr))
    {
        qInfo("Not all GstElements could be linked!");
    }

Notes:

  • we added the 'normal' videoconvert to the pipeline without success. The result without it is the same
  • We can assure that the display and stream is valid as another pipeline (h264 decode from an appsrc) is running fine
  • When using "nvoverlaysink" instead - the stream is renderered properly

Did anyone encounter a similar problem and has some insights?

Is the code for “nvvideosink” available, so we could have a look into what is throwing this message?

Thanks + Best regards,
Bodo

Hi,
nvvideoconvert is for DeepStream SDK and not compatible with nvvideosink. Please replace it with nvvidconv and try again.

Hi Dane,

ok, that helped. We managed to actually get an output now.

Thank you