Solved QML Camera : Noise appears on the camera image at high load
-
Hi all, I'm creating a camera display app.
I have a problem. That is, if you put a load on the CPU, noise will be generated in the camera image.
What kind of noise is that the camera image becomes black for a moment.
But, this problem did not occur with the function alone.I want to constantly animate and swipe within this app.
However, if you do that, the camera image will not be displayed correctly.
I took measures such as using OpenCV, but it has not been a fundamental solution.
(I want to use two or more camera images, but this method is too heavy to use.)How do you solve such problems?
The source code below shows the camera image.
Camera{ id: cam1Stream deviceId: QtMultimedia.availableCameras[0].deviceId } VideoOutput{ id: content width: base.width; height: base.height source: cam1Stream }
Development environment
Qt Creator version: 4.5.1
Qt version: 5.10.1
CPU used: imx8m
use camera: 1280x960 YUV Format -
@T_T-0912 Hi, what you are seeing is basically that QML UI is a single thread. If you force this thread too much (which you are doing with image processing to show image and doing animations on top of it) it will consume a lot of CPU. I recommend processing the image in a different thread (not using QML) for this if performance is an issue. I work for a company where we use boards with limited resources and created a product to solve these issues:
https://developer.ridgerun.com/wiki/index.php?title=Gstreamer_QT_Overlay
-
@T_T-0912 Hi, what you are seeing is basically that QML UI is a single thread. If you force this thread too much (which you are doing with image processing to show image and doing animations on top of it) it will consume a lot of CPU. I recommend processing the image in a different thread (not using QML) for this if performance is an issue. I work for a company where we use boards with limited resources and created a product to solve these issues:
https://developer.ridgerun.com/wiki/index.php?title=Gstreamer_QT_Overlay
-
Thank you for the answer.
I will try to solve it in another way.