Поскольку вы запросили форматы libav *, я предполагаю, что вы ищете пример кода.
Чтобы получить список всех кодеков, используйте API av_codec_next для просмотра списка доступных кодеков.
/* initialize libavcodec, and register all codecs and formats */
av_register_all();
/* Enumerate the codecs*/
AVCodec * codec = av_codec_next(NULL);
while(codec != NULL)
{
fprintf(stderr, "%s\n", codec->long_name);
codec = av_codec_next(codec);
}
Чтобы получить список форматов, используйте av_format_next таким же образом:
AVOutputFormat * oformat = av_oformat_next(NULL);
while(oformat != NULL)
{
fprintf(stderr, "%s\n", oformat->long_name);
oformat = av_oformat_next(oformat);
}
Если вы также хотите узнать рекомендуемые кодеки для определенного формата, вы можете повторить список тегов кодеков:
AVOutputFormat * oformat = av_oformat_next(NULL);
while(oformat != NULL)
{
fprintf(stderr, "%s\n", oformat->long_name);
if (oformat->codec_tag != NULL)
{
int i = 0;
CodecID cid = CODEC_ID_MPEG1VIDEO;
while (cid != CODEC_ID_NONE)
{
cid = av_codec_get_id(oformat->codec_tag, i++);
fprintf(stderr, " %d\n", cid);
}
}
oformat = av_oformat_next(oformat);
}