K
K
Kalombyr2018-12-29 16:46:39
Qt
Kalombyr, 2018-12-29 16:46:39

How to speed up video output in QML?

Good day!
I'm trying to make a video output (from home surveillance cameras, that is, not from a file).
To output it to QML, I drive it frame by frame into QVideoFrame and output it using QAbstractVideoSurface (and in QML I use VideoOutput, respectively).
Everything is more or less normal, but problems begin when I need to display a picture from 4 cameras at once - the interface lags terribly. Yes, I tried to combine all 4 streams into one and output to one VideoOtput the display speed suits (that is, it is the QML interface that slows down, and not the conversions themselves for output).
But you need to output each stream to its own VideoOutput.
Once upon a time, I remember there was one hack - they filled the area with some color, and then, in my opinion, through directx they displayed a picture that was displayed only where there was a fill with this color ... But that was back in the days of Delphi 7.
Now Qt , or rather QML uses OpenGL, so I think - maybe here you can somehow pull off such a trick?
Or maybe there is a good example of how to quickly display a video stream from c ++ to QML?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Silin, 2019-01-02
@byme

As far as I understand, you are manually engaged in decoding and output, but have you tried using the built-in player?

MediaPlayer {
id: videoPlayer
source:: "rtsp://admin:[email protected]/cam/realmonitor?channel=1&subtype=0"
muted: true
autoPlay: true
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question