How to play multiple gstreamer udpsink streams in a Qt app?

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Mon Jan 7 21:45:24 PST 2013


On Tue, Jan 8, 2013 at 1:14 AM, hobbesc7 <hobbesc7 at gmail.com> wrote:
> Mandeep Sandhu wrote
>> Take a look at this example. It shows how to embed the video o/p in a
>> QWidget based player:
>> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2player_2main_8cpp-example.html
>>
>> Basically you pass your parent QWidget to QGst::Ui::VideoWidget and it
>> should start rendering video frames to that widget.
>
> This works great.  I have three video feeds streaming over udp to my client
> machine, which is running my Qt app which now has three widgets, one for
> each stream.
>
> I set the uri like so:
>
> m_pipeline->setProperty("uri", "udp://0.0.0.0:5001);
>
> streaming to different ports (i.e. 5002, 5003) for each widget.
>
> The only problem now is that things seem much choppier than when I run all
> this using gst-launch from the command line (also over UDP).  Is there an
> alternative to playbin2 which would be less choppy?
>
> i.e. right now I'm doing like in the example:
>
>  m_pipeline =
> QGst::ElementFactory::make("playbin2").dynamicCast<QGst::Pipeline>();

Have a look at this doc:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/qtvideosink_overview.html

>From the doc: "When drawing on QWidgets, it is recommended to embed
the platform's hardware accelerated sink, such as xvimagesink on X11,
and if this is not possible, use qwidgetvideosink."

I think the choppy-ness mught be due to software based drawing that is
happening into the QWidget. I have tried the QtGStreamer player
example on my PC (Ubuntu 12.10, intel corei7, 8GB RAM, Nvidia GTX
460M) and it seems to play local files fine.

I think the internal video sink being used by "playbin2" _might_ be a
software based sink like qtvideosink or qwidgetvideosink.

You can try specifying xvimagesink (if you're on X) to see if fixes
the choppy-ness problem, though then the problem is that the video
will be displayed in a separate X window and not inside your QWidget.

It would've been good if we could precisely place the video output of
xvimagesink into a QWidget by specifying height/width and most
importantly - position. I can see that we can set h/w in xvimagesink
but not the position.

-mandeep


>
> Thanks again.
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-play-multiple-gstreamer-udpsink-streams-in-a-Qt-app-tp4657671p4657803.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list