QML MediaPlayer. Custom source for gst-pipeline
-
Hello!
I'm using that component to play live-stream from some specific camera. At current time i use next source:MediaPlayer { source: "gst-pipeline: udpsrc port=5000 ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink" autoPlay: true }
That works OK but in real life need to play from some c++ class which receives stream.
How can i implement that? May be, I need to make custom gst source?
Thanks))) -
Hi,
What you are asking is not clear.
Do you want to use a custom pipeline in C++ ?
-
@SGaist
Hi,
I want to receive udp live stream in qml application (ubuntu and android). Is it possible? like in vlc (udp://@:7777)
i receive rtsp with MediaPlayer item correctly, but with udp i get error as below:
Error: " udpsrc port=7777 ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink" : "no element "udpsrc""
with this code:
MediaPlayer {
id: player
source: "gst-pipeline: udpsrc port=7777 ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink"
autoPlay: true
}
Any advice is greatly appreciated. Thank you so much! -
@SGaist hi and thanks to reply.
I checked and installed gstreamer on ubuntu. i don't know how to install gstreamer on android?
now on ubuntu i receive udp stream but screen is green and corrupted! maybe it's for bad pipelines.
sometimes i receive Warning: "Pipeline construction is invalid, please add queues."
Has any way to receive udp real time stream with high quality?
Is QtGStreamer necessary to import? or we can get good quality with MediaPlayer item?
thanks. -
On android you will have to build it yourself. There are instructions on the GStreamer site for that if memory serves well.
QtGStreamer bindings have been deprecated and unmaintained since a long time. They have replaced them with the qmlgl plugin.
As for your pipeline issue, the message is giving suggestions on how to fix it.
-
That message:
@Ms-J said in QML MediaPlayer. Custom source for gst-pipeline:
Warning: "Pipeline construction is invalid, please add queues."
Does your pipeline work properly on the command line ?
-
@SGaist I got the same corrupted video from command line :(
this is my command "gst-pipeline: udpsrc port=5000 ! h264parse ! avdec_h264 ! videoconvert ! autovideosink" for receive camera streamer. i searched and nothing helpfull found for that.
command line message:
Not enough buffering available for the processing deadline of 0:00:00.015000000, add enough queues to buffer 0:00:00.015000000 additional data. Shortening processing latency to 0:00:00.000000000.
any suggestion to improve pipelines for better preview?
thank you in advance. -
Add debugging to your pipeline, it may give you some more information about what is going on.
-
Did you already check the android platform notes for GStreamer ?
-
@SGaist yes i checked it.
i installed gstreamer-1.0 in my ubuntu and download video/android/gstreamer example.
when i want to build it for android (on ubuntu) i get following errors: :((Project ERROR: Unknown module(s) in QT: multimediagsttools-private
[Inexact] Project ERROR: Library 'libresourceqt5' is not defined.
main.cpp:82:5: error: use of undeclared identifier 'QGstUtils'
main.cpp:54:10: error: 'private/qgstutils_p.h' file not found.same problem: https://forum.qt.io/topic/122140/unknown-module-s-in-qt-multimediagsttools-private
Any advice is greatly appreciated.
-
As the platform notes says, to use the GStreamer backend on Androïd, you have to build the module yourself.
-
At least the Qt multimedia module. You can already find pre-built versions of GStreamer for Androïd AFAIR.
I haven't built QtMultimedia to enable GStreamer for Androïd, but the basic are usually the same, use qmake, make, make install.
I would recommend backing up your current installation if something goes wrong.
And use out of source builds so you can experiment more easily.
-
@SGaist Hello, could you refer me to this Gstreamer plugin package?
I'm trying the following qml:
MediaPlayer{ id: playVideo source: "gst-pipeline: videotestsrc ! autovideosink" videoOutput: videoOutput } VideoOutput{ id: videoOutput anchors.fill: parent }
But as soon as the component is loaded I get this message:
qt.multimedia.player: Unable to set the pipeline to the paused state.And I cannot visualize the pipeline. I tried using a generic video as source in the MediaPlayer component instead of a pipeline and it works.