unsigned codecVer = avcodec_version(); printf("FFmpeg version is: %s, avcodec version is: %d\n.",FFMPEG_VERSION,codecVer); return0;//编译器要求必须有返回值
编译运行,输出为:
1 2
FFmpeg version is: 4.2.2, avcodec version is: 3815012. Press <RETURN> to close this window...
avcodec_version输出为十六进制数,我们解析一下.
1 2 3 4 5 6 7
unsigned codecVer = avcodec_version(); int ver_major,ver_minor,ver_micro; ver_major = (codecVer>>16)&0xff; ver_minor = (codecVer>>8)&0xff; ver_micro = (codecVer)&0xff; printf("Current ffmpeg version is: %s ,avcodec version is: %d=%d.%d.%d\n",FFMPEG_VERSION,codecVer,ver_major,ver_minor,ver_micro); return0;
输出为:
1 2
Current ffmpeg version is: 4.2.2 ,avcodec version is: 3815012=58.54.100 Press <RETURN> to close this window...