Guys Plz help me in video recording project using Qt C++
-
I'm beginner
and Trying to build software that records video
Now,I wrote code to detect the camera devices and can display them.
Plz guide me what to do next or suggest me ......
thank you in advance..code I written to detect :
#include "mainwindow.h" #include "ui_mainwindow.h" #include<QCamera> #include <QMediaService> #include <QMediaRecorder> #include <QCameraViewfinder> #include <QCameraInfo> #include <QMediaMetaData> #include <QMessageBox> #include <QPalette> #include <QtWidgets> Q_DECLARE_METATYPE(QCameraInfo) MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),ui(new Ui::MainWindow), camera(0), mediarecorder(0) { ui->setupUi(this); //Camera devices: QActionGroup *videoDevicesGroup = new QActionGroup(this); videoDevicesGroup->setExclusive(true); foreach(const QCameraInfo &cameraInfo, QCameraInfo::availableCameras()) { QAction *videoDeviceAction = new QAction(cameraInfo.description(), videoDevicesGroup); videoDeviceAction->setCheckable(true); videoDeviceAction->setData(QVariant::fromValue(cameraInfo)); if (cameraInfo == QCameraInfo::defaultCamera()) videoDeviceAction->setChecked(true); ui->menuDevices->addAction(videoDeviceAction); } connect(videoDevicesGroup, SIGNAL(triggered(QAction*)), SLOT(updateCameraDevice(QAction*))); // connect(ui->captureWidget, SIGNAL(currentChanged(int)), SLOT(updateCaptureMode())); //verify the above stmt,what to pass to func update updateCaptureMode() setCamera(QCameraInfo::defaultCamera()); } MainWindow::~MainWindow() { delete ui; } void MainWindow::setCamera(const QCameraInfo &camerainfo) { }
-
I'm beginner
and Trying to build software that records video
Now,I wrote code to detect the camera devices and can display them.
Plz guide me what to do next or suggest me ......
thank you in advance..code I written to detect :
#include "mainwindow.h" #include "ui_mainwindow.h" #include<QCamera> #include <QMediaService> #include <QMediaRecorder> #include <QCameraViewfinder> #include <QCameraInfo> #include <QMediaMetaData> #include <QMessageBox> #include <QPalette> #include <QtWidgets> Q_DECLARE_METATYPE(QCameraInfo) MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),ui(new Ui::MainWindow), camera(0), mediarecorder(0) { ui->setupUi(this); //Camera devices: QActionGroup *videoDevicesGroup = new QActionGroup(this); videoDevicesGroup->setExclusive(true); foreach(const QCameraInfo &cameraInfo, QCameraInfo::availableCameras()) { QAction *videoDeviceAction = new QAction(cameraInfo.description(), videoDevicesGroup); videoDeviceAction->setCheckable(true); videoDeviceAction->setData(QVariant::fromValue(cameraInfo)); if (cameraInfo == QCameraInfo::defaultCamera()) videoDeviceAction->setChecked(true); ui->menuDevices->addAction(videoDeviceAction); } connect(videoDevicesGroup, SIGNAL(triggered(QAction*)), SLOT(updateCameraDevice(QAction*))); // connect(ui->captureWidget, SIGNAL(currentChanged(int)), SLOT(updateCaptureMode())); //verify the above stmt,what to pass to func update updateCaptureMode() setCamera(QCameraInfo::defaultCamera()); } MainWindow::~MainWindow() { delete ui; } void MainWindow::setCamera(const QCameraInfo &camerainfo) { }
@thippu
take a look at the Camera example -
@thippu
take a look at the Camera example@raven-worx
Bro thanx for the reply
I have been using that to develop the project but In that If I build&run that project,During execution of the Application I can see only Image Tab(Image Functionalities)
I can't switch to Video tab
What to do?