creating a lossless mp4 screencast
H.264 does support true lossless compression (see 'Lossless mode' on this page). It seems that to avoid chroma format conversion, you need to encode using the Hi444PP profile, which accepts RGB pixels. However, a cursory search indicates that x264 doesn't support Hi444PP (yet), whereas some commercial codecs like MainConcept do.