Add version checks around uses of AVCodecID and av_opt_set, since these aren't defined for older versions of ffmpeg.