Call avcodec_set_dimensions() instead of simply setting avctx->width/height