AVI file

How can I create an AVI file through of an OpenGL animation?

See answer in advanced forum.
Do not crosspost, please.