Forked from netavs2yuv.