c++ get supported camera resolutions and frame rate OSX - c++

I am using ffmpeg to record a video from a connected camera. I would like to be able to retrieve the supported camera resolution and framerate. Unfortunately this is currently not supported in ffmpeg on OSX. Are there other solutions out there? I've searched google and stackoverflow but the best I could find was a solution for windows using dshow.
I imagine this is possible with avfoundation but I don't have any experience with it. I am also using qt (not quicktime, the qt framework) so it would have to be compatible with that. :)
Thank you for your time.

In Qt (starting from 5.3 version) you have QCamera
foreach (const QCameraInfo &cameraInfo, QCameraInfo::availableCameras()) {
QCamera *camera= new QCamera(cameraInfo);
QMediaRecorder *recorder = new QMediaRecorder(camera);
// DO queries on QMediaRecorder
}
You can check here the QMediaRecorder docs
Moreover here is an introduction.

Related

Recording desktop using Qt multimedia

I'm trying to record microphones, cameras and monitors using Qt's multimedia module. But I couldn't find anything about screen recording in documentation. So it seemed I'd to do it by myself.
I've searched about that, found that answer:
How to display desktop in windows form using Qt?
Seems I've to use FFMPEG to merge these taken screenshots into mp4 file, also it doesn't seem an efficient way. I want to show real time recording output with QVideoWidget. I was going to use QMediaCaptureSession, QMediaRecorder. But they only work with camera. Is there any way to record desktop screen with Qt's multimedia module?
P.S: Please correct me, if my question is wrong

How to access USB camera through Qt c++ gui application

I am new to Qt GUI development. I have installed Qt GUI on windows platform. I need to setup a Qt C++ based GUI application to run connected USB camera. I tried to find out the related example but mostly based on webcam application. Is there any suggested example for accessing USB camera via Qt C++ GUI, I can go through?
There is no essential difference between "webcam" and "usb camera". A webcam is a video camera that feeds or streams an image or video in real time. This means that your USB camera can be a webcam if it supports such a function.
To accomplish your task, use the qt documentation and it's perfect examples, like this camera example.
Also, could be useful:
Recording Video from USB Cam with Qt5
Camera Overview

Kinect v1 integrates with qt

I have been working with Qt and Kinect v1 for couple of weeks. I don't know how to create a screen inside a Qt GUI and show stream video captured by Kinect.
I have searched for a in-depth tutorial in the Internet but it seems like nothing related directly to my problem.
I prefer programming in C++, using Qt 5.6. I know how to use some basic Qt feature but have never experienced with OpenGL in qt before. I can also run Kinect using Developer Toolkit browser and it works perfectly. Then I saw a tutorial using kinect and C++ at the link: https://homes.cs.washington.edu/~edzhang/tutorials/kinect/kinect2.html.
I followed the instructions and I can create a new windows show the stream video captured by Kinect sensor but when I using the same code in the Qt project, it just only show a black video. I don't know how to resolve the problem at all. The code is too long because I write it in the project created last week.

How can I combine Kinect data with Qt5?

I'm currently trying to create a GUI that will display Kinect data as well as a couple control features (buttons, etc.) and a graph. The control features and the graph is simple enough however I'm a bit stuck on how to continue on with the Kinect.
I've looked at numerous examples for MSVS and Kinect Studio but I can't quite figure out how to import the Kinect data to my Qt script. Also, I need it so that the Qt data can be recorded then replayed when a button is pressed.
How should I go about this? My hope is some how I can extract the Kinect data in its raw (x,y,z) format then reconstruct the data using openGL? I've seen references of OpenNI as well as OpenCV but I'm unfamiliar with either. I'm pretty familar with Qt but have virtually no experience with Kinect development.
I'm currently using Qt5 Creator, MSVS2015, and Kinect SDK2.

Can't get supported resolutions of the camera for image capturing using QCamera in Qt 5.0.2 (Linux)

I am trying to write a simple program for taking photos from the webcam using Qt.
There is an example project in the Qt Creator, where QCamera is used to take photos and record video. But it is not working the right way. I can't get supported resolutions of the camera using method QCameraImageCapture::supportedResolutions(). A null QList object is returned, and camera is always capturing images with 640x480 resolutions.
OS is Ubuntu 11.04. Same problem occurs on Windows XP.
Can anyone help me?
I have answered nearly the same question.
https://stackoverflow.com/a/21140214/2452081
In short:
Portable solution can be gstreamer, but if Windows DirectShow solution is enough for you download my code from here