GStreamer and Qt

Daniel Sperka djsperka at ucdavis.edu
Mon Oct 22 15:58:30 UTC 2018


I've been using gstreamer API, in a Qt5/C++ application,  directly on mac
and windows for a couple of years now (http://habit.ucdavis.edu). I
migrated my application to use gstreamer when Qt/Phonon support stopped at
Qt5, and also because I wanted to release a windows port of my application.

I looked into using other frameworks, but only Gstreamer satisfied all my
needs (single code base on windows and mac, built-in codec support for
common A/V file formats being the most important). I am able to rely on the
stock Gstreamer releases. Packaging an application for release forces some
difficult choices on the developer, i.e. whether to package Gstreamer
embedded in your application (harder, but the route I chose), or installing
full Gstreamer along with your application (easier, but is more easily
messed up via end-user actions, and would lead to more support calls that I
do not have the time for:(   )

I initially tried Qt-Gstreamer, but..
-  I had to make some modifications to the code base to get it to compile
on the mac (never attempted it on windows)
- I found the API to be confusing. Gstreamer is a complex API to begin
with, and Qt-Gstreamer adds another set of usages/concepts (largely
undocumented), has few working examples in the wild, was unsupported, AND
(this was the killer) only supported a subset of the Gstreamer API. If you
need to manipulate the pipeline in any nontrivial way, you either had to
add new methods to the QT-Gstreamer libs OR you had to revert to using the
raw Gstreamer API. At that point things get confused and convoluted enough
that it begs the question: Why?

So, for me using the straight Gstreamer API was the only real choice with
Qt. There is a steep learning curve with Gstreamer, but there's lots of
examples and tutorials out there, and once you start getting it there's a
HUGE payoff.  I have no comment on any of the other mappings to python,
rust, or whatever as they were never an option for me.


The trickiest part of making it work is getting the GMainLoop integrated
into your application. I chose to start a separate thread and call
g_main_loop_run from there, while also running a Qt main loop to drive the
application. YMMV.

Dan




On Sun, Oct 21, 2018 at 12:21 PM Denis Shienkov <denis.shienkov at gmail.com>
wrote:

> > can these be build for windows?
>
> > use the C API directly.
>
> We have used the gst directly, using the pure-C API in Qt/QML, even on
> Windows.
>
> But on Windows there are problem that GST SDK has not a HW codecs/plugins
> (as I remember).
>
> Denis
>
> 21.10.2018 18:54, Nicolas Dufresne пишет:
>
> Le dimanche 21 octobre 2018 à 11:21 -0400, blackthirt33n a écrit :
>
> can these be build for windows?
>
>
> It should work, it's not part of our build as we don't ship QT (or any
> widget toolkit) as part of GStreamer cerbero. Be aware the someone
> reported an issue loading this, I'm not sure what is the context. We
> will of course investigate and fix if required.
>
> Nicolas
>
>
>
> On Sun, Oct 21, 2018 at 11:15 AM Olivier Crête <olivier.crete at collabora.com> wrote:
>
> Hi,
>
> Also, QtStreamer is for old style QWidget, if you're doing a QML
> application, you should just be using qmlglsink.
>
> And for C++, you don't really need bindings for GStreamer, you can
> just
> use the C API directly.
>
> Olivier
>
> On Sun, 2018-10-21 at 15:12 +0100, Russel Winder wrote:
>
> Hi,
>
> I see that qt-gstreamer https://cgit.freedesktop.org/gstreamer/qt-gstreamer has been
>
> marked
>
> as
> unmaintained. I am guessing mostly on the grounds of it being a
> manually created binding.
>
> I see that the rust-qt crates appear to be handled by some
>
> automated
>
> cpp-to-rust program https://github.com/rust-qt/cpp_to_rust .
>
> Might
>
> this
> indicate a route forward for qt-gstreamer?
>
> It appears that Python, via PySide2 and PyQt5, is the only
>
> language
>
> to
> have really successfully created a binding to Qt. Perhaps this is
>
> why
>
> there is so much C++ still going on sinve Qt has a huge traction
>
> out
>
> there, much more than GTK+.
>
> I was just hoping to be able to use Qt and GStreamer from Rust or
>
> D.
>
>
> _______________________________________________
> gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.orghttps://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.orghttps://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
>
> _______________________________________________
> gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.orghttps://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>


-- 
Daniel J. Sperka, Ph. D.
UC Davis Center for Neuroscience
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20181022/76ec10a5/attachment.html>


More information about the gstreamer-devel mailing list