Video recording Not Supported by Camera in qml Why

2019-06-08 09:06发布

Video recording Not Supported by Camera in qml Why ? using laptop standard webcam to record video from camera it work fine with direcshow.net but not in qml

ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480

    menuBar: MenuBar {
        Menu {
            title: qsTr("File")
            MenuItem {
                text: qsTr("Record")
                onTriggered: camera.videoRecorder.record()
            }
            MenuItem {
                text: qsTr("stop")
                onTriggered: camera.videoRecorder.stop()
            }
            MenuItem {
                text: qsTr("test Avail")
                onTriggered: console.log(camera.videoRecorder.recorderStatus)

            }
        }
    }


    Camera
    {
       id:camera
       captureMode: Camera.CaptureVideo
       videoRecorder.audioSampleRate: 48000
       videoRecorder.audioBitRate: 96
       videoRecorder.audioChannels: 1
       videoRecorder.audioCodec: "audio/mpeg, mpegversion=(int)4"
       videoRecorder.outputLocation:""
       videoRecorder.frameRate: 30
       videoRecorder.videoCodec: "video/x-h264"
       videoRecorder.mediaContainer: "video/x-matroska"

       videoRecorder.onRecorderStateChanged: {
          if (camera.videoRecorder.recorderState == CameraRecorder.StartingStatus) {
              console.log("saved to: " + camera.videoRecorder.outputLocation)

          }

       }



    }

    VideoOutput
    {
        id:out
        source:camera


    }

}

when trying to check the recorderStatus it is 0 according to documentation .

Value Description

UnavailableStatus 0 Recording is not supported by the camera.

UnloadedStatus 1 The recorder is available but not loaded. . . .

is there something wrong with the code or qml recording support is limited ?

标签: qt qml
1条回答
相关推荐>>
2楼-- · 2019-06-08 09:36

According to Qt 5.5 documentation video recording is currently not supported for windows: http://doc.qt.io/qt-5/qtmultimedia-windows.html

查看更多
登录 后发表回答