[QtQuick, Multimedia, GStreamer] Can't play video stream
Solved
Qt 6
-
I've used QtQuick's Multimedia and VideoOutput objects and everything works good on Qt 5.12.x. On Qt 6.3.1 video doesn't playing and I have only one string in console:
qt.multimedia.player: Unable to set the pipeline to the paused state.
Code:
import QtQuick 2.0 import QtMultimedia Item { id: root MediaPlayer { id: player source: "gst-pipeline: udpsrc port=10001 ! application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96 ! rtph264depay ! decodebin ! autovideosink"; videoOutput: video } VideoOutput { id: video anchors.fill: parent fillMode: VideoOutput.PreserveAspectCrop } }
-
Hi,
The Qt Multimedia module has seen a big rewrite for Qt 6 and things like custom GStreamer pipeline have been removed.
If memory serves well, support for networked media stream should work out of the box.
-
If memory serves well, you should use the URL for the stream directly.
-
Yes, it works!
For test I send avideotestsrc
via console:
gst-launch-1.0 videotestsrc ! "video/x-raw,width=640,height=480" ! x264enc ! mpegtsmux name=mux ! udpsink host=127.0.0.1 port=8080
In QML:
... MediaPlayer { id: player source: "udp://@127.0.0.1:8080" videoOutput: video } VideoOutput { id: video anchors.fill: parent fillMode: VideoOutput.PreserveAspectCrop } Component.onCompleted: { player.play() }