cleanup. Manually write SPS and PPS for first video keyframe as well. optimize encodeVideoFrame a bit