Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QT6 Using QVideoSink with QCamera to process every frame
Qt 6.11 is out! See what's new in the release blog

QT6 Using QVideoSink with QCamera to process every frame

Scheduled Pinned Locked Moved Unsolved Qt 6
qcameraqvideosinkqt6qimagecaptureqvideocapture
1 Posts 1 Posters 1.1k 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.
  • S Offline
    S Offline
    svar
    wrote on last edited by svar
    #1

    I`m digging example qt6 6.2.2 camera.pro and found next line code:

    m_captureSession.setVideoOutput(ui->viewfinder);
    

    this is the way of outing frames to ui.

    I know what QVideoSinc is used for grab every frame and process it.

    I have replaced this line with

    m_captureSession.setVideoSink(&videoSink);
    

    where videoSinc defined as my class :

    class MyVideoSinc : public QVideoSink
    {
        Q_OBJECT
    public:
        bool videoframeReady=false;
        MyVideoSinc()
        {
            connect(this, &QVideoSink::videoFrameChanged, this, &MyVideoSinc::hvideoFrameChanged);
        }
    public Q_SLOTS:
    
        void hvideoFrameChanged(const QVideoFrame &frame)
        {
            videoframeReady=true;
        }
    };
    

    hvideoFrameChanged raised for every frame in Windows build, but only once in Android application.

    What is wrong here. How to grab and process frames from QCamera in QT6 ? I don`t want show frames with ui->viewfinder. I need processing frames myself.

    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