欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 社会 > 音视频开发31 FFmpeg 编码- avcodec_find_encoder和avcodec_find_encoder_by_name

音视频开发31 FFmpeg 编码- avcodec_find_encoder和avcodec_find_encoder_by_name

2025/9/23 19:09:53 来源:https://blog.csdn.net/hunandede/article/details/140027549  浏览:    关键词:音视频开发31 FFmpeg 编码- avcodec_find_encoder和avcodec_find_encoder_by_name

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);

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词