I'm trying to program with ffmpeg for the first time, on Ubuntu. The nonclemature seems a bit messy but that's the same as libavformat, libavcodec, right?
I can compile and run a program which calls avformat_open_input
on an mp3 file, apparently successfully, and now I am trying to get some information out of it.
For a start I want to call avcodec_get_name on the audio_codec_id
member of AVFormatContext but no function of that name appears in any headers in /usr/include/libav{codec,format,util}.
I checked out the latest ffmpeg from GitHub and diffed avcodec.h against my installed version. The files are clearly much the same but, among other differences, avcodec_get_name(AVCodecID)
has been replaced with avcodec_get_class(void)
although there doesn't seem to be any correspondence between the two.
Confusingly, this documentation omits avcodec_get_class while this documentation omits avcodec_get_name. Looking at the urls, the former ought to be the latest version, corresponding to what I checked out of GitHub and the latter ought to be outdated, but the reverse seems to be true.
Can someone please tell me
- what API documentation should I be using for a) the ubuntu libraries and b) the GitHub latest?
- if I build against the latest source, will I have to statically link in order to distribute it?
- if I want to dynamically link and build against the provided Ubuntu headers, how do I get the name of a codec given its enum, if avocodec_get_name isn't available?