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. QMultimeida CameraRecorder not recording. (Erro: Failed to get the video control)
Forum Updated to NodeBB v4.3 + New Features

QMultimeida CameraRecorder not recording. (Erro: Failed to get the video control)

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 1.4k Views
  • 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.
  • F Offline
    F Offline
    Fortune
    wrote on last edited by SGaist
    #1

    Hi guys. I'm a beginner with qml and am already getting frustrated and discouraged. I'm having problems with getting my webcam to work with qml! Am not sure what am doing wrong but here is my code.

    import QtQuick 2.0
    import QtQuick.Controls 1.3
    import QtMultimedia 5.0
    
    Item {
        id:root
        Button{
            id:recordButton
            x: 0
            y: parent.height-height
            width: parent.width/2
            height: 80
            text:"Record"
            onClicked:{
                
                camera.videoRecorder.record();
                console.log(camera.videoRecorder.recorderStatus==CameraRecorder.UnavailableStatus)
                
            }
        }
        Button{
            id:stopButton
            x: parent.width/2
            y: parent.height-height
            width: parent.width/2
            height: 80
            text:"Stop"
            onClicked: {
                camera.videoRecorder.stop();
                console.log()
                console.log()
                
                console.log("output location: " +camera.videoRecorder.outputLocation)
                console.log("actual location: " +camera.videoRecorder.actualLocation)
            }
        }
        
        VideoOutput{
            id:preview
            width: parent.width
            height: parent.height-stopButton.height
            source:camera
            anchors.top:parent.top;
            anchors.right: parent.right
            anchors.left: parent.left
            anchors.bottom: stopButton.top
            Camera{
                id:camera
                videoRecorder.audioEncodingMode: CameraRecorder.ConstantBitRateEncoding
                videoRecorder.audioBitRate: 128000
                videoRecorder.mediaContainer: "mp4"
                videoRecorder {
                    resolution: "640x480"
                    frameRate: 30
                }
            }
        }
        
    }
    

    here is my application output windows

    When I click on "Record" I get this

    "QML debugging is enabled. Only use this in a safe environment.
    Failed to get the video control"

    and when I click on stop, I get this

    "qml:
    qml:
    qml: output location:
    qml: actual location: "

    Note that my webcam works fine. I use it many times to record videos of myself and I also use it for skype so it definitely not a hardware problem. Please help me

    [edit: Added missing coding tags ``` SGaist]

    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