Allow encoding with libx264 via ffmpeg to work

Add a call to avcodec_get_context_defaults3, this sets per-codec default values
and in the case of libx264 will stop VideoWriter::open (with fourcc=x264) from
failing due to libx264 complaining about broken ffmpeg default settings.

Set some additional libx264 encoder parameters.