https://mediaarea.net/en/MediaInfo
// mediainfotest.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <string>
#include <iostream>
#include "../include/MediaInfoDLL.h"
using namespace MediaInfoDLL;
int main()
{
//MediaInfo MI;
//MI.Open(L"F:\\imagemagick\\test\\curry.mp4");
获取所有信息
//std::wstring all;
//MI.Option(L"Complete");
//all = MI.Inform().c_str();
//std::wstring width, height;
//width = MI.Get(stream_t::Stream_Video, 0, L"Width").c_str();
//height = MI.Get(stream_t::Stream_Video, 0, L"Height").c_str();
//std::wcout << L"width=" << width << L",height=" << height << std::endl;
//MI.Close();
//std::wcout << all << std::endl;
// 遍历Video所有可有参数
//如果要遍历Audio的参数,StreamKind.Video换成StreamKind.Audio即可,General同理。
std::wstring parameter = L"";//存放所有参数
std::wstring tempstr;
int i = 0;
MediaInfo MI;
MI.Open(L"F:\\imagemagick\\test\\curry.mp4");
while (true)
{
tempstr = MI.Get(stream_t::Stream_Audio, 0, i++, Info_Name);
if (tempstr == L"")
{
break;
}
std::wstring str = MI.Get(stream_t::Stream_Audio, 0, tempstr).c_str();
parameter += L"\r\n" + tempstr + L":"+str;
}
std::wcout << parameter << std::endl;
MI.Close();
return 0;
}