Encoding JOGL animation into a video file format on Linux

I am using the HDR.jnlp from jogl-demos to display my model. I would like to capture
the window output into a file (MPEG or other format viewable on Linux). I am on Linux,
but certainly Windows is possible. What options are there? Is there some property
I can set?

John

Howdy

As far as I can tell, the easiest way to do this to simply take a load of screenshots and then encode them using other tools.

This thread has a code snippet that will take a screenshot extremely quickly, you can then use “mogrify -format ppm *.tga” to convert the resultant targa images to the format used by “ppmtompeg”.

and hey presto, an mpeg file!

You can use glReadPixels() to get just the pixels in the GLCanvas
and use ImageIO.write(…) to save it to a PNG.

Indeed you can. However, using ImageIO is vastly slower than the code given in the linked thread. Using ImageIO, i was getting pauses of around a second for every snapshot, with the faster code, there is no appreciable delay. The only downside is that the resultant images are uncompressed, and so it can fill up a lot of disk space extremely quickly.

try using devil and saving to some semi uncompressed format

The reason it’s so fast though is precisely because it’s uncompressed. It simply writes the file header and dumps the framebuffer. This, apparently, means that the work can be offloaded onto the DMA, leaving the CPU unmolested. Performing even quick compression would probably negate this benefit.
At any rate, disk space is cheap and plentiful, and it’s only an intermediate step on the road to an mpeg file.

Bear in mind though, I’ve never used devil, and so could reliably be said to be talking out of my arse.