Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QtMultimedia 5.8 Does not record on Raspberry - Stretch
Forum Updated to NodeBB v4.3 + New Features

QtMultimedia 5.8 Does not record on Raspberry - Stretch

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
12 Posts 2 Posters 1.2k 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.
  • A Offline
    A Offline
    andy0206
    wrote on last edited by andy0206
    #1

    Hi Fellow Qt Devs,

    I've written an application on Raspberry Pi Stretch (Qt5.10.1) using Qt Quick (2.1) and QtMultimedia (5.8) to capture the camera. This all works great other than I get on start a console warning 'Unable to query the parameter info: "Invalid argument"' however, it still seems to work OK, i.e. it captures the camera.
    My issue is with trying to record.
    I get the follow errors upon calling the .videoRecorder.record() method:

    qml: CSI Device Recording...
    Detaching from process 2677
    AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory
    AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory
    AL lib: (EE) ALCcaptureAlsa_open: Could not open capture device 'default': No such file or directory
    CameraBin warning: "not negotiated"
    CameraBin warning: "Could not open temporary device."
    CameraBin error: "Could not open device."
    CameraBin error: "Internal data stream error."​

    A file is generated, but with zero bytes.

    I've seen a few variants of this problem posted on varying forums, some have suggested to not specify resolution string, and keep defaults however this did not help for me.

    So can any of you guys shed a light on what is happening?

    Here is my code:
    `` Camera {
    id: csi2Device;
    objectName: "csi2Device";
    deviceId: QtMultimedia.availableCameras[0] ? QtMultimedia.availableCameras[0].deviceId : 0;
    captureMode: Camera.CaptureVideo;
    //cameraState: Camera.StandbyStatus;
    videoRecorder {
    resolution: "640x480";
    frameRate: 30;
    videoCodec: "h264";
    mediaContainer: "mp4"
    outputLocation: "test.mp4";
    onRecorderStateChanged: {
    if (csi2Device.videoRecorder.recorderState == CameraRecorder.StartingStatus) {
    DataModel.IsRecording = true;
    console.log("saved to: " + csi2Device.videoRecorder.outputLocation)
    }
    else {
    DataModel.IsRecording = false;
    }
    }
    }
    }
    VideoOutput {
    id: viewfinder;
    x: 0;
    y: 0;
    width: parent.width;
    height: parent.height;
    source: csi2Device;
    fillMode: VideoOutput.Stretch
    autoOrientation: true;
    }
    code_text

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you have the GStreamer plugins packages installed ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andy0206
        wrote on last edited by
        #3

        Hi, Thanks for your reply. Yes gstreamer 1.0 is installed.

        a8b0f570-fc7e-4e83-897e-818d9fd57cdf-image.png

        dd126810-156a-425b-9793-3ae49bd8e782-image.png

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you do the recording from GStreamer directly successfully ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andy0206
            wrote on last edited by
            #5

            Hi Thanks, again for your rapid response.
            Yes I can using:

            gst-launch-1.0  --gst-debug-level=3   -v   v4l2src device=/dev/video0 ! capsfilter caps="video/x-raw, width=648,height=480,framerate=30/1" ! queue ! videoconvert ! videorate ! queue ! omxh264enc ! queue ! avimux ! filesink location = test_video.mp4
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Same user as when you run your Qt application ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 1 Reply Last reply
              0
              • SGaistS SGaist

                Same user as when you run your Qt application ?

                A Offline
                A Offline
                andy0206
                wrote on last edited by
                #7

                @SGaist yes

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Something is not clear, are you using Qt 5.8 or 5.10 ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andy0206
                    wrote on last edited by andy0206
                    #9

                    Hi,

                    So I'm using Qt 5.10.1
                    f5b7f94e-0b67-482f-8566-8ffc898b9309-image.png

                    With these imports in QML

                    import QtQuick 2.10
                    import QtMultimedia 5.8
                    import DataModelTypes 1.0
                    
                    

                    If I use import QtMultimedia 5.10, it builds, however it appears to not be installed on the Rpi qrc:/FPV.qml:2 module "QtMultimedia" version 5.10 is not installed, and thus the app crashes.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      The QML numbering might not reflect the Qt release you are using.

                      One thing that comes to mind is that the pipeline generated in the GStreamer backend does not handle the camera as well as the one you are using on the command line.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andy0206
                        wrote on last edited by
                        #11

                        Hmm, need to have a think on if I can do a work around. I need to be able to see the camera and record. Thanks for your help.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          One possible thing to do is rebuild the backend (and just the backend not the whole of Qt)

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          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