Forgot one item: 4. It seems like CODEC_FLAG2_LOCAL_HEADER is intended to move the SPS/PPS data to every keyframe, but so far I haven't been able to get it to stick when set. Does it not apply to h.264?