Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt5 QCamera in windows environment - Unable to change any camera settings

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

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.0k Views
  • 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 Offline
    G Offline
    Gheeta
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved