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:

    1. Using WebView but apparently WebView doesn't display anything when using my specific url (192.168.0.1:3000)
    2. 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


  • Lifetime Qt Champion

    Hi,

    You can set the URL on the Video element. If that doesn't work, you could use QtGStreamer

    Hope it helps



  • @SGaist said:

    QtGStreamer

    Is it for mobile as well ? I'm building cross-platform app


  • Lifetime Qt Champion

    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



  • Is your video an MJPG stream? I've done that in a somewhat ugly way by connecting to the camera stream with C++ code, and feeding the video frames to QML with a QQuickImageProvider.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.