Capture camera with C# code
-
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.cameracaptureuiDo 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
-
@Guigiidre said in Capture camera with C# code:
Qt can handle webcams with the QtMultimedia module, see https://doc.qt.io/qt-5/qcamera.htmlP.S.
Do you think it's possible to call this C# class in my Qt/C++ project .
Yes with C++/CLI
-
@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?
-
@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
-
@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....