Dynamic text on video frame

eyalhir74 eyalhir74 at gmail.com
Wed Jul 15 16:07:20 UTC 2020


Hi,
  I'm kinda new so would appreciate some further detail information.
  I did not find any reference (c++ code) as to how to do this - the
documentation says:
  "This can be either static text or text from buffers received on the text
sink pad, e.g. as produced by the subparse element. If the text sink pad is
not linked, the text set via the "text" property will be rendered. If the
text sink pad is linked, text will be rendered as it is received on that
pad, honouring and matching the buffer timestamps of both input streams." 
 
  what are those buffers?

  I did something like this, but I get the same "frame id" for the roughly
two consecutive frames captured by the camera.
  As if the callback is slower than the rest of the pipe??


        m_Lrv_file_src = Gst::ElementFactory::create_element("v4l2src",
"lrv-v4l2src");

        GstPad *pad = gst_element_get_static_pad
(m_Lrv_file_src.get()->gobj(), "src");
        gst_pad_add_probe (pad,GST_PAD_PROBE_TYPE_BUFFER,
(GstPadProbeCallback) cb_have_data, this, NULL);
        gst_object_unref (pad);

    static GstPadProbeReturn
    cb_have_data (GstPad          */*pad*/,
                  GstPadProbeInfo */*info*/,
                  gpointer         user_data)
    {
        static std::atomic<int> kkk = 0;
        InferModule *data = (InferModule *)user_data;
        std::string frame_id = std::to_string(kkk);
        data->m_Debug_overlay->set_property("text", frame_id);
        kkk++;
        return GST_PAD_PROBE_OK;
    }


Any further assistance is more than welcomed.

Thanks
Eyal



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list