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. Blank camera output in qml
Forum Updated to NodeBB v4.3 + New Features

Blank camera output in qml

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 229 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.
  • W Offline
    W Offline
    wiadro
    wrote on last edited by
    #1

    Hi, im getting no errors here but i dont see any output for the following simple code, the examples in Qt are very convoluted, so i cant really draw any understanding from them...

    import QtQuick
    import QtQuick.Window
    import QtMultimedia
    
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        MediaDevices {
            id: mediaDevices
        }
        CaptureSession {
            camera: Camera {
                cameraDevice: mediaDevices.defaultVideoInput
            }
        }
    
        Item {
    
            width: 640
            height: 360
    
            CaptureSession {
                camera: Camera {
                    id: camera
    
                    focusMode: Camera.FocusModeAutoNear
                    customFocusPoint: Qt.point(0.2, 0.2) // Focus relative to top-left corner
                }
                videoOutput: videoOutput
            }
    
            VideoOutput {
                id: videoOutput
                anchors.fill: parent
            }
        }
    
    
    }
    
    

    611d872a-5c63-445d-98a7-8d53b95534e3-image.png

    is there anything thats obviously missing?

    W 1 Reply Last reply
    0
    • W wiadro

      Hi, im getting no errors here but i dont see any output for the following simple code, the examples in Qt are very convoluted, so i cant really draw any understanding from them...

      import QtQuick
      import QtQuick.Window
      import QtMultimedia
      
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          MediaDevices {
              id: mediaDevices
          }
          CaptureSession {
              camera: Camera {
                  cameraDevice: mediaDevices.defaultVideoInput
              }
          }
      
          Item {
      
              width: 640
              height: 360
      
              CaptureSession {
                  camera: Camera {
                      id: camera
      
                      focusMode: Camera.FocusModeAutoNear
                      customFocusPoint: Qt.point(0.2, 0.2) // Focus relative to top-left corner
                  }
                  videoOutput: videoOutput
              }
      
              VideoOutput {
                  id: videoOutput
                  anchors.fill: parent
              }
          }
      
      
      }
      
      

      611d872a-5c63-445d-98a7-8d53b95534e3-image.png

      is there anything thats obviously missing?

      W Offline
      W Offline
      wiadro
      wrote on last edited by
      #2

      @wiadro this might have something to do with it? fa90dbaf-49df-476e-adb6-a5ac9c75c48f-image.png

      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