参考文章:http://blog.csdn.net/leixiaohua1020/article/details/11902195
MediaInfo 用来分析视频和音频文件的编码和内容信息,是一款是自由软件 (免费使用、免费获得源代码)。
可获取视频宽、高、编码等等信息。C++编写。
#include "MediaInfoDLL.h"
using namespace MediaInfoDLL;
void main()
{
MediaInfo MI;
String width,height,codec,all,format;
int iwidth,iheight;
MI.Open("test.avi");
width = MI.Get(stream_t::Stream_Video,0,"Width",Info_Text).c_str();
height = MI.Get(stream_t::Stream_Video,0,"Height").c_str();
format = MI.Get(stream_t::Stream_Video,0,"Format").c_str();
codec = MI.Get(stream_t::Stream_Video,0,"Codec").c_str();
all= MI.Inform().c_str();
iwidth = atoi(width.c_str());
iheight = atoi(height.c_str());
MI.Close();
}
工程下载地址:http://download.csdn.net/download/hbxmao/8423225