Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to find color space of QVideoFrame in QVideoFilterRunnable::run



  • I need to know pixel color space of frames in the below cuz I need to convert it to the opencv's BGR color space.

    QVideoFrame QVideoFilterRunnable::run(QVideoFrame *input, const QVideoSurfaceFormat &surfaceFormat, QVideoFilterRunnable::RunFlags flags)
    

    I have tried

    QVideoSurfaceFormat.pixelFormat();
    

    which gives me "Format_YUYV" and it is not enough cuz apparently there are different versions of this color space. (https://en.wikipedia.org/wiki/YUV)

    Please let me know how I can get possibly more details.

    There is also below which allows me to query more details about the fame properties but I don't what I need to query for

    QVariant QVideoSurfaceFormat::property(const char *name) const
    

    Thank you,


  • Qt Champions 2018

    @mikeitexpert ,

    Similar issue was registered in bugreports.qt.io.
    https://bugreports.qt.io/browse/QTBUG-54521

    If you are using Qt 5.8previous, Can you confirm with the latest version Qt 5.12,again?
    These report is also closed, but when I check Codereview, it looks like support only QtQuick.
    Therefore, I feed that it necessary to confirm the operation in C ++.


  • Lifetime Qt Champion

    Hi,

    No it matches only one format:

    • QVideoFrame::Format_UYVY is Y′UV422 with (u, y1, v, y2)
    • QVideoFrame::Format_YUYV is Y′UV422 with (y1, u, y2, v).

Log in to reply