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
QtWS25 Last Chance

Capture camera with C# code

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 809 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 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

    VRoninV JonBJ 2 Replies Last reply
    0
    • G Guigiidre

      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

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on 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
      4
      • G Guigiidre

        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

        JonBJ Online
        JonBJ Online
        JonB
        wrote on 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
        2
        • JonBJ JonB

          @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 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....

          JonBJ 1 Reply Last reply
          0
          • VRoninV VRonin

            @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 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 ?

            VRoninV 1 Reply Last reply
            0
            • G Guigiidre

              @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 ?

              VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on 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

                @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....

                JonBJ Online
                JonBJ Online
                JonB
                wrote on 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

                • Login

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