compatible with FFmpeg>=1.1, libav>=9.7

TODO: av_pix_fmt_count_planes breaks the compatibility now