Targa Playback

I have figured out how to read from the frame buffer and write to a targa file, but now I need code to playback these files as an animation. My ultimate goal is to be able to create a playback tool and get the OpenGL format into a .gif, .tga, .avi…I need to input a series of previously recorded frames and play them back in a continuous manner. If this exists, can anyone tell me where to find it or provide me with code to achieve this?