Qt camera example does not find the laptop's webcam - c++

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!

Related

Running qt creator via remote desktop

We are developing a software using QT creator. The software is meant to run on windows and on an ARM mini-computer running Debian. To test the software on the mini-computer, we logged in on the mini computer using ssh and an exported display. Some programs like Inkscape run fine, but we can't get to run QT Creator. It always displays the following errors:
No tool chain set from kit "Desktop".
No tool chain set from kit "Desktop".
Cant find EGLConfig, returning null config
Unable to find an X11 visual which matches EGL config 0
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
Cant find EGLConfig, returning null config
Unable to find an X11 visual which matches EGL config 0
Could not initialize OpenGL
We also tried to log in from another x86 linux computer, but this created the same errors. Thus we suppose that the problems are linked to the architecture. Does anybody know how to solve this issue?
EDIT: We just tried to access QT creator from another ARM Debian mini-computer and it also fails. Thus it does not seem to be related to the architecture as we first suspected.
(We could of course do cross compiling and remote debugging, but we try to avoid this)
Try loading qtcreator without the Welcome addon:
qtcreator -noload Welcome
The Welcome addon uses OpenGL which probably isn't supported by X forwarding.

Is the gstreamer-java 1.6 compatible with gstreamer 1.6.1 windows binaries

Do anyone have any idea if the gstreamer-java-1.6.jar downloadable from https://code.google.com/p/gstreamer-java/downloads/list is compatible with gstreamer windows 1.6.1 binaries? I installed both and setup the eclipse environment but somehow it gives me the warning for all(assuming as lot of warnings are on the eclipse console) the gstreamer plugins.
(javaw.exe:9744): GStreamer-WARNING **: Failed to load plugin 'D:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstgio.dll': 'D:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstgio.dll': The specified module could not be found..............
Although I can see everything is fine from command prompt running gstreamer(creating sample pipeline etc).
For any other, it will be helpful that gstreamer-1.6 compatible java bindings are there and available on https://github.com/praxis-live/praxis/tree/master/lib.gst1-java-core/release/modules/ext.
See reply on java-gstreamer forum.
No, it isn't!
The new home of the Java bindings is at https://github.com/gstreamer-java
The old GStreamer-Java only supports GStreamer 0.10. Try
gst1-java-core at https://github.com/gstreamer-java/gst1-java-core
There are no pre-built binaries there, although you can get my one
from Praxis LIVE -
https://github.com/praxis-live/praxis/tree/master/lib.gst1-java-core/release/modules/ext
Click on it, then click view raw and you can download it.
It's still a work in progress, and I haven't tested on Windows yet,
although others may have.
Best wishes,
Neil

How to build and run examples in OpenGL Superbible 6th edition?

My system is Win 8.1 64-bit and using VS2013 Express. I can verify my video cards support the latest OpenGL and OpenCL. I used the latest code and media files from authors github and site: https://github.com/openglsuperbible/sb6code and http://www.openglsuperbible.com/example-code/ respectively.
I am able to make debug and release builds of the project(s) successfully but cannot correctly run it either via debug mode or the .exe in the bin folder. A white window will show up and then exit. I was able to step through and found that glfwOpenWindow will return false causing the exit but I cannot step further and see why it is returning so. I found some solutions that suggested changing
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
to
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, 0);
but this does not change my results. I can verify also that major version is 4 and minor is 3 for the book code. I have found a few other people having the same problem but no resolution. Another possible solution (but to a different problem it seems) was changing the project subsystem to Console from Windows but this throws an error regarding main and so it may not be what I'm looking for.
For reference, this book is using glfw version 2.7.6 when (currently) the latest is 3.0.4. I tried swapping this too but it understandably blew up due to all of the changes.
Any further ideas would be great and very helpful!
I have discovered that while my GPU does support the latest OpenGL, my computer was instead using the integrated Intel HD 4600! By switching my computer to use the dedicated GPU by default, I am able to run the latest OpenGL.
If it successfully compiled, then please do following:
Ensure that you do have the latest graphic card drivers installed (eg. if you have nVIDIA card, go to www.nvidia.com and get newest drivers).
Ensure that files which these examples are trying to load (I guess jpg/tga/png files, maybe some obj/fbx/3ds files for geometry, whatever else these examples need) are present at expected path (relative path to exe).
Run it as a debug, place breakpoints in app initialization, see that OpenGL is initialized correctly and that required files are loaded. I think you will find that required files are not in expected path(s).
P.S.
I think the best practice for learning OpenGL is not to rely on some library to open window and initalize OpenGL for you - it's better you learn it all step by step - how to open an application window, how to initialize gl render context associated with device context etc. You'd also avoid things like this when you don't know where the problem could be.

