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. QML Camera: Loading QQmlApplication has large delay
Forum Update on Monday, May 27th 2025

QML Camera: Loading QQmlApplication has large delay

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 494 Views
  • 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.
  • P Offline
    P Offline
    prex
    wrote on 3 Dec 2019, 17:17 last edited by prex 12 May 2019, 10:30
    #1

    I'm trying to show a video live stream from a USB device in my Qt5.12 QML interface on Ubuntu 18.04. The device is either a Webcam or a HDMI capture device (connected by USB). Following the examples, I added a QML Camera in my QML code. However, loading QQmlApplicationEngine in my main.cpp is now extremely slow (around 5 minutes until the UI starts). As soon as it is running, everything works as expected. I'm running it on a more than powerful workstation.

    This is all I'm doing:

        VideoOutput {
            source: camera
            anchors.fill: parent
    
            Camera {
                id: camera
            }
        }
    

    Does anyone know why this is so slow? Or is there a better solution to show a live stream from an USB device?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      prex
      wrote on 4 Dec 2019, 11:40 last edited by
      #2

      I was hoping that I can at least show the rest of the GUI using a Loader. This does not solve the initial problem with the delay, of course. But although the ApplicationWindow opens immediately now, nothing is shown inside until Camera is loaded (ApplicationWindow->StackLayout->...->Loader). I don't understand why Camera and Loader are not working as expected. Nobody seems to have this problems. I also checked the GStreamer version, which is 1.0.

          Loader {
              id: loader 
              asynchronous: true
              anchors.fill: parent
      
              sourceComponent: Item {
                  anchors.fill: parent
                  Camera {
                      id: camera
                  }
      
                  VideoOutput {
                      source: camera
                      anchors.fill: parent
                  }
              }
          }
      
      1 Reply Last reply
      0

      1/2

      3 Dec 2019, 17:17

      • Login

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