How to stream Piston graphics to disk

Hi,

I need to make a precise video capture of my OpenGL application developed using Piston::graphics.
I was wondering if there is any efficient way to save each frame in a image file (then I can merge all them together with ffmpeg).

Thank you