Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Camera fails is object is created dynamically
Forum Updated to NodeBB v4.3 + New Features

Camera fails is object is created dynamically

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 862 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rahul3349
    wrote on last edited by rahul3349
    #1

    I'm trying to create Camera, VideoOutPut objects dynamically in QML, but getting error from gstreamer and not able to start camera preview.

    Code:

    function createPreviewObjects(parent, cameraId) {
        cam_component = Qt.createComponent("Camera.qml");
        camera = cam_component.createObject(cameraUI);
        if (camera == null) {
            // Error Handling
            console.log("Error creating video camera object");
            return;
        }
        camera.deviceId = cameraId;
        console.log("Camera component is created "+cameraId);
    
    
        preview_component = Qt.createComponent("Preview.qml");
        preview = preview_component.createObject(cameraUI);
        if (preview == null) {
            // Error Handling
            console.log("Error creating video preview object");
            return;
        }
    
        preview.width = parent.width;
        preview.height = parent.height;
        preview.x = 0;
        preview.y = 0;
        preview.source = camera;
        console.log("Preview component is created: "+camera);
    
    

    Logs:

    GstElement* CameraBinSession::buildCameraSource()
    GstElement* CameraBinSession::buildCameraSource()
    GstElement* CameraBinSession::buildCameraSource()
    set camera device "/dev/video1"
    GstElement* CameraBinSession::buildCameraSource()
    GstElement* CameraBinSession::buildCameraSource()
    GstElement* CameraBinSession::buildCameraSource()
    virtual void CameraBinControl::setState(QCamera::State) ActiveState
    void CamerabinResourcePolicy::setResourceSet(CamerabinResourcePolicy::ResourceSet) 2
    void CameraBinSession::setState(QCamera::State) QCamera::ActiveState
    GstElement* CameraBinSession::buildCameraSource()
    bool CameraBinSession::setupCameraBin() Viewfinder changed, reconfigure.
    Starting camera without viewfinder available
    GstElement* CameraBinSession::buildCameraSource()
    qml: Camera component is created /dev/video1
    CameraBinControl: reload pipeline requested ActiveState
    void CameraBinSession::setState(QCamera::State) QCamera::LoadedState
    CameraBinControl: reload pipeline requested ActiveState
    CameraBinControl: reload pipeline requested ActiveState
    qml: Preview component is created: QDeclarativeCamera(0x569ad0)
    process 2392: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/etc/machine-id": No such file or directory
    See the manual page for dbus-uuidgen to correct this issue.
    CameraBinControl: reload pipeline
    void CameraBinSession::setState(QCamera::State) QCamera::ActiveState
    GstElement* CameraBinSession::buildCameraSource()
    bool CameraBinSession::setupCameraBin() Viewfinder changed, reconfigure.

    (declarative-camera:2392): GStreamer-CRITICAL **: gst_element_link_pads_full: assertion 'GST_IS_ELEMENT (src)' failed
    *
    (declarative-camera:2392): GStreamer-CRITICAL *: gst_object_unref: assertion 'object != NULL' failed
    CameraBin error: "GStreamer error: negotiation problem."

    install jpeg buffer probe
    install metadata probe
    install uncompressed buffer probe
    "Camera bin: state changed: old: GST_STATE_NULL new: GST_STATE_READY pending: GST_STATE_VOID_PENDING"
    "Camera bin: state changed: old: GST_STATE_READY new: GST_STATE_PAUSED pending: GST_STATE_PLAYING"
    CameraBin error: "Internal data flow error."
    CameraBin error: "Internal data flow error."

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved