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"
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
shevv
  • 81
  • 1
  • 2
  • 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. – zorglub76 Jul 14 '16 at 06:54

2 Answers2

6

Check if you have all dependencies installed. They are:

qtmultimedia5-dev

_

libqt5multimedia5-plugins

Ex:

sudo apt-get install libqt5multimedia5-plugins
Ráfagan
  • 2,165
  • 2
  • 15
  • 22
  • 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. – elephant Aug 10 '17 at 18:36
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();
}
talamaki
  • 5,324
  • 1
  • 27
  • 40