Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can I get a video stream from a usb camera?
QtWS25 Last Chance

How can I get a video stream from a usb camera?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 3.3k 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.
  • D Offline
    D Offline
    deleted209
    wrote on 26 May 2017, 07:13 last edited by deleted209
    #1
    if (QCameraInfo::availableCameras().count() > 0)
        return true;
    else
        return false;
    

    I've tried this code.
    But the camera search failed.

    The camera is successfully connected to the computer and works well with other programs.
    How do I get a video stream from qt?

    :: develop environment
    OS : Windows 7

    K 1 Reply Last reply 26 May 2017, 08:08
    0
    • D deleted209
      26 May 2017, 07:13
      if (QCameraInfo::availableCameras().count() > 0)
          return true;
      else
          return false;
      

      I've tried this code.
      But the camera search failed.

      The camera is successfully connected to the computer and works well with other programs.
      How do I get a video stream from qt?

      :: develop environment
      OS : Windows 7

      K Offline
      K Offline
      koahnig
      wrote on 26 May 2017, 08:08 last edited by
      #2

      @Laco

      Hi and welcome to devnet forum

      The QCamera detailed documentation says right as first sentence:
      The QCamera class provides interface for system camera devices.

      Therefore, I would expect that the class can handle only cameras integrated directly in the system (possibly laptop built-in cameras and smartphone cameras).

      Most likely, you need to find the description of the camera itself and handle the whole interface through usb/serial port.

      Vote the answer(s) that helped you to solve your issue(s)

      D 1 Reply Last reply 26 May 2017, 08:40
      2
      • K koahnig
        26 May 2017, 08:08

        @Laco

        Hi and welcome to devnet forum

        The QCamera detailed documentation says right as first sentence:
        The QCamera class provides interface for system camera devices.

        Therefore, I would expect that the class can handle only cameras integrated directly in the system (possibly laptop built-in cameras and smartphone cameras).

        Most likely, you need to find the description of the camera itself and handle the whole interface through usb/serial port.

        D Offline
        D Offline
        deleted209
        wrote on 26 May 2017, 08:40 last edited by
        #3

        @koahnig

        Thanks for the answer!

        I understood your words.

        I thought there was a class that qt supports. ^^

        If I use opencv to import the camera stream, will not it cause problems with cross-platform deployment?

        I'm worried about conflicts with different libraries in Android, Windows, and iOS.

        windows = opencv
        android = opencv (error!)

        I do not understand how qt supports cross-platform.

        E 1 Reply Last reply 26 May 2017, 12:27
        1
        • D deleted209
          26 May 2017, 08:40

          @koahnig

          Thanks for the answer!

          I understood your words.

          I thought there was a class that qt supports. ^^

          If I use opencv to import the camera stream, will not it cause problems with cross-platform deployment?

          I'm worried about conflicts with different libraries in Android, Windows, and iOS.

          windows = opencv
          android = opencv (error!)

          I do not understand how qt supports cross-platform.

          E Offline
          E Offline
          Eligijus
          wrote on 26 May 2017, 12:27 last edited by
          #4

          @Laco You are on the right track QCamera does indeed support usb camera. I have tested it on linux with gstreamer backend and it works.
          And from Qt 5.7 Multimedia Backends one can see that on windows DirectShow is responsible for QCamera backend. So you are probably missing DirectShow dependencies you should look into it. And are you sure you don't get any errors when running your application?
          There also could be driver issue for your usb camera, have you tried other web cams?
          Also you could try running your application in administration mode.

          1 Reply Last reply
          2

          4/4

          26 May 2017, 12:27

          • Login

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