Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-15 Thread Elvis Stansvik
Den tors 15 juli 2021 kl 10:30 skrev Nuno Santos : > > Elvis, > > Using your quick example (attached as a project below) I’ve run some tests > and realised that window rendering it not happening at the same frame rate in > all machines and the maximum differs: > > - no more than 30 fps in on a 20

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-15 Thread Nuno Santos
Elvis, Using your quick example (attached as a project below) I’ve run some tests and realised that window rendering it not happening at the same frame rate in all machines and the maximum differs: - no more than 30 fps in on a 2017 iMac with Radeon graphics card - no more than 30 fps on 2019 I

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-14 Thread Nuno Santos
Elvis, Your sketch runs fine. Yesterday night I have been playing with calling glReadPixels directly rather than calling toImage from FBO object. Apparently, there wasn't much difference in the machine I was running this tests. I need to test on other machines. But I also realised that the be

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-14 Thread Elvis Stansvik
My idea would be something like (sketch): main.cpp: #include #include #include #include #include int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); auto view = new QQuickView; view->setSource(QUrl::fromLocalFile("test.qml")); view->show(); // I use a QVecto

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-14 Thread Nuno Santos
Andy, Thanks for your reply. Are you able to capture at 60fps at 1920x1080? Best, Nuno > On 14 Jul 2021, at 20:38, Andy wrote: > > Yet another "not sure if this applies, but..." > > Maybe take a look at what QRenderCapture is doing in Qt3D? It allows you to > capture a QImage per frame, so

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-14 Thread Nuno Santos
João, Thanks for the tip. Will search about it. Best, Nuno > On 14 Jul 2021, at 20:22, joao morgado via Interest > wrote: > > > Hello Nuno > > Not sure if it helps, but the book Anton's OpenGL 4 Tutorials has a chapter > about recording a video from OpenGL. It's the same approach you are

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-14 Thread Nuno Santos
David, The frames are not available forever. I’m using a double frame buffer object and one frame will only be available until the next one is ready. Then the frame buffer object is swapped. Adding concurrency to this problem might bring even more problems. It’s a guess, not sure. Thanks! B

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-14 Thread Andy
Yet another "not sure if this applies, but..." Maybe take a look at what QRenderCapture is doing in Qt3D? It allows you to capture a QImage per frame, so it might have some of the bit processing/manipulation you're looking for. I'm using it to capture video by saving images to a temp dir and then

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-14 Thread joao morgado via Interest
Hello Nuno Not sure if it helps, but the book Anton's OpenGL 4 Tutorials has a chapter about recording a video from OpenGL. It's the same approach you are doing, saving images from a frame buffer at certain fixed rate. I just dont know what kinf of optimisations are done, I didnt read it with

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-13 Thread Nuno Santos
Elvis, Thanks for sharing your thoughts. It makes sense. I need to dive into the toImage function, try to read directly the bytes from the FBO and see if that has any performance impact. Best regards, Nuno > On 13 Jul 2021, at 14:10, Elvis Stansvik wrote: > > Hi Nuno, > > I'm really out of

Re: [Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-13 Thread Elvis Stansvik
Hi Nuno, I'm really out of my waters here, but, provided you don't need to hold on to each AVFrame after you are "done with it", you could perhaps avoid having to allocate a QImage for each frame (which toImage forces you to do) by just allocating a a single AVFrame and a single memory buffer for

[Interest] Faster way of rendering QOpenGLFramebufferObject to image

2021-07-13 Thread Nuno Santos
Hi, I’m trying to capture the content of an FBO to a video file. This video file should contain the animations generated by a qml scene. To do this, I’m recurring to QOpenGLFramebufferObject class toImage() method. My scene is being drawn at 1920x1080. Each call to toImage takes 30 ms! :( If I