I am building a cross-platform application to record multimedia files for ongoing processing. This is based on an inherited application and I am not able to re-write using alternative libraries.
My current issue is that the QMediaRecorder does not apparently save the video file onto the local drive - I have temporarily hard-coded the file to be saved as banana.mov
into the users root folder.
When executed, the output file is not being saved.
I have tried forcing the resolution as suggested here and have seen that others have had issues recording from windows but OSX was fine
Development environment OSX 10.10 with Qt5.4 (the same issue is also happening on a Windows 8.1 machine using Qt5.3)
This code on Github is based on the camera example, with additional debug code added when trying to identify and reproduce the issue.
While investigating, the QMediaRecorder::supportedAudioCodecs and QMediaRecorder::supportedVideoCodecs both return empty lists. This happens on both the OSX build and the Windows environments.
The debug output is as follows:
Status change SIGNAL 'The recorder is initializing.'
Output location file:~/banana.mov
2015 01 05 14:59:58.111 Number of supported AUDIO Codecs 0
2015 01 05 14:59:58.111 Number of Audio sample rates 0
2015 01 05 14:59:58.111 Number of Video Codecs 0
2015 01 05 14:59:58.111 Number of Video Frame Rates 0
2015 01 05 14:59:58.111 Number of Containers 0
Location Changed SIGNAL 'file:~/banana.mov'
State change SIGNAL 'The recording is requested.'
Recording should have started
2015 01 05 14:59:58.111 Number of supported AUDIO Codecs 0
2015 01 05 14:59:58.111 Number of Audio sample rates 0
2015 01 05 14:59:58.111 Number of Video Codecs 0
2015 01 05 14:59:58.111 Number of Video Frame Rates 0
2015 01 05 14:59:58.111 Number of Containers 0
Status change SIGNAL 'Recording is requested but not active yet.'
I have a feeling that I'm missing something really obvious, I just haven't spotted it quite yet!
edit 1 The obvious this is that the status is Recording is requested but not active yet
and not Recording is active
. I'm currently trying to work out why the recording has not started.
edit 2 The audio recorder example does record and save an audio file. It looks like QMediaRecorder does not return a list of available audio codecs, but QAudioRecorder does return a list of audio codecs. I am getting the same results on both Windows 8.1 using Qt5.3 and OSX using Qt 5.4