Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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)
    {
        inputframe->map(QAbstractVideoBuffer::ReadOnly);
        QImage tempImage=qt_imageFromVideoFrame(*inputframe);
        ... do something with image bits
        inputframe->unmap();
        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?

    Thanks,
    Cyrille


  • Lifetime Qt Champion

    Hi,

    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?

    cyrille


Log in to reply