Video Simplicity Itself

I was extending some code to do video directly from OpenGL frames today. Implementation of write directly to jpeg format is very straight forward with the "jpeglib" and:

glReadPixels( originx,originy,width,height,GL_RGB,GL_UNSIGNED_BYTE,(GLvoid *)pixels);

The images are upside down as OpenGL measures addresses from the lower left corner and image files start from the upper left. I searched Google for a fix and while I was waiting for instant Google I realized the following:

if(videoRecord==1){glRotatef(180.0,0.0,0.0,1.0);}

After the flipped images are saved it is quite easy to generate a video. with "ffmpeg".

ffmpeg -sameq -i video%d.jpg Vid.avi

This makes it very easy to demonstrate many techniques and create video of how OpenGL effects appear in use. I have not looked into WebGL recently and it would seem that when it is fully implemented it could link two machines in very useful ways. An interesting OpenGL resource I found while doing this is the 16 Common mistakes in GL. I also realized that I could use "make -B" instead of "touch *.c;make"

0 comments:

Contributors

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen