Important: Please read the Qt Code of Conduct -

How to transfer video from the camera received from QML to C++?

  • Hi!
    How to transfer video from the camera received from QML to C++?
    I need to make a video stream on Android.
    I connected the QtV library
    This my code:

    import QtQuick 2.12
    import QtQuick.Controls 2.12
    import QtMultimedia 5.12
    import QtAV 1.6

    //camera.captureMode = Camera.CaptureVideo

    Item {
    width: 400
    height: 700
    //property alias buttonPhoto: buttonPhoto
    //property alias photoImage: photoImage
    //property alias camera: camera

    Camera {
        id: camera
        objectName: "qrCameraQML"
        videoRecorder.mediaContainer: "mp4"
        imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
        exposure {
            exposureCompensation: -1.0
            exposureMode: Camera.ExposurePortrait
        flash.mode: Camera.FlashRedEyeReduction
        imageCapture {
            id: imageCapture1
            onImageCaptured: {
                photoPreview.source = preview  // Show the preview in an Image
            onImageSaved: {
    VideoOutput {
        id: videoOutput
        source: camera
        anchors.fill: parent
        focus : visible // to receive focus and capture key events when visible
        autoOrientation: true
        objectName: "myVideoOutput"
    Image {
        id: photoPreview


  • Lifetime Qt Champion


    Since you are using QtAV, you should content their author. This module is not an official Qt module.

  • The Itav module contains ffmpeg, maybe you know how to use it to do what I want?

Log in to reply