Status.finalized mediainfo1/3/2023 ![]() ![]() Tmp.Option("Inform", "Video %BitRate/String%") msg = tmp.Inform() // 5 165 kb/s Tmp.Option("Inform", "General %FrameRate/String%") msg = tmp.Inform() // 60.000 FPS Tmp.Option("Inform", "Video %Format_Commercial%") msg = tmp.Inform() // AVC Tmp.Option("Inform", "Video %DisplayAspectRatio/String%") msg = tmp.Inform() // 16.9 Tmp.Option("Inform", "General %Duration/String2%") msg = tmp.Inform() // 1 h 38 min Tmp.Option("Inform", "General %FileSize/String3%") msg = tmp.Inform() // 3.67 GiB Tmp.Option("Inform", "General %Format%") msg = tmp.Inform() // MpEG-4 Tmp.Option("Inform", "General %OverallBitRate/String%") msg = tmp.Inform() // 1 h 38 min FileName = cartes à abattre (1968).mp4" FileName = Nightmare 2 - Anarchy (2014).mkv" Private void btn_go_Click(object sender, RoutedEventArgs e) Public string Option(string option, string Value = "") Public System.IntPtr Open(string FileName) Private static extern IntPtr MediaInfoA_Option(IntPtr Handle, IntPtr Option, IntPtr Value) Private static extern IntPtr MediaInfo_Option(IntPtr Handle, string option, string Value) Internal static extern IntPtr MediaInfo_Open(IntPtr Handle, string FileName) Var objMediaInfo = new //or mi.Option("Complete", "1") or mi.Option("Info_Parameters") try them. Return Marshal.PtrToStringUni(MediaInfo_Option(Handle, option, Value)) įinally, modify your implementation: static void Main(string args) Private static extern IntPtr MediaInfo_Option(IntPtr Handle, string option, string Value) Ĭreate function for that: public string Option(string option, string Value = "") I forgot to include in my last post that you also need to set the Inform option through the MediaInfo_Option API, this is important step to define the returned data: Var objMediaInfo = new result = objMediaInfo.Inform() #Status.finalized mediainfo full#Then in your implementation, you must pass the full path of the media file not just its name: static void Main(string args) Private static extern void MediaInfo_Delete(IntPtr Handle) ![]() Return Marshal.PtrToStringUni(MediaInfo_Inform(Handle, (UIntPtr)0)) ĭon't forget to delete the pointer (Handle) that created by _MediaInfo_New_. Public System.UIntPtr Open(string FileName) Private static extern IntPtr MediaInfo_Inform(IntPtr Handle, UIntPtr Reserved) Private static extern UIntPtr MediaInfo_Open(IntPtr Handle, string FileName) I am aware there is already a fully developed wrapper for this, but I would like to keep this simple and lightweight.Ĭhanges I have tried a few different media files. However, I am only getting a blank string in return. Return Marshal.PtrToStringUni(MediaInfo_Inform(Handle)) Īnd I am calling this class using the below console app: static void Main(string args) Private static extern void MediaInfo_Close(IntPtr Handle) Private static extern IntPtr MediaInfo_Inform(IntPtr Handle) Private static extern void MediaInfo_Open(string FileName) ![]() Private static extern IntPtr MediaInfo_New() To wrap the dll, I have created a MediaInfo class, based on my (limited) understanding from the quickstart guide. #Status.finalized mediainfo mp4#Using MediaInfo DLL (64-bit), I am attempting to get the standard text output providing information about an mp4 file. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |