Closed THMonster closed 6 years ago
I have solved this issue, just use:
mpv::qt::set_option_variant(mpv, "display-fps", "60");
mpv::qt::set_option_variant(mpv, "video-sync", "display-resample");
It's not really clear what you want. The normal way to update the screen is by responding to the opengl-cb update callback. Without display-sync it will update whenever a new video frame needs to be shown, with display-sync it will request a redraw immediately (unless the video is paused).
@wm4 Because I want to draw some animation over every frames. If it doesn't update at 60 fps, animation won't be enough smooth.
In the example codes, the QOpenGLWidget updates at the same frequency as video's FPS.
When I use a QTImer to update it at fixed 60 FPS, the QOpenGLWidget also updates at the same frequency as the video's FPS. But after I paused the video, it works at 60 FPS. I'm really puzzled by this phenomenon. How can I update the QOpenGLWidget at a fixed 60FPS?