PDA

View Full Version : MediaInfo Advanced dll question


goukilord10
04-15-2006, 11:26 AM
I found a open source dll that can give you all info of a audio or video file
its a great addition to ams and to my media player but
i could not manage to use it sins all documentation that came with it are for vc++,vc,vb...

im new to dlls i just managed to run those made by worms (they rock:))
but please any help here will be very apprecied. i long searched for something like this.

Mina
04-15-2006, 01:26 PM
Hi. Didn't a PDF or ReadMe file come along with it? You need to know the function names, and what parameters could be passed when calling each DLL Function.

aisudhiasudhias92564
04-15-2006, 02:35 PM
Use DLL Export Viewer (http://www.nirsoft.net/utils/dll_export_viewer.html) to get the function names ;)

Mina
04-15-2006, 02:40 PM
Use DLL Export Viewer (http://www.nirsoft.net/utils/dll_export_viewer.html) to get the function names ;)

perfeito!
agradecimentos!

goukilord10
04-15-2006, 07:04 PM
i read the documentation with mediainfo dll everything is explained
(however for microsoft c++ c# and vb)
all functions are well explained in the help file.
but the problem i got is by using it with ams
somehow it look like ams close the dll after it load & pass the command to it

but i need to pass 2 functions and 2 parameter for each action (i dunno how to do that on ams)

first function should be the "MediaInfo_open" and parameter the file path of the media file Ex: "C:\exemple.ogg"
THEN i sould pass a second parameter so i can get the info from the media file "MediaInfo_Get" and Ex: "filesize" as parameter

so that i can get the file size of the exemple.ogg file
but the dll dont return the size of the file but something else as if just forget my first call dll

either im calling dll twice or it get closed after the first call so it no longer remember the first function & parameter i passed to it
This is not a problem of the dll because it work well for vb tested it.
i dont undestand how should i use it in ams:huh
so plz anyone help with some code...

Worm
04-15-2006, 08:28 PM
One thing to be aware of is that AMS can only pass parameters ByVal not ByRef. And it can only pass numeric, or string values. If the DLL doesn't return the values you are looking for as the Result, you'll need to write your own wrapper to do this for you.

goukilord10
04-16-2006, 11:07 AM
resultA = DLL.CallFunction(_SourceFolder.."\\Autoplay\\Docs\\MediaInfo.dll", "MediaInfo_Open", _SourceFolder.."\\Autoplay\\Docs\\video.avi", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);

resultB = DLL.CallFunction(_SourceFolder.."\\Autoplay\\Docs\\MediaInfo.dll", "MediaInfo_Count_Get", "handle, Stream_Audio, -1", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);


--re = Dialog.Message("Notice", resultA, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
re = Dialog.Message("Notice", resultB, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

thats the code im using to retrive the number of audio streams of the video file video.avi
the video.avi has 3 audio stream but the dll return 0 everytime.

goukilord10
04-16-2006, 07:29 PM
resultA = DLL.CallFunction(_SourceFolder.."\\Autoplay\\Docs\\MediaInfo.dll", "MediaInfo_Open", _SourceFolder.."\\Autoplay\\Docs\\video.avi", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);

resultB = DLL.CallFunction(_SourceFolder.."\\Autoplay\\Docs\\MediaInfo.dll", "MediaInfo_Get", "handle, Stream_General, 0, \"FileSize\", Info_Text, Info_Name", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);


re = Dialog.Message("Notice", resultB, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

im sorry but i couldent edit the last post:huh
however thats another script i used, but the size the dll is not the correct
of the media file i opned.
One thing to be aware of is that AMS can only pass parameters ByVal not ByRef. And it can only pass numeric, or string values. If the DLL doesn't return the values you are looking for as the Result, you'll need to write your own wrapper to do this for you.
i guess its ok to work with this dll with numeric and string values
I think im only misusing it with ams
plz look in my script and tell me if this is the correct way to work with dlls
because im using 2 DLL.CallFunction
and if is like if the dll ignore the first DLL.CallFunction as soon i use the second DLL.CallFunction

The reason i need to use this dll is to allow my media player project to get the hight and width of a video file so it can resize its window size to show the video at its original size.
if anyone one know of a different way to do this without this dll it will be very apprecied ;)

goukilord10
04-21-2006, 09:34 PM
there is no way to get movies height and width in a invisible way to users ?
:huh