2016-06-13 12 views
0

Qt/QMLでカメラオブジェクトによってキャプチャされたフレームにいくつかのオーバーレイを描画しようとしています。私は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; 
} 
関連する問題