Qt 5.2.0 The camera service is missing - c++

I have a Logitech HD Webcam C270.
I want to write a simple webcam application and so I tried to compile the Qt camera example (Qt\Qt5.2.0\5.2.0\msvc2010_opengl\examples\multimediawidgets\camera).
My dev system is a Windows 7 x64 SP1 Virtual Machine. If the webcam is connected to this VM the example runs very well. Qt and the windows device manager detect the webcam as "USB Video device".
When I try to run the compiled binary on my non-virtual system (which is also Win7 x64 SP1) the application says "the camera service is missing" (yes, I disconnected the camera from the virtual machine). On this system the camera is detected as "Logitech HD Webcam C270
"
I also have a second notebook with Win7 x64 SP1 - same problem here.
When I test the webcam with another tool (dorgem.cvs.sourceforge.net/viewvc/dorgem/Dorgem/) I can see, that the webcam works.
What can I do to resolve the problem?
Am I missing some library or 3rd party tool? Qt isn't installed on my "real" systems.
I copied all DLLs the application complained about to the same directory as the exe file:
icudt51.dll
icuin51.dll
icuuc51.dll
Qt5Cored.dll
Qt5Guid.dll
Qt5Multimediad.dll
Qt5MultimediaWidgetsd.dll
Qt5Networkd.dll
Qt5OpenGLd.dll
Qt5Widgetsd.dll
platforms/qwindowsd.dll

Thanks to FrankOsterfeld. He pointed me in the right direction.
I had to copy the following files from Qt to my app dir:
Qt5.2.0\5.2.0\msvc2010_opengl\plugins\mediaservice\dsengined.dll
Qt5.2.0\5.2.0\msvc2010_opengl\plugins\mediaservice\qtmedia_audioengined.dll
Qt5.2.0\5.2.0\msvc2010_opengl\plugins\mediaservice\wmfengined.dll
Desination
MyAppDir\MyApp.exe
MyAppDir\(files from original post)
MyAppDir\mediaservice\dsengined.dll
MyAppDir\mediaservice\qtmedia_audioengined.dll
MyAppDir\mediaservice\wmfengined.dll
This links helped me to find the soloution:
Deploying Qt application using QtMultimedia in release mode
http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html#creating-the-application-package
"In contrast to user plugins, Qt plugins have to be put into subdirectories matching the plugin type. As we want to deploy the windows platform plugin it has to be put into a "platforms" subdirectory."

Related

C++ DLL which uses gstreamer only runs on W10 machine where it was created but not on others

Currently I'm writing a driver to provide a camera stream to a calibration software. System is Windows 10 32bit and language is C++. I used the provided project template from the calibration software supplier in VS 2017 Community. The template was made for VS2015 and I didn't upgrade to VS2017.
In a first step I used libjpeg to access the mjpeg stream and that worked fine - also on different machines. Now I want use the gstreamer to be able to also work with the H.264 stream the camera can provide.
So I installed the current x86 gstreamer runtime and development packages and wrote and built the DLL. I can run the test application from the supplier, load the DLL and it works fine on the PC where I compiled the DLL. I can see the camera stream in every format the camera supports.
But when I copy the test application and the DLL to another PC, the test application can't load the DLL. It says that any other DLL is missing, but doesn't tell me which one.
Then, I have set up another PC and compiled the DLL there. Again the test application can load the DLL and it works without a problem on that 2nd PC.
But the DLL from the 1st PC doesn't work on the 2nd PC and vice-versa. As each DLL works on the PC where it was created I assume that all dependencies are fulfilled. Analysing the DLL with Dependencies shows no missing dependencies.
So why doesn't it run on another PC?

OpenCV ffmpeg DLL not loaded when running app on Windows 7, works on 8 and 10

