一.导入相关项
#include "MediaInfoDLL.h"
using namespace MediaInfoDLL;
void CTestMediaInfoDlg::OnButton1()
{
// TODO: Add your control notification handler code here
// CString
String m_strFileName="D:\\FTPDir\\SECOND\\77VY0432.mpg";
MediaInfo MI;
MI.Open(m_strFileName);
OutputDebugString("MI.Open(m_strFileName);");
String strInfo= MI.Get(Stream_General, 0, __T("Duration/String3"), Info_Text, Info_Name).c_str();
CString strTest=strInfo.c_str();
int second=GetSecond(strTest);
}
int CTestMediaInfoDlg::GetSecond(CString strTime)
{
int result=0;
int Hour, minute,second;
//strTime=strTime.Left(strTime.ReverseFind('.'));
Hour=atoi(strTime.Left(strTime.Find(':')).GetBuffer(0));
strTime=strTime.Right(strTime.GetLength()-strTime.Find(':')-1);
minute=atoi(strTime.Left(strTime.Find(':')).GetBuffer(0));
strTime=strTime.Right(strTime.GetLength()-strTime.Find(':')-1);
second=atoi(strTime.GetBuffer(0));
result=Hour*3600+minute*60+second;
return result;
}