[Interest] QML Camera: resulting image is rotated

Artem Sidyakin artem.sidyakin at qt.io
Tue Dec 11 04:47:54 CET 2018


As far as I know, it is impossible to tell in which position the camera is before you actually see its viewfinder in VideoOutput :)

In my case I had a camera upside-down, so 180 degree rotation. I managed it like this:

property bool cameraUpsideDown: true

Camera {
    id: camera
    metaData.orientation: cameraUpsideDown ? 180 : 0
    // ...
}

VideoOutput {
    orientation: cameraUpsideDown ? 180 : 0
    source: camera
    // ...
}

And then if you need to preview images made by this camera you can bind their orientation to EXIF values:

Image {
    autoTransform: true
    // ...
}

But I feel like I misunderstood your question.

---
Artem Sidyakin

> On 9 Dec 2018, at 23:53, Alexander Ivash <elderorb at gmail.com> wrote:
> 
> пн, 10 дек. 2018 г. в 12:33, René Hansen <renehh at gmail.com>:
> You can get the Camera orientation like so:
> 
> QCamera *cam = qvariant_cast<QCamera *>(m_filter->camera()->property("mediaObject"));
> QCameraInfo(*cam).orientation()
> 
> Then in case orientation is not % 180, you can rotate the image.
> 
> 
>  Is it the same as QML Camera's 'orientation' ? http://doc.qt.io/qt-5/qml-qtmultimedia-camera.html#orientation-prop
> Or this is actual orientation? Maybe you could share sample which 'unrotate' based on this property?
> 
> 
> _______________________________________________
> Interest mailing list
> Interest at lists.qt-project.org
> https://lists.qt-project.org/listinfo/interest



More information about the Interest mailing list