QMl Camera returns "Camera is in use" if restarted
-
Hi everyone,
I am using qt6.7.0.
Using the camera QML type likeimport QtQuick 2.0 import QtMultimedia Item { id:root function stop() { camera.stop(); startcamera.visible=true; } Camera { id: camera active: false onErrorOccurred: (error,errorString)=> { console.log(errorString) console.log(error) } } MyButton { id:startcamera anchors.centerIn: root text:qsTr("ScanQr") onClicked: { camera.start(); startcamera.visible=false; } } }
I see the webcam light turned on the first time the
start
function is called.
The webcam light turns off when calling thestop
function.
But when callingstart
again the camera returns the errorCamera is in use
and the webcam light does not turn on.
I am using Ubuntu on a laptop with a webcam.Any help on how to restart or rehuse the camera in a QML type will be much appreciated.
-
Hi everyone,
I am using qt6.7.0.
Using the camera QML type likeimport QtQuick 2.0 import QtMultimedia Item { id:root function stop() { camera.stop(); startcamera.visible=true; } Camera { id: camera active: false onErrorOccurred: (error,errorString)=> { console.log(errorString) console.log(error) } } MyButton { id:startcamera anchors.centerIn: root text:qsTr("ScanQr") onClicked: { camera.start(); startcamera.visible=false; } } }
I see the webcam light turned on the first time the
start
function is called.
The webcam light turns off when calling thestop
function.
But when callingstart
again the camera returns the errorCamera is in use
and the webcam light does not turn on.
I am using Ubuntu on a laptop with a webcam.Any help on how to restart or rehuse the camera in a QML type will be much appreciated.
Hi,
I am facing the same issue using Pyside6 on Debian. I was hoping the problem would be fixed with QTBUG-114174 in 6.5.3 but the problem is still there. The problem also shows in Qt 6.6.0.
Restarting is working fine with the same webcam using Qt 5.15 and the old camera interface.Best wishes,
Martin. -
Hi,
I am facing the same issue using Pyside6 on Debian. I was hoping the problem would be fixed with QTBUG-114174 in 6.5.3 but the problem is still there. The problem also shows in Qt 6.6.0.
Restarting is working fine with the same webcam using Qt 5.15 and the old camera interface.Best wishes,
Martin. -
@MartinK1
This one is newer and should be resolved, I have not tried it.
https://bugreports.qt.io/browse/QTBUG-117735