defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"
Asked Answered
D

2

8

I'm trying to execute QCamera example on Ubuntu, Qt 5.6. "The camera service is missing" message observed.

defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"
Diffluent answered 6/6, 2016 at 6:24 Comment(1)
Did you get it working? I'm having the same issue on Kubuntu16.04 with QT 5.7. I have /dev/video0 and VLC is able to stream from the camera.Fungus
C
6

Check if you have all dependencies installed. They are:

qtmultimedia5-dev

_

libqt5multimedia5-plugins

Ex:

sudo apt-get install libqt5multimedia5-plugins
Carbarn answered 26/5, 2017 at 22:12 Comment(1)
no, it did. Now the error message is camerabin plugin is missing for gstreamer 1.10. It is a pointer to gstreamer1.0-plugins-bad, which solves the issue.Discomposure
L
0

Checking the example code it seems the example tries to construct the camera object with default camera. Method setCamera is obviously called with camera info which is not valid.

    setCamera(QCameraInfo::defaultCamera());

You can verify that by changing it to

QCameraInfo info = QCameraInfo::defaultCamera();
if (!info.isNull())
{
    setCamera(info);
}
else
{
    qError() << "Default camera not found!";
}

It obviously expects the camera to be found from /dev/video0. You could check if it exists. If your camera is something like video1 or video2, you could rename it to video0 and try again.

You can also add a debug message to the for-loop in Camera class constructor to see device names of available cameras (and modify the code to select other than default camera).

foreach (const QCameraInfo &cameraInfo, QCameraInfo::availableCameras()) {
{
    qDebug() << cameraInfo.deviceName();
}
Lentigo answered 6/6, 2016 at 7:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.