Gstramer error when second video recording attemp at qml camera

Hi,There is a part in the video recording application I made that does not work properly. I could not find the reason for this, after the first recorded video, while the second recording is being made, the application suddenly closes and gives an error as follows.

Hardware features

  • Rasberry Pi 3 B+
  • Buildroot 2020.02.9 version
  • Qt 5.15.2
  • Qt Creator 4.14.0

//MainPage
Item{

    id:pageMain
    width: root.width
    height: root.height
    visible: true

    x:0
    y:0
    z:0

    Camera{
        id: camera
        captureMode: Camera.CaptureVideo
        flash.mode: Camera.FlashOff

        videoRecorder{

            outputLocation: "/root"
            mediaContainer: "video/mpeg, mpegversion=(int)4"
            videoCodec: "video/mpeg, mpegversion=(int)4"
            //outputLocation: "file:///root/rec"+i+".mp4"
            resolution: "640x480"
            frameRate: 30


            muted: true

            onErrorStringChanged: {
                console.log(("Error: "+camera.videoRecorder.errorString))
            }

            onRecorderStatusChanged: {

                console.log("Status: "+camera.videoRecorder.recorderStatus)
            }

            onRecorderStateChanged: {

                console.log("State: "+camera.videoRecorder.recorderState)
            }

            onMediaContainerChanged: {
                console.log(camera.videoRecorder.mediaContainer)
                                }

            onActualLocationChanged:{
                console.log(camera.videoRecorder.actualLocation)
                                }
        }
    }

    VideoOutput{
        id: videoOutput
        source: camera
        anchors.fill: parent
        focus: visible
        fillMode: VideoOutput.Stretch
    }

    //CaptureButton
    Button{
        x:50
        y:390

        palette {
            button: "#00000000"
        }

        icon: {
           icon.source="qrc:/images/camera_icon.png"
           icon.width=100
           icon.height=100
        }

        onPressed: {
            camera.captureMode= Camera.CaptureStillImage
            icon.source = "qrc:/images/pause_icon.png"
            console.log("btnCaptureOn Click");
        }

        onReleased: {
            if( camera.cameraState !== Camera.ActiveState){
                camera.start()
            }

            camera.imageCapture.capture()

            icon.source = "qrc:/images/camera_icon.png"
            console.log("btnCaptureOff Click");
        }
    }

    //RecordButton
    Button{

        property bool stateToggle: false
        x:670
        y:390

        palette {
            button: "#00000000"
        }

        icon: {
           icon.source="qrc:/images/record_icon.png"
           icon.width=100
           icon.height=100
        }

        onClicked: {
            if(!stateToggle){

                /*if( camera.captureMode != Camera.CaptureVideo ){
                    camera.captureMode= Camera.CaptureVideo
                }

                if( camera.cameraState != Camera.ActiveState){
                    camera.start()
                    console.log("girdi toogle Start")
                }*/


                camera.start()
                camera.captureMode= Camera.CaptureVideo

                camera.videoRecorder.setMetadata("Date", new Date())
                camera.videoRecorder.setMetadata("Title", "hb"+i++)

                mTimer.start()

                icon.source = "qrc:/images/pause_icon.png"
                ceylanFile.ceylanLog("Record Start");

                stateToggle = true;
            }else{




                canera.videoRecorder.stop()
                camera.videoRecorder.setRecorderState(CameraRecorder.StoppedState)
                camera.stop()
                i++;
                //camera.videoRecorder.outputLocation= "file:///root/rec"+i+".mpeg"

                icon.source = "qrc:/images/record_icon.png"
                ceylanFile.ceylanLog("Record Stop");

                stateToggle = false;
            }
        }
    }

    //NextPageButton
    Button{
        x:10
        y:10

        palette {
            button: "#00000000"
        }

        icon: {
           icon.source="qrc:/images/file_icon.png"
           icon.width=68
           icon.height=53
        }

        onClicked: {
            pageSettings.visible=true
            pageMain.visible=false
            console.log("btnPageOpen Click");
        }
    }

    //BatteryIcon
    Image{
        id:batteryIcon
        width: 75
        height: 48
        x:710
        y:10
        source: "qrc:/images/battery_level_1.png"
    }

    Timer{
        id:mTimer
        running: false
        interval: 1000

        onTriggered: {

            camera.videoRecorder.record()

            console.log("geldi")
            mTimer.stop()
        }
    }
}

You’re getting illegal instruction error because your process receiving SIGILL being sent by the kernel.

It is a generic cpu trap mechanism for unsupported cpu instructions.

Probably your system being built by some compiler flags which produces cpu instructions that Pi B+ doesn’t have.

The problem was with Media Container, and it was resolved when I changed it.

videoCodec: “video/mpeg”
mediaContainer:“video/x-matroska”

Probably with your new config, selected encoding process doesn’t contain an unsupported cpu instruction for your platform.

1 Like