Login  Register

Re: write/convert JOGL animation to .mov or .wmv or ogg

Posted by Sven Gothel on Mar 04, 2012; 7:22pm
URL: https://forum.jogamp.org/write-convert-JOGL-animation-to-mov-or-wmv-or-ogg-tp3798456p3798759.html

On 03/04/2012 08:00 PM, Demoscene Passivist [via jogamp] wrote:

>
>
> U can use the utility class com.jogamp.opengl.util.awt.Screenshot. With the
> method Screenshot.readToBufferedImage() u can read the rendered image back
> from the GPU and convert it to a BufferedImage.
>
> Stg like this:
>
>
> The BufferedImage can then be easily writte to a PNG:
>
If I may advertise the AWT free utility GLReadBufferUtil here :
  <http://jogamp.org/git/?p=jogl.git;a=blob;f=src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java;hb=HEAD#l55>
Test Case:
  <http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/util/TestGLReadBufferUtilTextureIOWrite02NEWT.java;hb=HEAD#l65>

It's tested on ES2 w/o AWT (tga snapshots).

~Sven

>
> Do that for every frame and u get an image-sequence. Name them
> "image_0000.png"-"image_1000.png". The images can then be easily converted
> with ffmpeg or mencoder.
>
> U may take a look at  https://github.com/demoscenepassivist/SocialCoding my
> repository  for
> https://github.com/demoscenepassivist/SocialCoding/tree/master/build_demos_jogamp
> a couple of batch scripts  that do the conversion.


signature.asc (910 bytes) Download Attachment