I did something similar (http://markolson.github.io/storyboard/) earlier this year using ffmpeg and ImageMagick to generate either GIFs around lines of dialog (like this project), or PDFs where each page is a frame of text or a new scene. Optimizing GIFs is by far the least enjoyable part.