Mediainfo.dll changed?

Get help with using AutoHotkey and its commands and hotkeys
majstang
Posts: 89
Joined: 11 Feb 2018, 03:39

Mediainfo.dll changed?

07 Aug 2020, 08:40

The mediainfo.dll script does not work anymore. Dll call change maybe? Retrieving format (MediaInfo_Get) result in blank msgbox.
It applies to the latest mediainfo.dll v20.03 32-bit.

Code: Select all

affected_file := "F:\stuff\fails\HD.ts"

Mediainfo_location := "C:\Program Files (x86)\MediaInfo.dll"
DllCall( "LoadLibrary", Str, Mediainfo_location )
hnd := MediaInfo_New()
MediaInfo_Open( hnd, affected_file )
videoformat := MediaInfo_Get( hnd, 1,0, "Format", 1 )
msgbox % videoformat
MediaInfo_New() {
 Return DllCall( "mediainfo\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_New" )
}
MediaInfo_Open( hnd, MediaFile ) {
 Return DllCall( "mediainfo.dll\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Open", UInt,hnd
               , Str,MediaFile, UInt )
}
MediaInfo_Get( hnd, StrK=0, StrN=0, Comm="", InfK=0, Srch=0 ) {
 Return DllCall( "mediainfo.dll\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Get", UInt,hnd
               , Int,StrK, Int,StrN, Str,Comm, Int,InfK, Int,Sech, Str )
}
MediaInfo_Close( hnd ) {
 Return DllCall( "mediainfo\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Close", UInt,hnd )
}
teadrinker
Posts: 1807
Joined: 29 Mar 2015, 09:41
Contact:

Re: Mediainfo.dll changed?

07 Aug 2020, 11:46

What AHK version do you use?
majstang
Posts: 89
Joined: 11 Feb 2018, 03:39

Re: Mediainfo.dll changed?

07 Aug 2020, 12:38

AHK_H v.1.1.29.1 32bit Unicode
teadrinker
Posts: 1807
Joined: 29 Mar 2015, 09:41
Contact:

Re: Mediainfo.dll changed?

07 Aug 2020, 12:58

Try this:

Code: Select all

global Mediainfo := "C:\Program Files (x86)\MediaInfo.dll"

affected_file := "F:\stuff\fails\HD.ts"

DllCall( "LoadLibrary", Str, Mediainfo )
hnd := MediaInfo_New()
MediaInfo_Open( hnd, affected_file )
videoformat := MediaInfo_Get( hnd, 1,0, "Format", 1 )
msgbox % videoformat
MediaInfo_New() {
 Return DllCall(Mediainfo "\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_New" )
}
MediaInfo_Open( hnd, MediaFile ) {
 Return DllCall(Mediainfo "\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Open", UInt,hnd
               , Str,MediaFile, UInt )
}
MediaInfo_Get( hnd, StrK=0, StrN=0, Comm="", InfK=0, Srch=0 ) {
 Return DllCall(Mediainfo "\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Get", UInt,hnd
               , Int,StrK, Int,StrN, Str,Comm, Int,InfK, Int,Sech, Str )
}
MediaInfo_Close( hnd ) {
 Return DllCall(Mediainfo "\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Close", UInt,hnd )
}
majstang
Posts: 89
Joined: 11 Feb 2018, 03:39

Re: Mediainfo.dll changed?

07 Aug 2020, 13:53

Not working. Reverting back to an old mediainfo.dll from 2018 your code works, but not with newest mediainfo.dll.
teadrinker
Posts: 1807
Joined: 29 Mar 2015, 09:41
Contact:

Re: Mediainfo.dll changed?

07 Aug 2020, 14:19

I'll try it later. Anyway you can use an old dll.
teadrinker
Posts: 1807
Joined: 29 Mar 2015, 09:41
Contact:

Re: Mediainfo.dll changed?

07 Aug 2020, 20:03

Just installed latest version. For me the code above works as well as with the previous version for both 64 and 32 bit. Make sure that the next code does return something:

Code: Select all

global Mediainfo := "C:\Program Files (x86)\MediaInfo.dll"
MsgBox, % hnd := MediaInfo_New()

MediaInfo_New() {
 Return DllCall(Mediainfo "\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_New" )
}
majstang
Posts: 89
Joined: 11 Feb 2018, 03:39

Re: Mediainfo.dll changed?

09 Aug 2020, 05:46

Ok, thanks. Bad news. I have problems retrieving format for H.264 files with the old mediainfo.dll as well. The file properties system on my PC may be busted.
majstang
Posts: 89
Joined: 11 Feb 2018, 03:39

Re: Mediainfo.dll changed?

13 Aug 2020, 08:03

I did eventually found the problem. The H.264 files I was sending to mediainfo.dll had faulty SIDs and PMTs, messing up everything. The TV channels I was recording from changed those a while back rendering every file useless for mediainfo.dll. So no faulty mediainfo script.

Return to “Ask For Help”

Who is online

Users browsing this forum: Gushou, JoeWinograd, Lorik, mikeyww, TAC109 and 51 guests