Recording of Lectures: Tips for compressing video with mostly still images
H264 is actually a pretty good codec for such content. Its based on motion vectors and you can define in which intervals the codec should encode a full frame, everything in between will be based on the last and next keyframe (simplifying here).

x264 is probably the best h264 encoder out there and luckily open source. Probably the best way to use it is through ffmpeg (open source, cross-plattform).
Here is a good general guide for x264 and ffmpeg:
https://trac.ffmpeg.org/wiki/Encode/H.264
Especially take a look at the -tune option, it has a preset for still images, so perfect for you.

And this guide shows some of the advanced options like keyframes/GOPs.
https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping