Adjust brightness for qvideowidget inserted in QGraphicsscene and QGraphicsView

I play videos using Qgrpahicsscene, QgraphicsView, qvideowidget

videoWidget = new QVideoWidget; QGraphicsScene *scene = new QGraphicsScene; QGraphicsView *graphicsView = new QGraphicsView(scene); scene->addWidget(videoWidget); 

playing the video correctly, I need it when I adjust the brightness in the video call, it does not reflect, and I checked the brightness level of the video output that it sets. please share some ideas, thanks in advance

+4
source share
2 answers

You can achieve almost all kinds of effects and corrections using shaders, in particular, brightness is a very simple fragment shader, just multiply each pixel brightness by a real factor. With QML, you can even use shader effects, as well as an example of QML video effects.

Brightness / Contrast

All ready to use effects.

QML Video Effects Example

You can use shaders even with widgets if you go for the basic QGLWidget widget and still get great performance.

+1
source

Refresh the scene after changing the brightness. Like this:

 videoWidget->setBrightness(bright); scene->update(scene->sceneRect()); 
+3
source

Source: https://habr.com/ru/post/1481162/


All Articles