Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
nlazovic last edited by nlazovic
I am working on QML application that have single screen and outputs some images, videos, rectangles (QML Image MediaPlayer, Rectangle, ...)
Current hardware is Odroid XU4 / Asus Tinker board with QT 5.9, build from QT source. My app is working nice ("./app -platform eglfs").
Offscreen rendering is desired. My app does not need to emit to attached HDMI dispay, just to capture output. Hardware encoding should be for playing video.
Objective: need to be able to capture output screen into image files (in real time).
I did a research and found 2 possible ways
Option 1 using QT's minimal / minimalEGL platform plugins
- combination of QOpenGLPaintDevice / QPlatformBackingStore
- save image in QMinimalEglBackingStore::flush
Option 2 approach based on http://blog.qt.io/blog/2017/02/21/making-movies-qml/
- combination of QOpenGLFramebufferObject / QOffscreenSurface
- custom animation runner
- save QOpenGLFramebufferObject to image
I would appreciate help on few question below
- can offscreen surface be of any resolution (e.g. 3840 x 2160, of course limited by avail memory)
- any reason why in option #1, QPlatformBackingStore is not being invoked at all (when I run my app with "./app -platform minimalegl")
- any URL's to similar functionality ?
- any alternative / better suggestions to achieve objective above ?
Thanks in advance.
I used option#1 with QPA plugin mechanism to save the image. Not sure about memory resolution etc.