Sometimes the functions avcodec_find_encoder_by_name or avcodec_find_decoder_by_name can't find the right codec while it exists and the OutputContainer class can find it!
I noticed the way the OutputContainer class find the codec and use the same approach for the Codec class.