Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Qt5 QCamera in windows environment - Unable to change any camera settings

    General and Desktop
    1
    1
    1895
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Gheeta last edited by

      So i have been smashing my head against the wall for a while now with this issue. I am simply unable to change the resolution and frame rate of the Webcam. I have even tested my code in linux environment and it works fine there but nothing seems to change the settings when i try them with windows 7.

      Since there is no direct way to change the resolution i have been trying to use the QMediaRecorder workaround, the main part of the code looks like this and works fine with linux as i said before. In windows it shows the video but the resolution is the defautl 640x480.

      @ camera = new QCamera(parent);
      vwidget = new VideoWidget(QSize(1280,720));
      camera->setCaptureMode(QCamera::CaptureVideo);
      recorder = new QMediaRecorder(camera);
      QVideoEncoderSettings videoSettings = recorder->videoSettings();
      videoSettings.setResolution(1280,720);
      videoSettings.setFrameRate(30.0);
      recorder->setEncodingSettings(recorder->audioSettings(),videoSettings);
      videorendercontrol = qobject_cast<QVideoRendererControl *>(camera->service()->requestControl("org.qt-project.qt.videorenderercontrol/5.0"));
      if(videorendercontrol)
      {
      videorendercontrol->setSurface(vwidget->videoSurface());
      }
      vwidget->show();
      camera->start();@

      So what i am asking is it even possible to change the resolution in windows environment at the moment without getting some external libraries? And if it is how is it done?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post