Important: Please read the Qt Code of Conduct -

How to know if images and video frames scanlines are bottom up or top down?

  • hello,

    My app modifies video frames on the fly (qml filters) using the following code:

    QVideoFrame CBScopeVirtualCouderRunnable::run(QVideoFrame *inputframe, const  QVideoSurfaceFormat &surfaceFormat, RunFlags flags)
        QImage tempImage=qt_imageFromVideoFrame(*inputframe);
        ... do something with image bits
        QVideoFrame outputFrame= QVideoFrame(tempImage);
        return outputFrame;

    Problem... on some computers, the image bits (comming from the webcam) are first line first, on others, it is last line first.
    How can I detect whichcase I am in?


  • Lifetime Qt Champion


    Do you know what image type these two different camera delivers ?

  • hello,

    no, one is on windows, the other on mac... i have not tried other os yet...

    how would i check the image type?


Log in to reply