video out("video.avi","-w 12cm -h 8cm");
set::xrange(-10,10);
set::yrange(0,100);
for(double a=0; a<1; a += 0.01)
{
plot(_1,a*_1*_1);
out.print();
}
This script would produce a video with an increasing parabola. It is
adviced to fix the x/y-ranges, otherwise they are automatically
adjusted, and will jump from frame to frame in the video.
It uses ffmpeg to assemble the individual frames into a movie.
Generating a movie might take long, one needs to create several hundred or thousand frames. You may want to have a look at the result before the whole process ends. By default, the movie is (re-)generated after each 100 frames. To change this value, use the .autorefresh(int) member function.
Framerate: use the .fps(int) member function to set the frames-per-second.
Souce files: video.h video.cc