Use avcodec_find_best_pix_fmt2 (avcodec_find_best_pix_fmt deprecated in libav9)