avcodec_find_encoder
/**
?* Find a registered encoder with a matching codec ID.
?*
?* @param id AVCodecID of the requested encoder
?* @return An encoder if one was found, NULL otherwise.
?*/
AVCodec *avcodec_find_encoder(enum AVCodecID id);
那么這個?AVCodecID 如果傳遞的是AV_CODEC_ID_AAC,
那么這個AAC具體是哪個呢?
通過? ?ffmpeg -codecs |findstr aac? 可以看到 結果如下
DEAIL. aac ? ? ? ? ? ? ? ? ?AAC (Advanced Audio Coding) (decoders: aac aac_fixed ) (encoders: aac aac_mf )
意思是如果是decoders:默認會使用第一個 aac
如果是encoders:默認也會使用第一個 aac
avcodec_find_encoder_by_name
那么如果我們想用第二個,
則需要使用??avcodec_find_encoder_by_name,傳遞的字符串是?aac_fixed
/**
?* Find a registered encoder with the specified name.
?*
?* @param name name of the requested encoder
?* @return An encoder if one was found, NULL otherwise.
?*/
AVCodec *avcodec_find_encoder_by_name(const char *name);