Simplify iT Posted June 5, 2009 Share Posted June 5, 2009 Hi All, I am having some problems with DllCall - specifically using mediainfo.dll. I have read the information with mediainfo.dll and also the info on dllcall - but for the life of me i can't understand it.... I simply want to make a call to mediainfo.dll and retrieve the Video codec information only. Can someone please help? The code below is what comes with the mediainfo.dll and this is the autoit example... expandcollapse popup;Loading the DLL $DLL=DllOpen("MediaInfo.dll") ;Info $Info_Parameters=DllCall($DLL, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Info_Parameters", "wstr", "") MsgBox(0, "MediaInfo_Option - Info_Parameters", $Info_Parameters[0]) $Info_Capacities=DllCall($DLL, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Info_Capacities", "wstr", "") MsgBox(0, "MediaInfo_Option - Info_Capacities", $Info_Capacities[0]) $Info_Codecs=DllCall($DLL, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Info_Codecs", "wstr", "") MsgBox(0, "MediaInfo_Option - Info_Codecs", $Info_Codecs[0]) ;New MediaInfo handle $Handle=DllCall($DLL, "ptr", "MediaInfo_New") ;Open $Open_Result=DllCall($DLL, "int", "MediaInfo_Open", "ptr", $Handle[0], "wstr", "Example.ogg") ;Inform with Complete=false DllCall($DLL, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Complete", "wstr", "") $Inform=DllCall($DLL, "wstr", "MediaInfo_Inform", "ptr", $Handle[0], "int", 0) MsgBox(0, "Inform with Complete=false", $Inform[0]) ;Inform with Complete=true DllCall($DLL, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Complete", "wstr", "1") $Inform=DllCall($DLL, "wstr", "MediaInfo_Inform", "ptr", $Handle[0], "int", 0) MsgBox(0, "Inform with Complete=true", $Inform[0]) ;Custom Inform DllCall($DLL, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Inform", "wstr", "General;Example : FileSize=%FileSize%") $Inform=DllCall($DLL, "wstr", "MediaInfo_Inform", "ptr", $Handle[0], "int", 0) MsgBox(0, "Custom Inform", $Inform[0]) ;Get with Stream=General and Parameter=FileSize $Info_Get=DllCall($DLL, "wstr", "MediaInfo_Get", "ptr", $Handle[0], "int", 0, "int", 0, "wstr", "FileSize", "int", 1, "int", 0) MsgBox(0, "Get with Stream=General and Parameter=FileSize", $Info_Get[0]) ;GetI with Stream=General and Parameter=46 $Info_GetI=DllCall($DLL, "wstr", "MediaInfo_GetI", "ptr", $Handle[0], "int", 0, "int", 0, "int", 46, "int", 1, "int", 0) MsgBox(0, "Get with Stream=General and Parameter=46", $Info_GetI[0]) ;Count_Get with StreamKind=Stream_Audio $Count_Get=DllCall($DLL, "int", "MediaInfo_Count_Get", "ptr", $Handle[0], "int", 2, "int", 0) MsgBox(0, "Count_Get with StreamKind=Stream_Audio", $Count_Get[0]) ;Get with Stream=General and Parameter=AudioCount $Info_Get=DllCall($DLL, "wstr", "MediaInfo_Get", "ptr", $Handle[0], "int", 0, "int", 0, "wstr", "AudioCount", "int", 1, "int", 0) MsgBox(0, "Get with Stream=General and Parameter=AudioCount", $Info_Get[0]) ;Get with Stream=Audio and Parameter=StreamCount $Info_Get=DllCall($DLL, "wstr", "MediaInfo_Get", "ptr", $Handle[0], "int", 2, "int", 0, "wstr", "StreamCount", "int", 1, "int", 0) MsgBox(0, "Get with Stream=Audio and Parameter=StreamCount", $Info_Get[0]) ;Delete MediaInfo handle $Handle=DllCall($DLL, "none", "MediaInfo_Delete", "ptr", $Handle[0]) ;Close the DLL DllClose($dll) all help appreciated! Link to comment Share on other sites More sharing options...
trancexx Posted June 5, 2009 Share Posted June 5, 2009 Wht comes with mediainfo.dll? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Simplify iT Posted June 5, 2009 Author Share Posted June 5, 2009 http://mediainfo.sourceforge.net/en/Download/Windows Link to comment Share on other sites More sharing options...
trancexx Posted June 5, 2009 Share Posted June 5, 2009 Can you just post part of the documentation that describes how to call these functions? Or we'll wait for someone to do it for you. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
ProgAndy Posted June 5, 2009 Share Posted June 5, 2009 (edited) Found it here (doxygen of the headerfile, only needed up to line 247) Edited June 5, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
trancexx Posted June 5, 2009 Share Posted June 5, 2009 ...ProgAndy will. @Simplify iT, try this: expandcollapse popup$hDLL = DllOpen("MediaInfo.dll") ; New MediaInfo handle $aMediaInfo = DllCall($hDLL, "ptr", "MediaInfo_New") $hMediaInfo = $aMediaInfo[0] ; Open DllCall($hDLL, "dword", "MediaInfo_Open", _ "ptr", $hMediaInfo, _ ; Handle "wstr", "FullPathToSomeVideoFile.avi.mpeg.whatever") ; Full path ; MediaInfo $aMediaInfoGet = DllCall($hDLL, "wstr", "MediaInfo_Get", _ "ptr", $hMediaInfo, _ ; Handle "int", 0, _ ; StreamKind "int", 0, _ ; StreamNumber "wstr", "Video_Format_List", _ ; Video Codecs in this file, separated by / "int", 1, _ ; KindOfInfo "int", 0) ; KindOfSearch $sMediaInfo = $aMediaInfoGet[0] ConsoleWrite("Video Codecs in this file, separated by / : " & $sMediaInfo & @CRLF) ; General MediaInfo $aMediaInfoInform = DllCall($hDLL, "wstr", "MediaInfo_Inform", _ "ptr", $hMediaInfo, _ ; Handle "int", 0) ; Options $sMediaInfoInform = $aMediaInfoInform[0] ConsoleWrite($sMediaInfoInform & @CRLF) DllCall($hDLL, "none", "MediaInfo_Close", "ptr", $hMediaInfo) DllClose($hDLL) JoeBar 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Simplify iT Posted June 6, 2009 Author Share Posted June 6, 2009 Hi with this script (and a couple of changes) if get this output - i am just looking to get the video codec only (video codecID) expandcollapse popup$hDLL = DllOpen("MediaInfo.dll") ; New MediaInfo handle $aMediaInfo = DllCall($hDLL, "ptr", "MediaInfo_New") $hMediaInfo = $aMediaInfo[0] ; Open DllCall($hDLL, "dword", "MediaInfo_Open", _ "ptr", $hMediaInfo, _; Handle "wstr", "Matrix.Reloaded.Trailer-640x346-XviD-1.0beta2-HE_AAC_subtitled.mkv"); Full path ; MediaInfo $aMediaInfoGet = DllCall($hDLL, "wstr", "MediaInfo_Get", _ "ptr", $hMediaInfo, _; Handle "int", 0, _; StreamKind "int", 0, _; StreamNumber "wstr", "Video_Format_List", _; Video Codecs in this file, separated by / "int", 1, _; KindOfInfo "int", 0); KindOfSearch $sMediaInfo = $aMediaInfoGet[0] ConsoleWrite("Video Codecs in this file, separated by / : " & $sMediaInfo & @CRLF) ; General MediaInfo $aMediaInfoInform = DllCall($hDLL, "wstr", "MediaInfo_Inform", _ "ptr", $hMediaInfo, _; Handle "int", 0); Options $sMediaInfoInform = $aMediaInfoInform[0] ;ConsoleWrite($sMediaInfoInform & @CRLF) MsgBox(0, "Output", $sMediaInfoInform) DllCall($hDLL, "none", "MediaInfo_Close", "ptr", $hMediaInfo) DllClose($hDLL) Link to comment Share on other sites More sharing options...
trancexx Posted June 6, 2009 Share Posted June 6, 2009 Just change part below ; MediaInfo to this:; MediaInfo $aMediaInfoGet = DllCall($hDLL, "wstr", "MediaInfo_Get", _ "ptr", $hMediaInfo, _ ; Handle "int", 1, _ ; StreamKind <--Video "int", 0, _ ; StreamNumber "wstr", "CodecID", _ ; Codec ID <-- this "int", 1, _ ; KindOfInfo "int", 0) ; KindOfSearch $sMediaInfo = $aMediaInfoGet[0] ConsoleWrite("Video Codec ID: " & $sMediaInfo & @CRLF) ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Simplify iT Posted June 6, 2009 Author Share Posted June 6, 2009 Perfect! Thanks very much for your help trancexx! Link to comment Share on other sites More sharing options...
bentom Posted December 27, 2009 Share Posted December 27, 2009 Hello, a time ago, but I want to use the same dll (or commandline) for getting the framerate of a video. As I want to use it for a whole Blu-Ray directory, I have some questions. Perhaps someone knows how to handle this. with the command line: MediaInfo.exe -f "z:\Medien\Testvideodirectory\" I get all the information including the framerate. But I do not know how to use this with the dll call. Perhaps it could be easier to directly get the information from the command line but I did not get it. Can someone help? Regards, Alex Link to comment Share on other sites More sharing options...
Tin2tin Posted October 20, 2012 Share Posted October 20, 2012 (edited) Sorry for digging up this old thread, but I'm trying to extract "Encoded date". This info shows up in red in the console when all extracted info is written, but when that info is extracted directly it writes nothing? ; MediaInfo $aMediaInfoGet = DllCall($hDLL, "wstr", "MediaInfo_Get", _ "ptr", $hMediaInfo, _ ; Handle "int", 1, _ ; StreamKind <--Video "int", 0, _ ; StreamNumber "wstr", "Encoded date", _ ; Codec ID <-- this "int", 1, _ ; KindOfInfo "int", 0) ; KindOfSearch $sMediaInfo = $aMediaInfoGet[0] ConsoleWrite("Encoded date: " & $sMediaInfo & @CRLF) Edited October 20, 2012 by Tin2tin DVD slideshow GUI Link to comment Share on other sites More sharing options...
KaFu Posted October 20, 2012 Share Posted October 20, 2012 Give the string "Encoded_Date" a try... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Tin2tin Posted October 20, 2012 Share Posted October 20, 2012 It works - thank you! DVD slideshow GUI Link to comment Share on other sites More sharing options...
Tin2tin Posted October 20, 2012 Share Posted October 20, 2012 Where did you find that information? I'm looking for more tags for ex. a reel name in MediaInfor called "Original source medium". Using a similar syntax "Original_Source_Medium" doesn't give me anything. And I can't see it here: http://mediainfo.sourceforge.net/en/Support/Tags DVD slideshow GUI Link to comment Share on other sites More sharing options...
KaFu Posted October 20, 2012 Share Posted October 20, 2012 It's in the dll download package. I found this one at this location MediaInfo_DLL_0.7.60_Windows_i386_WithoutInstallerDevelopersList_Of_ParametersVideo.csv OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now