QCamera + QCameraViewfinder: how to mirror the the image displayed in the viewfinder?
-
Sorry, I meant start your application with QT_DEBUG_PLUGINS set to 1.
-
Is it an environment variable or a project define?
-
Environment variable that you can set in the Run part of the Project panel.
-
Here's the list. Can't see anything named WMF, but I guess I need to know the exact name to look for.
-
@Violet-Giraffe said:
Thanks, but still no.
rendererControl
is nullSame for Debian (and it's variants [Ubuntu, etc.])
-
Maby the way to do this for now...
(i.e. until the qt developers realize the value of extendingQCameraImageProcessing
orQCameraViewfinder
to allow mirroring (flipping) the image)...is to "derive from QAbstractVideoSurface" as shown here: http://doc.qt.io/qt-5/cameraoverview.html#viewfinder (find some example code there, showing rotation)
-
DSEngine -> DirectShow. The plugin it self has the control but it seems it's not accessible yet.
If you are wiling to re-build the plugin, that can be modified.
-
@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.