playing .avi files

Is there anyway to render a video of in and .avi format either before. the models are drawn or drawn onto the face of a polygon?

First you have to make a function to read an AVI video stream into a bitmap, then use this bitmap as an OpenGL texture. Don’t forget to use a timer to respect the original avi playback speed.
For sound, you need to output the sound stream of your avi file to the wav device yourself too.