Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Inconsistent RBG/BGR format in video frames from Android cameras
karelc last edited by
I use a video filter on a camera in QML, this gets me QVideoFrames that I convert to QImages for processing.
I load them into RGBA8888 QImages, but it needs to be BGR so if the input frames are BGR32 (android devices do this) that's already good, if they are RGB32 (iphones do this) I use rgbSwapped on the QImage.
The problem is on all android devices the video frames report as BGR32, but some contain BGRX data while others contain RGBX data and I need to use rgbSwapped on them.
How can I detect which it is when the only information I have to go on is the same for both?