QMediaRecorder



  • Hi everyone,

    I'm writing a QT 5.7.0 app which uses the QCamera class. I have successfully produced the live video stream on the surface and finally figured out the recording issues of QMediaRecorder my problem is it saves the video in vorbis/ogg format and appends .ogg to file filename.

    QCamera *camera = new QCamera(this);
    QCameraViewFinder *viewfinder = new QCameraViewFinder(this);
    QMediaRecorder *recorder = new QMediaRecorder(camera, this);
    QVideoEncoderSettings settings = recorder->videoSettings();
    settings.setCodec("video/mpeg2");
    recorder->setVideoSettings(settings);
    
    

    When you check the recorder->videoSettings().codec() it returns "video/mpeg2" or "video/avi". I have even done the same with QAudioEncoderSettings using "audio/mp3" the outcome is the same. the recorded file is of type "Video (video/x-theora+ogg) and my file ends up with the extension of .ogg even if I assign an extension of say .avi.

    Operating system is Linux Mint Rosa, using Qt 5.2.0

    Thanks for any help you may offer.


  • Lifetime Qt Champion

    Hi,

    Did you check what the supportedAudioCodecs and supportedVideoCodecs methods return ?



  • Yes I did and actually they return a blank list, that can't be good. I'll research that next.


  • Lifetime Qt Champion

    In any case, you should consider updating Qt. 5.2 is pretty old by now. 5.6 is the LTS, 5.7 current and 5.8 is around the corner.



  • @SGaist said in QMediaRecorder:

    In any case, you should consider updating Qt. 5.2 is pretty old by now. 5.6 is the LTS, 5.7 current and 5.8 is around the corner.

    Man, I'm so sorry, I am using Qt 5.7.0 off of the Qt website. I hope there is some improvements on the multimedia classes as now I'm fighting a different challenge. I can turn the web cam on and off until I call the QMediaRecorder start and stop function, after that I lose all control of the web cam, it just stays in Active state and Status no mater how many times you call QCamera stop function

    Thanks for your help and I'll keep looking into the Codec poblem after I get this fixed.

    .


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.