Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Video not visible when using QtQuick3D
Forum Updated to NodeBB v4.3 + New Features

Video not visible when using QtQuick3D

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 208 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.
  • L Offline
    L Offline
    LeBeef
    wrote on last edited by
    #1

    Hello Folks,

    I have trouble using QtQuick3D and Video from QtMultimedia together. When I activate QtQuick3D the video is not visible anymore. I am using Pyside2 5.15.1 on Mac OS 10.14.6

    Does anyone know how to solve this problem? The problem occurs as soon as I set surface format on app start like:

    fmt = QSurfaceFormat()
    fmt.setDepthBufferSize(24)
    fmt.setSamples(4)
    fmt.setStencilBufferSize(8)
    fmt.setVersion(4, 3)
    fmt.setProfile(QSurfaceFormat.CoreProfile)
    QSurfaceFormat.setDefaultFormat(fmt)
    

    When I remove these lines, the video works fine, but then I can not use View3D anymore.

    L 1 Reply Last reply
    0
    • L LeBeef

      Hello Folks,

      I have trouble using QtQuick3D and Video from QtMultimedia together. When I activate QtQuick3D the video is not visible anymore. I am using Pyside2 5.15.1 on Mac OS 10.14.6

      Does anyone know how to solve this problem? The problem occurs as soon as I set surface format on app start like:

      fmt = QSurfaceFormat()
      fmt.setDepthBufferSize(24)
      fmt.setSamples(4)
      fmt.setStencilBufferSize(8)
      fmt.setVersion(4, 3)
      fmt.setProfile(QSurfaceFormat.CoreProfile)
      QSurfaceFormat.setDefaultFormat(fmt)
      

      When I remove these lines, the video works fine, but then I can not use View3D anymore.

      L Offline
      L Offline
      LeBeef
      wrote on last edited by
      #2

      Here is the missing qml part:

      import QtQuick 2.15
      import QtQuick3D 1.15
      import QtQuick3D.Helpers 1.15
      import QtMultimedia 5.15
      
      Item {
          id: root_component
          anchors.fill: parent
      
          Video {
              anchors.fill: parent
              source: "assets/01_Animation_PTB.mp4"
              Component.onCompleted: {
                  play()
              }
          }
      
          Item {
      //        anchors.fill: parent
              width: 300
              height: 200
      
              View3D {
                  id: view
                  anchors.fill: parent
      
                  environment: SceneEnvironment {
                      clearColor: "skyblue"
                      backgroundMode: SceneEnvironment.Color
                  }
      
                  PerspectiveCamera {
                      position: Qt.vector3d(0, 200, 300)
                      eulerRotation.x: -30
                  }
      
                  DirectionalLight {
                      eulerRotation.x: -30
                      eulerRotation.y: -70
                  }
      
                  Model {
                      position: Qt.vector3d(0, 150, 0)
                      source: "#Sphere"
      
                      materials: [
                          DefaultMaterial {
                              diffuseMap: Texture {
                                  sourceItem: tester
                              }
                          }
                      ]
      
                      SequentialAnimation on y {
                          loops: Animation.Infinite
                          NumberAnimation {
                              duration: 3000
                              to: -150
                              from: 150
                              easing.type:Easing.InQuad
                          }
                          NumberAnimation {
                              duration: 3000
                              to: 150
                              from: -150
                              easing.type:Easing.OutQuad
                          }
                      }
                  }
              }
          }
      }
      
      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