extracted yuv4mpeg from img.c (untested)