Capture MacBook Pro iSight video with C++

I'd like to grab a frame from my MacBook Pro iSight in C++ and do some elaborations on it.
I already know how to do that in ObjC with QTKit, but is there any way to do the same thing in C++?
NOTE:
I tried to install OpenCV with macports, but the framework doesn't seem to support iSight cameras.
You could do that using OpenCV ( http://opencv.willowgarage.com/wiki/ )
And here is a sample code you can copy/paste to try it : http://www.geckogeek.fr/lire-le-flux-dune-webcam-camera-video-avec-opencv.html (article in french but code is in english)
You can also use the Integrating Vision Toolkit (http://ivt.sourceforge.net), which supports Mac OS X and Quicktime.
Here are the steps:
Install the Quicktime SDK, if you haven't yet.
Download the current version of the IVT and unpack the archive.
Set the flag 'USE_QUICKTIME = 0' to 'USE_QUICKTIME = 1' in IVT/src/Makefile.base
Run 'make' in IVT/src
Run 'make' in IVT/examples/CaptureApp
Run '../../files/make_app.sh CaptureApp captureapp' in IVT/examples/CaptureApp
Run the application, either by double clicking on the generated icon, or by typing 'open CaptureApp.app'.
If you have any questions, let me know (you can find my contact information on the IVT homepage). I also answer questions in the IVT Sourceforge forum usually quite fast.

Qt applications on new Mac App Store

I have a Qt app that runs on OS X that has potential to go on the new Mac App Store.
I have reviewed the guidelines at https://developer.apple.com/appstore/mac/resources/approval/guidelines.html. I also saw a post here on SO about Java and the AppStore.
Has anyone else considered this with their own apps and whether or not the Qt framework will run afoul of the App police? You still have to stay within the Apple HIG, i.e. no theming and cannot use private APIs.
Still seems like a risky proposition over pure ObjC. Anyone else tempted?
My Qt app has today been accepted and is available on the App Store. So the answer is yes, Apple will accept Qt based applications.
Here's some information about my application. It written in C++ and uses Qt v4.7.2 under the LGPL license. The Qt frameworks are included in the app bundle (obviously, as LGPL requires I use dynamic linking instead of static). There are also some other frameworks, from Nikon and Canon, because its an app for remote control of DSLR cameras - see http:www.hartcw.com . These are only available compiled for Intel 32bit, hence this forces my app to also target 32bit, and so I have to use the 32bit Carbon build of Qt.
Regarding writing files to the local hard disk, it does not write anything to the bundle directory, but does write to this directory:
~/Application Support/Hart/Smart Shooter
It also writes Qt GUI state to this file (via the QSettings class)
~/Library/Perferences/com.hartcw.SmartShooter.plist
'Hart' is the company name as registered with Apple, and 'com.hartcw.SmartShooter' is the app identifier name, so I think this is what Apple checks against.
Also there were a couple of things I had to do regarding the plist file, see http://hartcw.com/francis/qt-and-the-mac-app-store
Infact it was accepted first time by Apple! It was in the 'waiting for review' stage for about 10 days, then transitioned to 'in review' for about 4 hours, and then went live on the app store.
Using Qt is no problem at all for creating an app for the App Store. All you have to do is to make sure that you are using Qt compiled with Cocoa and not Carbon.
EDIT: I've just found that there may be an issue if your application uses Qt plugins (as this apparently makes Qt write to ~/Library/Preferences/com.trolltech.plist which is outside the 'domain' of an App Store application.)