How to record video as soon as application started?
-
@jsulm I have added the error handling like before,
connect(mediaRecorder, QOverload<QMediaRecorder::Error>::of(&QMediaRecorder::error),this, &MainWindow::displayRecorderError);
void MainWindow::displayRecorderError() { QMessageBox::warning(this, tr("Capture Error"), mediaRecorder->errorString()); }
I got an error like "no template named 'QOverLoad'" . I have checked camera example of qt which records video and capture images application and I did almost same thing. I suspect the version incompatibility. Do you think version differences cause this issue?
@hix_boz said in How to record video as soon as application started?:
Do you think version differences cause this issue?
What Qt version do you use?
-
@hix_boz said in How to record video as soon as application started?:
Do you think version differences cause this issue?
What Qt version do you use?
-
@jsulm I have added the error handling like before,
connect(mediaRecorder, QOverload<QMediaRecorder::Error>::of(&QMediaRecorder::error),this, &MainWindow::displayRecorderError);
void MainWindow::displayRecorderError() { QMessageBox::warning(this, tr("Capture Error"), mediaRecorder->errorString()); }
I got an error like "no template named 'QOverLoad'" . I have checked camera example of qt which records video and capture images application and I did almost same thing. I suspect the version incompatibility. Do you think version differences cause this issue?
@hix_boz said in How to record video as soon as application started?:
QOverload
I got an error like "no template named 'QOverLoad'"
QOverload != QOverLoad - please post the real code and the real error message.
-
@hix_boz said in How to record video as soon as application started?:
QOverload
I got an error like "no template named 'QOverLoad'"
QOverload != QOverLoad - please post the real code and the real error message.
@Christian-Ehrlicher
Do you ask to share all prject files when you say real code? Here the errors I got.Additionaly, I took the error handler connect snippet from Qt camera example which is working with my Qt version.
-
@Christian-Ehrlicher
Do you ask to share all prject files when you say real code? Here the errors I got.Additionaly, I took the error handler connect snippet from Qt camera example which is working with my Qt version.
@hix_boz said in How to record video as soon as application started?:
Do you ask to share all prject files when you say real code?
No, your connect statement.
As @Christian-Ehrlicher pointed out it is QOverload NOT QOverLoad...And the version you posted only says something about Qt version used to build QtCreator, not Qt version you're using...
-
@hix_boz said in How to record video as soon as application started?:
Do you ask to share all prject files when you say real code?
No, your connect statement.
As @Christian-Ehrlicher pointed out it is QOverload NOT QOverLoad...And the version you posted only says something about Qt version used to build QtCreator, not Qt version you're using...
After commanding "qmake --version" from terminal, I got this one.
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnuI also typed "qtdiag" and the first line of response like below.
Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609) on "xcb"
I tried either QOverLoad and QOverload and still got an error. As I said before, I took the connect part from camera example which has worked and I did not change anything. They used "QOverload" in connect line.
-
After commanding "qmake --version" from terminal, I got this one.
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnuI also typed "qtdiag" and the first line of response like below.
Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609) on "xcb"
I tried either QOverLoad and QOverload and still got an error. As I said before, I took the connect part from camera example which has worked and I did not change anything. They used "QOverload" in connect line.
@hix_boz According to Qt5.5 documentation (https://doc.qt.io/archives/qt-5.5/qmediarecorder.html#error-1):
connect(mediaRecorder, static_cast<void(QMediaRecorder::*)(QMediaRecorder::Error)>(&QMediaRecorder::error), [=](QMediaRecorder::Error error){ /* ... */ });
-
After commanding "qmake --version" from terminal, I got this one.
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnuI also typed "qtdiag" and the first line of response like below.
Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609) on "xcb"
I tried either QOverLoad and QOverload and still got an error. As I said before, I took the connect part from camera example which has worked and I did not change anything. They used "QOverload" in connect line.
@hix_boz said in How to record video as soon as application started?:
I tried either QOverLoad and QOverload and still got an error
No - there must be at least another error message, please post the error message when you use the correct function QOverload
-
@hix_boz According to Qt5.5 documentation (https://doc.qt.io/archives/qt-5.5/qmediarecorder.html#error-1):
connect(mediaRecorder, static_cast<void(QMediaRecorder::*)(QMediaRecorder::Error)>(&QMediaRecorder::error), [=](QMediaRecorder::Error error){ /* ... */ });
It worked like this,
connect(mediaRecorder, static_cast<void(QMediaRecorder::*)(QMediaRecorder::Error)>(&QMediaRecorder::error), [=](QMediaRecorder::Error error){ qDebug() << mediaRecorder->errorString(); });
The error I got ,
"Service has not been started" .Also the below message I keep getting.
(videoPlayer:9057): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed -
I think you should connect to the
QCamera::statusChanged
signal, and start the recorder after the status becomesQCamera::ActiveStatus
(maybe also stop it when it is non-active).