I need to maintain a desktop app written in C++, using Qt and OpenCV for some video processing. As far as I understood, the decoding part of OpenCV is delegated to ffmpeg in a separate DLL for licensing reasons.
The development environment is on Windows 10, using QT Creator and MSVC12 64-bit as compiler. OpenCV version is 3.0, the official distribution. Here, everything runs fine, I am able to decode a video using VideoCapture::open().
Issues arise when I try to run the application in a standalone fashion with all the required DLLs in the same folder as the .exe file. All cases below are 64-bit OSes.
On a Windows 10 computer, not the same as the developement machine and no developer libraries present, the video decoding works fine. I have tested on a Windows 8 machine as well, no issues so far.
On Windows 7, the things get tricky. The same video files that successfully load during the previous tests are not recognized by the app at all i.e. the isOpened call on VideoCapture returns false. For further testing, I stripped the opencv_ffmpeg300_64.dll file to narrow down the issue on Windows 10 and 8; as expected, without this DLL the app is no more able to open the same video files.
It seems that the DLL is simply not recognized on Windows 7.
Edit: Further investigation using Process Explorer clearly shows that the aforementioned DLL is not loaded when the app runs on Windows 7.
Is there something specific about how Windows 7 manages the DLL path resolution and eventual security measures? Seems normal that the first search location is the same folder as the executable, which is the case here.
I have tried to trace using WinApiOverride32, with no results.
More specifically, the error data opencv_ffmpeg.dll can be caused by the following reasons:
Erroneous or corrupted registry entries for opencv_ffmpeg.dll
The virus or malware that damaged the opencv_ffmpeg.dll file.
Hardware failure, for example, a low-quality hard disk that caused
corrupted file opencv_ffmpeg.dll.
Another program changed the required version of opencv_ffmpeg.dll.
Another program maliciously or by mistake deleted the file
opencv_ffmpeg.dll.
Another program deleted opencv_ffmpeg.dll.
Building and Installing OpenCV with Extra Modules on Windows 7 64-bit
Auto-answer...
By upgrading to OpenCV 3.1 on that project some months ago, the issue was fixed. Can be some remainder of a bug in previous versions of the library

Why my Qt app request msvcp120d.dll on a computer but not mine

I did an application with Qt5.5, wich use open cv.
It works, so now I want to deploy it on several computers.
On the first PC (PC1), it works too : I copied the dll of Qt and open cv and add the paths in the environment variables. I copied a folder with my application, some dll and datas (images).
On the second PC (PC2), I did the same, but I can't open the application. I have the error "msvcp120d.dll is missing..".
I compiled my app in release mode.
On my PC and PC1 I moved msvcp120d.dll on the desk, and the app don't request it.
Do you know why the app asks a debug dll?
I soon installed the redistribuables packages visual C++ (x64 and x86) on PC2, but it doesn't install msvcp120d.dll.
Do you have an other idea?
thanks'
It seems like some of the libraries that you are using is linking against a Debug CRT library (indicated by the trailing d in "msvcp120d.dll"). Those aren't redistributable, and are only available on systems, where Visual Studio is installed.
I would recommend to use dependency walker to find out which dlls/libraries that need the debug version and then recompile them as release configuration.

Qt camera example does not find the laptop's webcam

I'm using Debian Jessie and dmesg | grep video returns:
[ 22.280407] Linux video capture interface: v2.00
[ 22.790704] uvcvideo: Found UVC 1.00 device Lenovo EasyCamera (13d3:5170)
[ 22.796546] usbcore: registered new interface driver uvcvideo
The example compiles fine but upon launch i get a dialog telling me that the camera service is missing. I'm using Qt 5.5.0. This question points to a similar issue but it's for windows. Also I've installed Qt using the installer provided at it's web site. I've tested my webcam with Cheese application and it works but QCameraInfo::availableCameras() returns nothing.
I don't know if this is a definitive answer, but in my experience the dreaded "camera service is missing" comes down to exactly what the message says; for some reason the media back-end that Qt uses to get video input from a camera is broken or miss-configured in some way. In my case I had this problem in the following situations:
1. Building Qt from source
Qt build system SILENTLY DISABLES FEATURES if you don't have all the dependencies that it requires to include them in the build. Make sure to read this official article very carefully for your platform. I lost count of the times this has ruined my <insert favourite period of time such as day/week/year here >, and not only for the multimedia module...
2. Missing some gstreamer packages on my Ubuntu
I develop for Linux & Debian mostly, and on those platforms Qt depends on gstreamer backend. gstreamer is basically a plugin architecture in the core with every single feature added as plugins, and with endless possibilities of manual intervention through configuration files. See where is this is going? Clue: make sure you have all the plugins you want installed and configured properly. Here is a link to some gstreamer tools you can use. Same probably goes for other back-ends on other platforms.
And a pro tip in the end: Since both Qt5.5 gstreamer0.1 (old) and gstreamer1.0 (new) are supported as back-ends, and since Qt5.6 the new one is default. This will give you some room for experimenting, for example if the old does not work, you can try the new etc.
Hope this was useful!

exe file in Qt Quick 2.2 can't load corectly

I have a program in Qt Quick 2.2 for display images and videos by transition. I have windows 32 bit and Qt 5.3.1 (msvc2010 Opengl) on my computer.I set build configuration to release and build my program and add this dll files to release folder (qwindows.dll is in the platforms folder). When i run exe file on my computer (in my computer installed directx and codecs of media player and Qt 5.3.1) the program works good but when i run exe file on another computer (in this computer install directx 11 and codecs of media player but does't installed any version of Qt) it can does transition between images good but it couldn't show videos. i use dependency walker and it show me this. and use windeployqt that its results brings in first link (by folder dlls). where is the problem?