All I want to do is find out out the runtime of an media file like mp4 or mkv. I found some examples using the MediaInfo.dll and DLL calls but they all do not work as expected. I can´t extract any informations with the DLL call.
Code: Select all
PathToMediaInfoDLL := "Path\MediaInfo.dll"
PathToAVIFile := "SomeDir"
hModule := DllCall("LoadLibrary", "str", PathToMediaInfoDLL) ; Avoids the need for subsequent DllCalls to load the library
AB:=MediaInfo_DumpInfo(PathToAVIFile)
msgbox, % AB
MediaInfo_DumpInfo(MediaFile := "") {
Static A := A_IsUnicode ? "" : "A"
Static New := "MediaInfo.dll\MediaInfo" . A . "_New"
Static Open := "MediaInfo.dll\MediaInfo" . A . "_Open"
Static Inform := "MediaInfo.dll\MediaInfo" . A . "_Inform"
Static Delete := "MediaInfo.dll\MediaInfo" . A . "_Delete"
hnd := DllCall(New)
DllCall(Open, "UInt", hnd, "Str", MediaFile)
Info := DllCall(Inform, "UInt", hnd, "UInt", 0, "Str")
DllCall(Delete, "UInt", hnd)
Return Info
}