Avan
11th May 2017, 04:13
Hi, I am new here. I am trying to record a local video file that is played by a QMediaPlayer. But it seems that the QMediaRecorder is not recording the video that is being played.
Basically I have a video player that is playing that the video will start recording whenever the user click on the record button.
Below is the code snippet for my recording function.
void VideoPlayer::record()
{
if (!isRecording)
{
videoRecorder = new QMediaRecorder(&mediaPlayer);
videoRecorder->setOutputLocation(QUrl::fromLocalFile(QCoreApplica tion::applicationDirPath() + "/" + "testRecord.mp4"));
videoRecorder->record();
isRecording = true;
}
else
{
videoRecorder->stop();
}
}
I try debugging and these are the values I got from QMediaRecorder.
QMediaPlayer state is playing state during recording.
QMediaRecorder status = UnavailableStatus
QMediaRecorder state = StoppedState
QMediaRecorder error = NoError
What am I doing wrong? This has been bugging me for days and I really need help.
I am begging on my knees.
Basically I have a video player that is playing that the video will start recording whenever the user click on the record button.
Below is the code snippet for my recording function.
void VideoPlayer::record()
{
if (!isRecording)
{
videoRecorder = new QMediaRecorder(&mediaPlayer);
videoRecorder->setOutputLocation(QUrl::fromLocalFile(QCoreApplica tion::applicationDirPath() + "/" + "testRecord.mp4"));
videoRecorder->record();
isRecording = true;
}
else
{
videoRecorder->stop();
}
}
I try debugging and these are the values I got from QMediaRecorder.
QMediaPlayer state is playing state during recording.
QMediaRecorder status = UnavailableStatus
QMediaRecorder state = StoppedState
QMediaRecorder error = NoError
What am I doing wrong? This has been bugging me for days and I really need help.
I am begging on my knees.