Most performant way to show and record camera images
I'm looking for the most perfomant way to connect to a Webcam and display the frames in a widget.
So far I've tried updating a label via pixmap.
Then I've tried to show the frames in a QOpenGlWidget (with subTexImage2d() - which seems to lead to problems in the paintGl() function).
With the above approaches my cpu has a workload of about 10%.
I also tried a camera example from qt which uses the QtCamera and ViewFinder class.
Comparing the software which comes with the webcam to my approaches the webcam software seems to be much more performant (almost 2% cpu workload).
I could use QCamera as well but I need to record my frames and the QCamera class tells me that it is not possible to record from my webcam (isCaptureModeSupported).
At the Moment I'm using opencv to grab the frames and to record images/videos as a mockup function. To view the frames I went back to update a Label on the MainWindow.
Is there a more efficient way to grab images from a camera and show them except updating Labels (maybe inherit from QMediaObject directly)?
The only thing I can think of is to directly "talk" to the webcams API to grab the Images - so I can avoid opencv internal overload (if there is any).
Hi and welcome to devnet,
You could consider implementing you own QtMultimedia backend, that way you can also manage the file writing.