You can change the speed of the video by setting the "presentation time stamp" (PTS). In your case:
ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4 -vf "setpts=5*PTS" demo.avi
You will get a video that plays 5 times slower than a regular video.
If you want to do it 5 times faster:
ffmpeg -f image2 -i screenshot_%5d.png -vcodec mpeg4 -vf "setpts=(1/5)*PTS" demo.avi
source share