PDA

View Full Version : Reading a video stream, grabbing images from it



Cruz
14th November 2016, 10:37
Hello!

I need to read and process a video stream coming from a camera, which is connected to a strange and old linux machine (server), which I can only access remotely. Display and processing of the video stream should happen on Linux and Windows clients that access the video stream over network. So far I am following the strategy to use gstreamer to encode and send out the video stream on the server. On the clients I would like to use Qt to receive the stream and to grab single images (QImage objects) from it, and to embed all this into a gui application, but I have no clue how this part would work out. Can anyone give me a few pointers please? I am looking into the QMediaPlayer object, but since I have never had anything to do with video so far, this is all very new und unfamiliar to me.

Thanks
Cruz

anda_skoa
14th November 2016, 12:43
Hmm. Since you are using GStreamer on the source side you could check if you could use Qt GStreamer binding on the client side to decode and display the stream.

One other option would be to see if there is a common streaming backend implementation for QtMultimedia on both target platforms and ensure the server sends its stream using that protocol.

Cheers,
_

Cruz
15th November 2016, 01:46
I was hoping to avoid installing gstreamer (or qtgstreamer) on the client side altogether, as this would be some hassle to support all sorts of operating systems. I was hoping to find a solution along the lines of streaming the video out with gstreamer from the server with some standard encoding scheme, and then opening the stream on the client side with some Qt multimedia object. The only object I found that can open a resource URL is QMediaContent, even though I have no idea how I would be able to set the format, or encoding. Will I be able to accomplish opening the video stream this way?

anda_skoa
15th November 2016, 08:50
I was hoping to avoid installing gstreamer (or qtgstreamer) on the client side altogether, as this would be some hassle to support all sorts of operating systems.

Right, but it also provides common ground.

The other option might end up to have to implement a new QtMultimedia source with the respective platform's backend technology.



I was hoping to find a solution along the lines of streaming the video out with gstreamer from the server with some standard encoding scheme, and then opening the stream on the client side with some Qt multimedia object.

Right, that's why my other suggestion was to research if QtMultimedia has some standard protocol streaming source implementation, e.g. WebRTC or RTSP, available on both your target platforms.

Another option might be to check if the QWebEngine implementation supports WebRTC and let the server send that.

Cheers,
_