title: Produce video from OpenGL C program
body: <p>I have a C program that runs a scientific simulation and displays a visualisation in an OpenGL window. I want to make this visualisation into a video, which will eventually go on YouTube.</p>
  
  <p><strong>Question:</strong> What's the best way to make a video from a C / OpenGL program?</p>
  
  <p>The way I've done it in the past is to use a screen capture program, but this is very labour-intensive (have to start/stop the screen capture program, save the video file, etc...). It seems like there should be a way to automate the process of making a video from within the C program. Then I can leave it running overnight and have 20 videos to look through in the morning, and choose the best one to put on YouTube.</p>
  
  <p>YouTube <a href="http://www.youtube.com/t/howto_makevideo">recommend</a> "MPEG4 (Divx, Xvid) format at 640x480 resolution".</p>
  
  <p>I'm using <a href="http://www.opengl.org/resources/libraries/glut/">GLUT</a> 3.7.6_3, if that makes a difference. I can change windowing system if there's a good reason.</p>
  
  <p>I'm running Windows (XP), so would prefer answers that work on Windows, but Linux answers are ok too. I can use Linux if it's not possible to do the video stuff easily on Windows. I have a friend who makes a .png image for each frame of the video and then stitches them together using "mencoder" on Linux. </p>