Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to display live stream video from camera
Forum Updated to NodeBB v4.3 + New Features

How to display live stream video from camera

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 5 Posters 7.8k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • lajtuL Offline
    lajtuL Offline
    lajtu
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      JoeCFDJ 1 Reply Last reply
      1
      • lajtuL Offline
        lajtuL Offline
        lajtu
        wrote on last edited by
        #3

        @SGaist said:

        QtGStreamer

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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It should work on platforms that has GStreamer support

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          lajtuL 1 Reply Last reply
          0
          • SGaistS SGaist

            It should work on platforms that has GStreamer support

            lajtuL Offline
            lajtuL Offline
            lajtu
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • X Offline
              X Offline
              xargs1
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • X Offline
                X Offline
                xylo
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • SGaistS SGaist

                  Hi,

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

                  Hope it helps

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved