Poor performance when running pipeline in QtGStreamer with qt5videosink

Michael Ditum mike at mikeditum.co.uk
Wed May 20 14:29:16 PDT 2015


Hi,

With the help of this list I've managed to create a pipeline that takes the
1080p at 30 h264 output from my camera, runs it through an alpha element to
chroma key the picture and display it on a xvimagesink with smooth picture
and very low lag. The CPU usage one my i5 system is about 70% of one core
which I'm happy with. The pipeline running in gst-launch-1.0 is...

    gst-launch-1.0 -v -e \
        v4l2src device=/dev/video0 ! queue !
video/x-h264,width=1920,height=1080,framerate=30/1 ! \
        h264parse ! avdec_h264 ! \
        alpha method=custom target-r=255 target-g=0 target-b=0 ! \
        videoconvert ! xvimagesink sync=false

I'm now trying to get the same pipeline to show in a Qt application using
the QtGst bindings. It is working and I get a similar looking picture
outputted however the CPU usage is a lot higher than my non qt5 version at
about 105% of one core. This results in periodic picture breakup as though
it cannot decode the h264 video quick enough.

Is there anything I can do to improve the performance of my application? As
the final sink is the only bit different between the 2 pipelines I've
pasted that section of the code below, however the rest can be found on
pastebin at http://pastebin.com/YSVFigAM.

    QGst::ElementPtr videoSink = QGst::ElementFactory::make("qt5videosink");
    videoSink->setProperty("sync", false);

    QGst::Ui::VideoWidget* widget = new QGst::Ui::VideoWidget();
    widget->setVideoSink(videoSink);

    pipeline->add(videoSink);
    if(videoConvertElement->link(videoSink) == false) {
        qDebug("videoConvertElement -> videoSink Link failed");
    }

    widget->show();
    pipeline->setState(QGst::StatePlaying);

Thanks in advance for any help!

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150520/3ed8c8fc/attachment.html>


More information about the gstreamer-devel mailing list