2 years ago

#9728

test-img

TRanquil

QML MediaPlayer with GStreamer Backend on Windows

I am designing a video streaming application where host (sender) is on Ubuntu and client (reciever) is on Windows (msvc2015 compiler). My main focus is sending and showing the most recent frame as fast as possible on screen. Both computers have QT 5.15.2

I am utilizing GStreamer with JPEG encryption for sending the frames with the below pipeline. (A little bit modified version of the pipeline from QMediaPlayer documentation https://doc.qt.io/qt-5/qmediaplayer.html)

gst-pipeline: appsrc ! video/x-raw, format=BGRx, framerate=0/1 ! videoconvert ! video/xraw, format=I420 ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000

I can decode and show this stream with QML MediaPlayer on Linux and the performance is quite good.

MediaPlayer {
        id: mediaPlayer
        source: "gst-pipeline: udpsrc port=5000 caps = \"application/x-rtp, media=video, clock-rate=90000, encoding-name=JPEG, payload=26\" ! rtpjpegdepay ! jpegdec ! videoconvert ! qtvideosink sync=false"
        autoPlay: true
    }

However, my target is to show this stream on Windows machine and I am having difficulties with GStreamer backend. Same url results in the error below. I think it indicates QT is not linked to gstreamer backend and passes the given argument to DirectShow.

DirectShowPlayerService::doSetUrlSource: Unresolved error code 0x800c000d (The specified protocol is unknown.)

Stream plays well with gst-launch command given below, it seems only problem is qt is not able to use gstreamer. In this case, I could not find a way to link GStreamer with QT on windows.

.\gst-launch-1.0.exe udpsrc port=5000 caps = "application/x-rtp, media=video, clock-rate=90000, encoding-name=JPEG, payload=26" ! rtpjpegdepay ! jpegdec ! videoconvert ! autovideosink sync=false

I can also show the video with K-Lite codec using QML MediaPlayer again but the video has a delay around 1-2 seconds which is not desired for my design. The code snippet is given below:

MediaPlayer {
        id: mediaPlayer
        source: "rtp://127.0.0.1:5000"
        autoPlay: true
    }

My question is can I integrate gstreamer to QT somehow? If I can not how can I remove the delay that occurs with K-Lite? I would like to obtain the performance I see with gst-launch command.

windows

visual-c++

qml

gstreamer

rtp

0 Answers

Your Answer

Accepted video resources