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. QAbstractVideoSurface camera frames brightness
Forum Updated to NodeBB v4.3 + New Features

QAbstractVideoSurface camera frames brightness

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 526 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    tomatoketchup
    wrote on last edited by tomatoketchup
    #1

    Hi everyone,

    I implemented a QAbstractVideoSurface, and a widget to be painted based on this example.
    Everything works fine, but the camera preview I get is very dark compared to the result I get when I use a QCameraViewfinder or QVideoWidget.
    Here's the code I am using to create the QCamera:

    m_camera = new QCamera(this);
    
    connect(m_camera, &QCamera::statusChanged, this, &MainWindow::cameraStatusChanged);
    
    m_camera->load();
    m_camera->setViewfinder(ui->videoWidget->videoSurface()); // videoSurface is a QAbstractVideoSurface
    

    And here's the slot 'cameraStatusChanged':

    void MainWindow::cameraStatusChanged(QCamera::Status status)
    {
        if(status == QCamera::LoadedStatus)
        {
            m_cameraLoaded = true;
    
            QCameraImageProcessing *imgProcessing = m_camera->imageProcessing();
    
            if(imgProcessing->isAvailable())
            {
                qDebug() << "image processing available";
                imgProcessing->setBrightness(1.0);
                imgProcessing->setSaturation(1.0);
            }
        }
        else if(status == QCamera::UnloadedStatus)
        {
            m_cameraLoaded = false;
        }
    }
    

    Unfortunately, the brightness and the other filters (like the saturation) don't work and the preview video is still dark.

    How can I change the brightness of my video frames?
    Do I need to implement my own QVideoWidget and a QPainterVideoSurface (which is undocumented) ?
    Thank you in advance.

    EDIT: Is there a way to adjust the brightness automatically, as the QVideoWidget does?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tomatoketchup
      wrote on last edited by
      #2

      For those who implemented a QAbstractVideoSurface: didn't anyone have that problem?

      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