Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QT and GStreamer



  • Hi guys,

    So from what I understad, GStreamer can be directly integrated into QT? I'm trying to use GStreamer for hardware-accelerated video playback.

    Any ideas on how to get started with this?

    Cheers!


  • Lifetime Qt Champion

    Hi
    It's used as a backend (on linux) for the Qt multimedia classes.

    Do you mean to use it like that (indirectly) or a more direct way like
    https://gstreamer.freedesktop.org/bindings/qt.html
    (this is old. just as example)



  • Thanks for the response! Directly would be definitely ideal. I'm on Windows with GCC 32 / 64 bit. Is there a way I could interface directly with GStreamer's C API from C++?


  • Lifetime Qt Champion

    @rtavakko
    Hi
    Well i have never tried to use it on Windows, but it seems quite supported
    https://gstreamer.freedesktop.org/documentation/installing/on-windows.html?gi-language=c
    However, they seem to supply libs only for visual studio so not sure mingw will work out of the box but it might be able to compile it yourself and get up and running.
    Its mostly C api and should not be that picky with compiler however it might use external libs that harder to compile on windows.

    Regarding using it.
    There are many examples
    https://gstreamer.freedesktop.org/documentation/tutorials/playback/hardware-accelerated-video-decoding.html?gi-language=c



  • I would recommend different solution.

    1. First think about good IPC for Windows
    2. Make gstreamer as microservice for windows with your ipc interface, means you are able to use MSCV Compiler
    3. Talk through IPC with gstreamer and your main application

    I learned over the time separating between Main Application (GUI) and Micro services is the best way to go, because some 3rd Party Libs are only for MSCV Compiler, minGw, Python, Javascript etc. available and adapting to different compiler is sometimes very tricky and maintenance caused by updates over time consumes a lot of time. Is better to spent the time into good IPC Infrastructure and communicated with back-end services. Additional by large projects teams/persons are able to work on different services at same time without big issue.


  • Qt Champions 2020

    I'm trying to use GStreamer for hardware-accelerated video playback.
    I'm on Windows with GCC 32 / 64 bit.

    AFAIK, GStreamer does not provide an accelerated modules for Windows (at least in default installer package).

    IMHO, a better case is to use the VLC library, or the native DirectShow API.



  • @mrjj Makes sense. So far its been ok with GCC at least through OpenCV. I'm working on getting it to work directly it seems to link & compile but still working on getting it to work.

    @Shazter I'm a little new to all of this stuff and not sure how this IPC would work. Do you have any examples I could look at?

    @kuzulis Do you know which packages are unsupported on windows? The VLC library seems pretty good, I'll look into that.


  • Qt Champions 2020

    @rtavakko said in QT and GStreamer:

    @kuzulis Do you know which packages are unsupported on windows?

    As I know (if I'm not mistake) there are no HW accelerated coders/decoders at all (e.g. for h264 and etc).. F.e. for Intel, NVidia and AMD video-cards you need to download and compile the appropriate plugins separatelly from the external repos. You can google it himself.



  • It seems that for windows the best solution is to use the MSVC compiler in QT and Windows Media Foundation or Directshow. There is a bit of work to setup MSVC compilers in QT especially if you're used to the MINGW but the examples that come with Microsoft SDK mostly run ok.
    GStreamer works as well but it seems to be a bit more work to get it to work. I'll experiment a little more with it on Windows.

    UPDATE:

    For anyone linking directly to GStreamer on windows, you will need the Windows SDK (specifically the WS2_32 library). There is almost no information on which specific libraries to link to. These are the base libraries needed to run the examples:

    gstreamer-1.0
    glib-2.0
    gmodule-2.0
    gobject-2.0
    intl (Not sure if this one is hardware-dependent)
    WS2_32 (part of windows SDK)

    Apart from WS2_32 every library is part of the GStreamer runtime / development installation.


Log in to reply