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. Capture camera with C# code
Forum Updated to NodeBB v4.3 + New Features

Capture camera with C# code

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 832 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.
  • G Offline
    G Offline
    Guigiidre
    wrote on 20 Jun 2019, 16:11 last edited by
    #1

    Hi everyone, my goal is capturing audio and video on a webcam in my Qt app.

    I don't want to use external programms like FFMPEG but instead I want to use a library.
    I know that some classes in C# exist like this ```
    https://docs.microsoft.com/en-us/uwp/api/windows.media.capture.cameracaptureui

    Do you think it's possible to call this C# class in my Qt/C++ project .
    Can a tool like Active Qt be useful to achieve this goal ?

    Thank you in advance for your answer

    V J 2 Replies Last reply 20 Jun 2019, 16:34
    0
    • G Guigiidre
      20 Jun 2019, 16:11

      Hi everyone, my goal is capturing audio and video on a webcam in my Qt app.

      I don't want to use external programms like FFMPEG but instead I want to use a library.
      I know that some classes in C# exist like this ```
      https://docs.microsoft.com/en-us/uwp/api/windows.media.capture.cameracaptureui

      Do you think it's possible to call this C# class in my Qt/C++ project .
      Can a tool like Active Qt be useful to achieve this goal ?

      Thank you in advance for your answer

      V Offline
      V Offline
      VRonin
      wrote on 20 Jun 2019, 16:34 last edited by
      #2

      @Guigiidre said in Capture camera with C# code:
      Qt can handle webcams with the QtMultimedia module, see https://doc.qt.io/qt-5/qcamera.html

      P.S.

      Do you think it's possible to call this C# class in my Qt/C++ project .

      Yes with C++/CLI

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      G 1 Reply Last reply 21 Jun 2019, 07:41
      4
      • G Guigiidre
        20 Jun 2019, 16:11

        Hi everyone, my goal is capturing audio and video on a webcam in my Qt app.

        I don't want to use external programms like FFMPEG but instead I want to use a library.
        I know that some classes in C# exist like this ```
        https://docs.microsoft.com/en-us/uwp/api/windows.media.capture.cameracaptureui

        Do you think it's possible to call this C# class in my Qt/C++ project .
        Can a tool like Active Qt be useful to achieve this goal ?

        Thank you in advance for your answer

        J Offline
        J Offline
        JonB
        wrote on 20 Jun 2019, 17:07 last edited by JonB
        #3

        @Guigiidre
        If you really want to use that library from Qt/C++, see https://www.davidbritch.com/2014/04/using-cameracaptureui-class-in-ccx.html, https://github.com/uri247/Win81App/tree/master/CameraCaptureUI Sample/C%2B%2B, https://en.wikipedia.org/wiki/C%2B%2B/CX, maybe https://en.wikipedia.org/wiki/C%2B%2B/WinRT .

        That CameraCaptureUI

        provides a full window UI experience

        If you're wanting to do UI in Qt there must be some other more lightweight library which does capture? What do you want to achieve outside of the Qt classes @VRonin mentions?

        G 1 Reply Last reply 21 Jun 2019, 07:17
        2
        • J JonB
          20 Jun 2019, 17:07

          @Guigiidre
          If you really want to use that library from Qt/C++, see https://www.davidbritch.com/2014/04/using-cameracaptureui-class-in-ccx.html, https://github.com/uri247/Win81App/tree/master/CameraCaptureUI Sample/C%2B%2B, https://en.wikipedia.org/wiki/C%2B%2B/CX, maybe https://en.wikipedia.org/wiki/C%2B%2B/WinRT .

          That CameraCaptureUI

          provides a full window UI experience

          If you're wanting to do UI in Qt there must be some other more lightweight library which does capture? What do you want to achieve outside of the Qt classes @VRonin mentions?

          G Offline
          G Offline
          Guigiidre
          wrote on 21 Jun 2019, 07:17 last edited by
          #4

          @JonB thank you for your answer, my aim is simply to reccord video and sound with the webcam of my laptop. But it seems that Qt does not support this feature yet. .. that's the reason why I'm searching anoter lib....

          J 1 Reply Last reply 21 Jun 2019, 08:35
          0
          • V VRonin
            20 Jun 2019, 16:34

            @Guigiidre said in Capture camera with C# code:
            Qt can handle webcams with the QtMultimedia module, see https://doc.qt.io/qt-5/qcamera.html

            P.S.

            Do you think it's possible to call this C# class in my Qt/C++ project .

            Yes with C++/CLI

            G Offline
            G Offline
            Guigiidre
            wrote on 21 Jun 2019, 07:41 last edited by
            #5

            @VRonin thank you for your answer. Have you ever used C++/CLI ? Can it be used with Qt Creator or do I have to use Visual Studio ?

            V 1 Reply Last reply 21 Jun 2019, 08:05
            0
            • G Guigiidre
              21 Jun 2019, 07:41

              @VRonin thank you for your answer. Have you ever used C++/CLI ? Can it be used with Qt Creator or do I have to use Visual Studio ?

              V Offline
              V Offline
              VRonin
              wrote on 21 Jun 2019, 08:05 last edited by
              #6

              @Guigiidre said in Capture camera with C# code:

              Have you ever used C++/CLI ?

              Yes, mainly to deal with windows-only APIs

              Can it be used with Qt Creator or do I have to use Visual Studio ?

              Qt Creator is not a compiler, it's just an IDE. You can use "Build Tools for Visual Studio" to just have the MSVC compiler and use it in Qt Creator

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              1
              • G Guigiidre
                21 Jun 2019, 07:17

                @JonB thank you for your answer, my aim is simply to reccord video and sound with the webcam of my laptop. But it seems that Qt does not support this feature yet. .. that's the reason why I'm searching anoter lib....

                J Offline
                J Offline
                JonB
                wrote on 21 Jun 2019, 08:35 last edited by JonB
                #7

                @Guigiidre
                Bear in mind that I know nothing about this, but to achieve video recording from Qt under Windows I think you should at least look at http://kibsoft.ru/, https://github.com/kibsoft/QtMEL and https://code.google.com/archive/p/qtffmpegwrapper/ to see how others have done it. Though it may be limited/old....

                1 Reply Last reply
                2

                1/7

                20 Jun 2019, 16:11

                • Login

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