How to display live stream video from camera
-
Hey, I'm streaming video from camera connected to Raspberry PI. The stream was made with:
http://pimylifeup.com/raspberry-pi-webcam-server/
so it's available on some server port :3000 (e.g. 192.168.0.1:3000). When opening browser on that address there is just plain video.
I would like to display that video stream in QML. I see 2 approaches:
- Using WebView but apparently WebView doesn't display anything when using my specific url (192.168.0.1:3000)
- Using Qt Multimedia like Video {} component. Unfortunately I think it first requires to download video file like .avi, .ogg or other and then play it but it's a stream so I don't have finite video file!
What would be your approach ? Can it be achieved or my stream service is not compatibile with Qt ?
Regards -
Hi,
You can set the URL on the Video element. If that doesn't work, you could use QtGStreamer
Hope it helps
-
It should work on platforms that has GStreamer support
-
I checked out Video component and I received following error:
[23:40:46.245] HTTPRequest figHttpRequestDidReceiveResponseCallback: no content Length received - errCode is 200
[23:40:46.245] HTTPRequest figHTTPDumpFinalURLAndRemoteAddress: address 172.16.0.105 final url http://172.16.0.105:8888/stream.ogv
[23:40:46.245] figHttpRequestDidReceiveResponseCallback signalled err=-12939 (kFigHTTPRequestError_ServerDoesNotSupportByteRanges) (no content length/range with byterange request) at /SourceCache/CoreMedia/CoreMedia-1562.107/Prototypes/FigHTTP/FigHTTPRequestCFURLConnection.c line 2178
[23:40:46.245] HTTPRequest figHTTPRequestCreateErrorComment: encountered an error: byte range and no content length - error code is 200 -
QString webRTCUrl = QString::fromUtf8(UrlMessage);
// Create and show WebRTC video viewer widget QWebEngineView view; view.setUrl(QUrl(webRTCUrl)); // Use the URL variable
I have written this part of code to stream the video from camera bit it gives me black screen.
Help me