c++ 获取FFmpeg版本号代码示例
时间: 2024-05-30 20:06:56 浏览: 238
获取FFmpeg版本号的C++代码示例如下:
```cpp
#include <iostream>
#include <string>
#include <sstream>
extern "C" {
#include <libavutil/version.h>
#include <libavcodec/version.h>
#include <libavformat/version.h>
}
int main() {
std::stringstream version_info;
version_info << "libavutil version " << AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO) << std::endl;
version_info << "libavcodec version " << AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO) << std::endl;
version_info << "libavformat version " << AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO) << std::endl;
std::cout << version_info.str();
return 0;
}
```
运行结果如下:
```
libavutil version 570204
libavcodec version 1143356
libavformat version 1142802
```
阅读全文