QCamera + QCameraViewfinder: how to mirror the the image displayed in the viewfinder?
-
@Devopia53, how can I connect those to
QCamera
if the only thing camera accepts isQCameraViewfinder
?
P. S. Nvm, it acceptsQVideoWidget
. Still not quite sure how to connect the parts you've listed. A little help, please? :) -
@Violet-Giraffe
QCameraViewfinder is not a solution for flipping. Instead, use the QAbstractVideoSurface. But it is poor display performance.Samples on how to use the QGraphicsView are as follows: I wish you a note.
auto camera = new QCamera;
auto widget = new QVideoWidget;
QTransform matrix(-1,0,0,0,1,0,0,0,1); // m11=-1 : flipping horizontalgraphicsView->setScene(new QGraphicsScene);
graphicsView->show();auto proxyWidget = graphicsView->scene()->addWidget(widget);
proxyWidget->setTransform(matrix);
camera->setViewfinder(widget);
camera->start(); -
@Devopia53, thanks, but I think you're missing something.
proxyWidget
is not used here. AndQTransform
has no effect on thewidget
, although I do see the image just as I did withQCameraViewfinder
. -
Any further ideas? I'm stuck here.
-
D3D11CreateDevice: Flags (0x2) were specified which require the D3D11 SDK Layers for Windows 10, but they are not present on the system.
These flags must be removed, or the Windows 10 SDK must be installed.
Flags include: D3D11_CREATE_DEVICE_DEBUGHave you tried installing the DX11 SDK?
-
I have not. Frankly, I doubt this message is related to my task/problem.
-
You don't have to rebuild all of Qt just to modify one module. But the solution I have in mind might not be an optimal use of the API.
-
@Violet-Giraffe Hi Violet-Giraffe, I've just bought 3 USB wide angle cameras for my van - I was looking at writing an app to display reversing cameras - did you solve the mirroring issue ?
-
I've encountered the same necessity - to mirror the video output of the camera.
I found a solution which involves a custom wrapper:
class VideoWrapper : public QAbstractVideoSurface
Then you'll be able to control
QVideoSurfaceFormat
and perform setMirrored in its start method.