FFmpeg fourcc Avi codec support list?

2020-02-23 11:06发布

A couple of similar questions are on stackoverflow, but I haven't been able to figure this exact problem out.

I want to get a list of the fourccs for the avi codecs that FFMpeg can decode.

I know how to get all the formats ffmpeg -formats and codecs ffmpeg -codecs but neither list gives me an accessible list of fourccs. Neither does the documentation I can find.

I need this list, so that my application can access the fourcc of an avi file and determine whether to use ffmpeg or VfW (or DirectX) to try decode the file.

Is there some ffmpeg command that can give me this list?

标签: ffmpeg codec avi
3条回答
冷血范
2楼-- · 2020-02-23 11:12

It is possible to the mapping via avformat api, without digging in the source code.

 uint32_t tag = MKTAG('H', '2', '6', '4');
 const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 };
 enum AVCodecID vcodec = av_codec_get_id(table, tag );

The functions avformat_get_riff_video_tags, avformat_get_riff_audio_tags and av_codec_get_id are all defined in "libavformat/avformat.h".

you can also get the mapping for a specific format using the table AVOutputFormat.codec_tag or AVInputFormat.codec_tag

查看更多
Juvenile、少年°
3楼-- · 2020-02-23 11:21

I don't know if it's comprehensive but the source code seems to contain a list of FourCCs.

Look at http://ffmpeg.org/doxygen/trunk/isom_8c-source.html

There are lots of lines like this

{ CODEC_ID_AAC,             MKTAG('m', 'p', '4', 'a') }

You should be able to download the latest source and write a script to pick them out.

查看更多
smile是对你的礼貌
4楼-- · 2020-02-23 11:22

To extend the answer given above by Darren (and because the comment facility doesn't allow this much text) here is the full list of codecs parsed from the isom_8c-source file on ffmpeg.org:

raw     yuv2    2vuy    yuvs    L555    L565    B565    24BG
BGRA    RGBA    ABGR    b16g    b48r    bxbg    bxrg    bxyv
NO16    DVOO    R420    R411    R10k    R10g    r210    AVUI
AVrp    SUDS    v210    bxy2    v308    v408    v410    Y41P
yuv4    jpeg    mjpa    AVDJ    AVRn    dmb1    mjpb    SVQ1
svq1    svqi    SVQ3    mp4v    DIVX    XVID    3IV2    h263
s263    dvcp    dvc     dvpp    dv5p    dv5n    AVdv    AVd1
dvhq    dvhp    dvh1    dvh2    dvh4    dvh5    dvh6    dvh3
VP31    rpza    cvid    8BPS    smc     rle     WRLE    qdrw
WRAW    avc1    ai5p    ai5q    ai52    ai53    ai55    ai56
ai1p    ai1q    ai12    ai13    ai15    ai16    m1v1    mpeg
m1v     m2v1    hdv1    hdv2    hdv3    hdv4    hdv5    hdv6
hdv7    hdv8    hdv9    hdva    mx5n    mx5p    mx4n    mx4p
mx3n    mx3p    xd54    xd55    xd59    xd5a    xd5b    xd5c
xd5d    xd5e    xd5f    xdv1    xdv2    xdv3    xdv4    xdv5
xdv6    xdv7    xdv8    xdv9    xdva    xdvb    xdvc    xdvd
xdve    xdvf    xdhd    xdh2    AVmp    mjp2    tga     tiff
gif     png     MNG     vc-1    avs2    drac    AVdn    H263
3IVD    AV1x    AVup    sgi     dpx     exr     apch    apcn
查看更多
登录 后发表回答