Important: Please read the Qt Code of Conduct -

GStreamer configuration

  • Hi everyone.

    I'm working on a QML/C++ app that is deployed to Linux. I'm using a Video QML component to play streaming video which uses GStreamer v. 1.x as the backend.

    I want to be able to configure the GStreamer backend, specifically by setting properties on the playbin gstelement that is created in QGstreamerPlayerSession in QT Multimedia. The way I achieve this now is by patching qgstreamerplayersession.cpp, enabling me to set the properties in the constructor of QGstreamerPlayerSession.

    Do you have any ideas of a better/cleaner way to do this without patching Qt Multimedia?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    AFAIK, no you can't without patching QtMultimedia. What properties do you need to modify ? Must it be done a construction time ?

    If you need to manipulate the GStreamer pipeline the QtGstreamer module might be an interesting alternative.

  • Thank you.

    I've added the following lines to the QGstreamerPlayerSession constructor:

    g_object_set(G_OBJECT(m_playbin), "buffer-size", 5000000, NULL);

    I'm not sure that it has to be done at construction but maybe just before actually playing something. But I don't see a way for me to get access to the m_playbin instance from outside code.

    QtGStreamer looks like a nice alternative, but I would have to integrate it with QML by myself? I also prefer to be working with vanilla Qt.

  • Lifetime Qt Champion

    Indeed, you can't do it without modifying Qt even if you add a control to the plugin to modify that parameter.

    QtGstreamer provides a QML sink so you don't have to implement it.

Log in to reply