procedure TfrmMain.FormCreate(Sender: TObject);
begin
...
MediaInfoDLL_Load('MediaInfo.dll');
...
end;
procedure TfrmMain.GetMediaInfo(FileName : String; var Runtime : Integer; var Bitrate : Double);
var
Handle: Cardinal;
iCpt : Integer;
Value : PWideChar;
iHelp : Integer;
str : String;
P : Integer;
begin
Handle := MediaInfo_New();
MediaInfo_Open(
Handle, PWideChar(FileName));
Value := MediaInfo_Get(
Handle, Stream_Video, 0, 'BitRate', Info_Text, Info_Name);
iHelp := StrToIntDef(Value, 0);
BitRate := iHelp / 1000000;
Value := MediaInfo_Get(
Handle, Stream_Video, 0, 'Duration', Info_Text, Info_Name);
str := Value;
P := Pos('.', str);
str := Copy(Value, 1, P-1);
iHelp := StrToIntDef(str, 0);
Runtime := iHelp div 60000;
MediaInfo_Close(
Handle);
end;