mjpeg is a good codec for gem, of course if you have hd space (like a lot of it) you can use a raw codec. as for the tools, there's ffmpeg or transcode:
transcode -i yourvideo.whateversupportbytranscode -y ffmpeg,null -F mjpeg -o 4gem.avi
ffmpeg -i yourvideo.whateversupportbytranscode -an -vcodec mjpeg -sameq 4gem.avi