h264 & mpeg2 encode frame by frame code