Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Gstreamer-based video streaming on Android
Hs293Go last edited by Hs293Go
Hi! I am looking to implement UDP H.264 video streaming on Android with Qt. A bit of Google-fu later I am following these leads:
QtGstreamer seems to be an easy way out but it is no longer maintained. Is it risky to use QtGstreamer now? Does QtGstreamer work on android?
The coversation in Display Gstreamer video on Android hints at using GstVideoOverlay over a Qt window is difficult on Android because the winID() function doesn't give useful window ID values. Is this a dead end or is there any way I can get a valid window ID on android?
The blogpost Qt+Gstreamer+DDS+Android seems to hint that I can use qmlglsink to overlay gstreamer video over a QML element. This blogpost is cryptic to a multimedia noob like me. Does anybody recognize what this blogger is implementing? Can his results be easily reproduced?
The conversation at qmlglsink alternative seems to say that QMediaPlayer can handle arbitrary gstreamer pipelines. Does arbitrary gstreamer pipelines include udp pipelines? How about compatibility with android
Any answer to any one of my above questions will be greatly appreciated!
I'd like to address two specific users too: @SGaist You mentioned QMediaPlayer can handle arbitrary gstreamer pipelines. Do you have an answer to my question no. 4, i.e. does this approach work on Android? @LuJoRi I see that you seem to have found a solution in the old thread. If you are still around, could you possibly offer me some help?
The pipeline I'm using to play my stream on my Linux box is
gst-launch-1.0 -v udpsrc port=$PORT ! application/x-rtp, encoding-name=H264, payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink
Hi and welcome to devnet,
To try to keep things simple, I'd start by building the Qt GStreamer backend. With it and a recent version of Qt, you might be able to use QMediaPlayer to play your stream with a custom pipeline.
Hs293Go last edited by
By building the Qt GStreamer backend, do you mean building GStreamer and all its plugins for Android? I hope you are not referencing the Qt-Gstreamer library since that is unsupported for a few years already.
AFAIK GStreamer has a build for Android.
I am talking about the GStreamer backend of Qt Multimedia.
Hs293Go last edited by
@SGaist Thanks for the tip! I get the idea in general, but please clarify: By GStreamer backend, do you mean the GStreamer libraries for Android like what's mentioned here? Is it analogous to having
At any rate I'm happy to read the docs, but if you could point me to the relevant page, or better any tutorial that shows me the steps, then I'd make progress much faster. Thanks!
No, QtMultimedia uses different plugins depending on the platform. In the case that interests you, you will need the plugin based on GStreamer. So you need two things:
- GStreamer built for Androïd
- The QtMultimedia plugin using GStreamer
You do not need to build Qt completely for that, just the plugin.