You gotta create a dictionary and then use this dictionary with all the parameters you need when opening the codec!
AVDictionary * codec_options( 0 );
av_dict_set( &codec_options, "preset", "veryfast", 0 );
// av_dict_set( &codec_options, "AnyCodecParameter", "Value", 0 );
avcodec_open2( codecContext, videoCodec, &codec_options );