2016-06-13 1 views
0

Qt/QML에서 카메라 objet로 캡처 한 프레임에 일부 오버레이를 그리려합니다. I는 camera.videorecorder.record()를 호출 할 때 지금, 카메라의 기록을 시작하고, 현재 프레임이 비디오 출력 캔버스에 표시카메라 비디오에 QML 오버레이

Camera { 
    id: camera 
    captureMode: Camera.CaptureVideo 
} 
VideoOutput { 
    source: camera 
    focus : visible 
    anchors.fill: parent 
} 

: 같이 카메라 자체가 정의된다. 자, 프레임에서 임의의 위치에 직사각형을 그립니다.

일부 셰이더 효과 예제 (http://doc.qt.io/qt-5/qtmultimedia-multimedia-video-qmlvideofx-example.html)가 있지만 실제로 원하는대로 복잡해 보입니다. GLSL에 정통하지 않았습니다.

답변

3

이와 비슷한?

Camera { 
    id: camera 
    captureMode: Camera.CaptureVideo 
} 

VideoOutput { 
    source: camera 
    focus : visible 
    anchors.fill: parent 
    Rectangle { 
      color: "red"; 
      width: parent.width/2; 
      height: parent.height/2; 
      anchors.centerIn: parent; 
    } 
} 

편집 :는 이 너무 작동합니다

Camera { 
    id: camera 
    captureMode: Camera.CaptureVideo 
} 
VideoOutput { 
    source: camera 
    focus : visible 
    anchors.fill: parent 
} 
Rectangle { 
     color: "red"; 
     width: parent.width/2; 
     height: parent.height/2; 
     anchors.centerIn: parent; 
} 
관련 문제