How to run QCamera Example application in Embedded Linux i.MX6 platform?



  • Hi,
    I'm trying to run the Qt5.2.1 widget example QCamera application on my i.MX6 Embedded Linux platform for make use of QCamera class in my actual task.
    I have cross compiled the QCamera example widget application (camera) and when running the application on i.mx6 platform, I'm getting the below error (on console/terminal):
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"
    Camera error: "The camera service is missing"

    After a couple of search I found from Internet that, if I use "mediaservice" plugins such as
    (1) libgstaudiodecoder.so
    (2) libgstcamerabin.so
    (3) libgstmediacapture.so and
    (4) libgstmediaplayer.so
    then this issue will not come.

    I have enable this plugins in the Yocto build and copied the "mediaservice" folder with the exact cross compiled plugins under "/usr/lib/qt5/plugins/" path of SD card.

    Still, I'm getting the same issue. I really don't know how to proceed further. Am I missing anything here? QCamera is very much important for my task. I would like to get help on this issue as early as possible since I'm running out of my time.
    Any help would be appriciated.

    Thank you in advance,
    Ajith P V


  • Lifetime Qt Champion

    Hi,

    Do you also have gstreamer installed on your target ? With all plugin packages ?



  • Thank you SGaist for the promt reply.
    The standalone gtreamer is working fine on my platform and I can able to run camera without Qt.
    I have enebaled the mediaservice routines in Yocto configuration and got the following library for my platform from Yocto (Qt 5.2.1)
    (1) libgstaudiodecoder.so
    (2) libgstcamerabin.so
    (3) libgstmediacapture.so and
    (4) libgstmediaplayer.so

    Also, I have enabled the "QT_DEBUG_PLUGINS=1" before running the 'camera' application and the log is given below

    root@imx6dlsabresd:/qtpcedemoapp/bin# ./camera 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/platforms" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqminimal.so" 
    Found metadata in lib /usr/lib/qt5/plugins/platforms/libqminimal.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("minimal") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqoffscreen.so" 
    Found metadata in lib /usr/lib/qt5/plugins/platforms/libqoffscreen.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("offscreen") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqwayland-generic.so" 
    Found metadata in lib /usr/lib/qt5/plugins/platforms/libqwayland-generic.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "wayland"
            ]
        },
        "className": "QWaylandIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("wayland") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqwayland-xcomposite-egl.so" 
    Found metadata in lib /usr/lib/qt5/plugins/platforms/libqwayland-xcomposite-egl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "wayland-xcomposite"
            ]
        },
        "className": "QWaylandIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("wayland-xcomposite") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqxcb.so" 
    Found metadata in lib /usr/lib/qt5/plugins/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "className": "QXcbIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("xcb") 
    QFactoryLoader::QFactoryLoader() checking directory path "/qtpcedemoapp/bin/platforms" ... 
    loaded library "/usr/lib/qt5/plugins/platforms/libqxcb.so" 
    loaded library "Xcursor" 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/platformthemes" ... 
    QFactoryLoader::QFactoryLoader() checking directory path "/qtpcedemoapp/bin/platformthemes" ... 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/platforminputcontexts" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so" 
    Found metadata in lib /usr/lib/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface",
        "MetaData": {
            "Keys": [
                "compose"
            ]
        },
        "className": "QComposePlatformInputContextPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("compose") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so" 
    Found metadata in lib /usr/lib/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface",
        "MetaData": {
            "Keys": [
                "ibus"
            ]
        },
        "className": "QIbusPlatformInputContextPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("ibus") 
    QFactoryLoader::QFactoryLoader() checking directory path "/qtpcedemoapp/bin/platforminputcontexts" ... 
    loaded library "/usr/lib/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so" 
    Qt Warning: Could not find a location of the system's Compose files. Consider setting the QTCOMPOSE environment variable.
    Qt Warning: Could not find a location of the system's Compose files. Consider setting the QTCOMPOSE environment variable.
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/generic" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/generic/libqevdevkeyboardplugin.so" 
    Found metadata in lib /usr/lib/qt5/plugins/generic/libqevdevkeyboardplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "EvdevKeyboard"
            ]
        },
        "className": "QEvdevKeyboardPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("evdevkeyboard") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/generic/libqevdevmouseplugin.so" 
    Found metadata in lib /usr/lib/qt5/plugins/generic/libqevdevmouseplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "EvdevMouse"
            ]
        },
        "className": "QEvdevMousePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("evdevmouse") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/generic/libqevdevtabletplugin.so" 
    Found metadata in lib /usr/lib/qt5/plugins/generic/libqevdevtabletplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "EvdevTablet"
            ]
        },
        "className": "QEvdevTabletPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("evdevtablet") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/generic/libqevdevtouchplugin.so" 
    Found metadata in lib /usr/lib/qt5/plugins/generic/libqevdevtouchplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "EvdevTouch"
            ]
        },
        "className": "QEvdevTouchScreenPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("evdevtouch") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/generic/libqtslibplugin.so" 
    Found metadata in lib /usr/lib/qt5/plugins/generic/libqtslibplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "Tslib",
                "TslibRaw"
            ]
        },
        "className": "QTsLibPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("tslib", "tslibraw") 
    QFactoryLoader::QFactoryLoader() checking directory path "/qtpcedemoapp/bin/generic" ... 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/styles" ... 
    QFactoryLoader::QFactoryLoader() checking directory path "/qtpcedemoapp/bin/styles" ... 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/iconengines" ... 
    QFactoryLoader::QFactoryLoader() checking directory path "/qtpcedemoapp/bin/iconengines" ... 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/mediaservice" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/mediaservice/libgstaudiodecoder.so" 
    Found metadata in lib /usr/lib/qt5/plugins/mediaservice/libgstaudiodecoder.so, metadata=
    {
        "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
        "MetaData": {
            "Keys": [
                "gstreameraudiodecode"
            ],
            "Services": [
                "org.qt-project.qt.audiodecode"
            ]
        },
        "className": "QGstreamerAudioDecoderServicePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gstreameraudiodecode") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/mediaservice/libgstcamerabin.so" 
    Found metadata in lib /usr/lib/qt5/plugins/mediaservice/libgstcamerabin.so, metadata=
    {
        "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
        "MetaData": {
            "Keys": [
                "gstreamercamerabin"
            ],
            "Services": [
                "org.qt-project.qt.camera"
            ]
        },
        "className": "CameraBinServicePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gstreamercamerabin") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/mediaservice/libgstmediacapture.so" 
    Found metadata in lib /usr/lib/qt5/plugins/mediaservice/libgstmediacapture.so, metadata=
    {
        "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
        "MetaData": {
            "Keys": [
                "gstreamermediacapture"
            ],
            "Services": [
                "org.qt-project.qt.audiosource"
            ]
        },
        "className": "QGstreamerCaptureServicePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gstreamermediacapture") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/mediaservice/libgstmediaplayer.so" 
    Found metadata in lib /usr/lib/qt5/plugins/mediaservice/libgstmediaplayer.so, metadata=
    {
        "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
        "MetaData": {
            "Keys": [
                "gstreamermediaplayer"
            ],
            "Services": [
                "org.qt-project.qt.mediaplayer"
            ]
        },
        "className": "QGstreamerPlayerServicePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gstreamermediaplayer") 
    QFactoryLoader::QFactoryLoader() checking directory path "/qtpcedemoapp/bin/mediaservice" ... 
    loaded library "/usr/lib/qt5/plugins/mediaservice/libgstcamerabin.so" 
    QLibraryPrivate::loadPlugin failed on "/usr/lib/qt5/plugins/mediaservice/libgstcamerabin.so" : "Cannot load library /usr/lib/qt5/plugins/mediaservice/libgstcamerabin.so: (libqgsttools_p.so.1: cannot open s 
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera" 
    Camera error: "The camera service is missing" 
    
    

    I hope this will give some insight.
    Looking forward to get help.



  • One more update.
    I have resolved the dependecy issue by putting almost all gstreamer libraries (still I don't know any other libraries are required).
    After I run the camera, now I'm getting other issue as below ( I have enabled the "QT_DEBUG_PLUGINS=1" before running the 'camera' application). This prints are coming continuosly.

    (camera:979): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    
    (camera:979): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
    
    (camera:979): GStreamer-CRITICAL **: gst_bus_add_signal_watch_full: assertion 'GST_IS_BUS (bus)' failed
    
    (camera:979): GStreamer-CRITICAL **: gst_bus_remove_signal_watch: assertion 'GST_IS_BUS (bus)' failed
    
    (camera:979): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    
    (camera:979): GLib-GObject-CRITICAL **: g_signal_handler_disconnect: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
    
    (camera:979): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    
    (camera:979): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
    
    (camera:979): GStreamer-CRITICAL **: gst_bus_add_signal_watch_full: assertion 'GST_IS_BUS (bus)' failed
    
    (camera:979): GStreamer-CRITICAL **: gst_bus_remove_signal_watch: assertion 'GST_IS_BUS (bus)' failed
    
    (camera:979): GLib-GObject-WARNING **: invalid (NULL) pointer instance
    
    

    Could anyone help me to resolve this issue?
    Thank you in advance,
    Ajith P V



  • Is there any document or link which teling what and all plugins or dependencies QCamera have when it is running on Embedded Linux platform?
    I have put gstreamer libraries and now I'm getting below error (each time different errors are coming but Camera viewfinder is not displaying anything)

    root@imx6dlsabresd:/qtpcedemoapp/bin# ./camera 
    
    ERROR: v4l2 capture: slave not found!
    
    ** (camera:982): CRITICAL **: gst_photography_set_focus_mode: asERROR: v4l2 capture: slave not found!
    sertion 'photo != NULL' failed
    
    ** (camera:982): CRITICAL **: gst_missing_encoder_message_new: assertion '!gst_caps_is_any (encode_caps)' failed
    
    (camera:982): GStreamer-CRITICAL **: gst_element_post_message: assertion 'message != NULL' failed
    CameraBin error: "Your GStreamer installation is missing a plug-in." 
    


  • I can able to run QCamera application and USB webcam is working as of now (UVC Camera which attached to one platform) but, V4L2 CMOS camera that connected to the platform is not working (eventhough its node is /dev/video0).
    The Camera need to be show live view(overlay) and need a capture functionality. But, when I look into the Camera application console prints, it looks like QCamera required VPU for doing this job. Unfortunately, my CMOS camera configured for IPU only. I have no idea how to proceed further :(


  • Lifetime Qt Champion

    If you can make that camera work properly with gstreamer, you could modify the gstreamer backend of QtMultimedia and adapt the pipeline used.



  • Hi,
    I'm working on playing video on rasp pi recently. Maybe most things are similar to camera, cause they both depend on multimedia and qdeclarative, hope my way will be helpful.

    First, you should not just copy the .so file to the multimedia dir. It will not work even the name is same. You should make the module and install it to multimedia dir. Here is the example of rasp pi.

    $ cd qt-everywhere-opensource-src-5.0.2/<module>
    $ /usr/local/Qt-5.0.2-raspberry/bin/qmake
    $ make
    $ sudo make install
    And the link: http://www.ics.com/blog/building-qt-5-raspberry-pi
    This may solve the error: "Camera error: "The camera service is missing"

    Second, you have to install gstreamer on you embedded device, or it will show the error "defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera".

    Hope it will be helpful.



  • @ascnp Thank you very much for your support. I have put all the gstreamer libraries to my SD card and now I can able to run the QCamera with webcam (UVC USB Camera). Since, my actual camera make use of only IPU and not using any VPU encoding or decoding, the same application is hanging when I used it with OV5640 CMOS camera.
    Thanks again,
    Ajith P V



  • @SGaist I'm afraid, I didn't get the point. Could you please elobarate a bit more regarding what I suppose to do.


  • Lifetime Qt Champion

    If you can get the image from your camera using gstreamer on the command line, you could modify the backend in QtMultimedia to match the pipeline used on the command line.



  • @SGaist May I know how to modify the backend in QtMultimedia to match the pipeline used on the command line, possibly with an example? I'm sorry if it is a basic question. But, I should tell here that, I'm not an expert in the gstreamer or QtMultimedia either.


  • Lifetime Qt Champion

    Didn't you cross-compile Qt 5 to run Qt on your device ?



  • @SGaist I have used i.MX6 Yocto build with fsl-image-qt5. The backend from the bitbake I used is x11 (windowing system). The extra packages which are required for QCamera is extracted from bitbaking qtmultimedia.
    In this case, AFAIK, QCamera is accesiing the Qt media service plugins such as libgstcamerabin.so, libgstmediacapture.so etc. for doing it's operation and these libraries are by default directing to the VPU channel. I think this is happening because IPU YUV raw data can not be display directly to Qt without encode/decode.

    There must be a gap between our understanding on how to change the backend in QtMultimedia, however I will see how I can do that.
    Thank you :)
    Ajith P V


  • Lifetime Qt Champion

    If you can tell Yocto where to take the sources for Qt, you could make it build your own copy where you can do modifications.



  • I have the same problem, did you resolve it?



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.