Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
7th March 2020, 21:54 | #61 | Link |
App Digger
Join Date: Sep 2018
Posts: 411
|
Thank you for the quick and kind reply.
Yes, 5.5.0.0 (and 5.6.0.0) works nicely after installation of .NET Core 3.1 Runtime x86. I think most x64 users will easily ignore this requirement unless they read this thread or visit the official github page. Thanks again. Last edited by JKyle; 7th March 2020 at 21:57. |
10th March 2020, 19:12 | #62 | Link |
gMKVExtractGUI author
Join Date: Aug 2003
Location: Greece / Thessaloniki
Posts: 251
|
Hey! Thanks for your great work!
I have also made a small MediaInfo in .NET that detects runtime the running platform and loads the correct MediaInfo library, allowing for targeting Any CPU. https://github.com/Gpower2/gMediaToo.../gMediaInfo.cs I know you prefer VB, but maybe this will give you some ideas about your project. PS. It is based on an old MediaInfo wrapper from MeGUI project. |
10th March 2020, 20:30 | #63 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Hello gpower2,
C# is OK (MediaInfo.NET and mpv.net are written in C#). Sometimes it greatly helps to look at other peoples code to understand how it works and how other people do things. Typically, I do things my own way however. Native MediaInfo.dll is used in 4 of my projects: https://github.com/staxrip/staxrip/b...l/MediaInfo.vb https://github.com/stax76/mpv.net/bl...e/MediaInfo.cs https://github.com/stax76/MediaInfo....c/MediaInfo.cs https://github.com/stax76/Get-MediaI...ediaInfoNET.cs I've not really analyzed your code but it's probably inefficient since it uses GetProcAddress all over the place instead of the idiomatic .NET way DllImport, I could be wrong because I did not benchmark it but if you disassemble MS code with dotPeek (frequent task of an experienced .NET dev) then you see that it uses almost always DllImport. It seem to call GetProcAddress for every request instead of only one initialization, that is inefficient.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 10th March 2020 at 21:06. |
10th March 2020, 21:17 | #64 | Link |
gMKVExtractGUI author
Join Date: Aug 2003
Location: Greece / Thessaloniki
Posts: 251
|
Hmmm, you actually gave me an idea of caching the Delegates instead of constantly resolving their address, thanks for that!
Unfortunately I don't think you can use DllImport when you want to do a runtime bidning to different Dlls unknown to compile time. Of course using Dllimport would be the preferred way, if only it could work in this case! :P PS. You could also use ILSpy (open source) |
10th March 2020, 21:26 | #65 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
As far as I know LoadLibrary most importantly first looks in the startup folder and after that in System32 but it's not a problem to use DllImport if your DLL is located somewhere else, just call LoadLibrary once before the DllImport method, that's how my MediaInfo code works, see here:
https://github.com/staxrip/staxrip/b...diaInfo.vb#L12 If I had written this code today I probably would have checked the return value for an error even though it's not having a real benefit.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 10th March 2020 at 21:35. |
10th March 2020, 21:37 | #66 | Link |
gMKVExtractGUI author
Join Date: Aug 2003
Location: Greece / Thessaloniki
Posts: 251
|
I don't think LoadLibrary, which is a kernel32.dll method, is related to DllImport, which is managed class.
I actually use the LoadLibrary in my code too, I just went full dynamic and use GetProcAddress from the library handle returned from LoadLibrary. BTW, I just pushed the cache implementation for the function delegates and it works like a charm! |
10th March 2020, 21:57 | #67 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
The CLR sits on top of the OS, under the hood the DllImport implementation will just call LoadLibrary, try it and you will see that it works because it has always works for me and I just found out now but instead of calling LoadLibrary this will much likely work as well:
SetDllDirectory and AddDllDirectory
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 10th March 2020 at 22:41. |
10th March 2020, 22:39 | #68 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
There is also DefaultDllImportSearchPathsAttribute so there are various ways to achieve the same thing, some more elegant than others, performance wise your way should be fine, for performance critical code resolving the address should definitely be done only once.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
4th April 2020, 18:46 | #69 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
There was a new MediaInfo version, so I made a new release of this little project.
I've integrated another small project of mine called Get-MediaInfo, it's a complete MediaInfo PowerShell solution, in MediaInfo.NET there is a new menu item 'Folder View' which runs the powershell command: . Get-MediaInfo.ps1; gci 'folder' | gmi | ogv It looks like so: https://github.com/stax76/Get-MediaInfo#examples I hope it works, software dependencies and distribution can be very difficult! https://github.com/stax76/MediaInfo.NET#installation People that already use MediaInfo.NET may try to update using the built-in update feature found in the menu, that is powershell powered as well and I hope that it works too.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 4th April 2020 at 18:57. |
11th April 2020, 12:07 | #70 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Version 6.0.0.0 runs on good old .NET Framework 4.8, it's compiled as Any CPU so runs on x64 and x86 but the included native MediaInfo.dll is x64 so x86 users have to replace MediaInfo.dll.
- there was an issue with the feature that allowed to customize the settings directory, so I removed this feature - Get-MediaInfo 3.0 is included, it fixes few bugs, it's used for the folder view - the folder view uses now an internal in process PowerShell so no terminal is shown The outlook for staxrip is: Code:
- internal MediaInfo GUI replaced with external MediaInfo.NET app which was ported to good old .NET Framework 4.8. StaxRip includes only one MediaInfo.dll and it's located in the MediaInfo.NET folder and there is also only one Get-MediaInfo.ps1 also located in the MediaInfo.NET folder. The folder view now uses the internal PowerShell instead of showing a terminal. Get-MediaInfo.ps1 was updated to 3.0.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
11th April 2020, 21:15 | #71 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Unfortunately there was a critical issue in 6.0.0.0, it's fixed in 6.1.0.0.
https://github.com/stax76/MediaInfo.NET/issues/7 https://github.com/stax76/MediaInfo.NET/releases
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
28th April 2020, 02:14 | #72 | Link | |
Cat
Join Date: Oct 2006
Location: Box
Posts: 21
|
Quote:
Request: Is it possible to format the "Menu" section differently? This is what mine looks like (MediaInfo formats fine, like this). |
|
28th April 2020, 16:01 | #73 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Thanks for the great feedback, there is a new release with the only change fixing this bug, please try the built-in update feature.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
4th May 2020, 04:24 | #74 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
4th May 2020, 11:43 | #75 | Link |
Registered User
Join Date: Mar 2004
Posts: 1,126
|
does this have anything to do with the regular mediainfo program, do you use their .dll file to get all the media information and use your app as the front end? Do you have a binary of this app and your Open with++ app?
Last edited by hajj_3; 4th May 2020 at 11:50. |
4th May 2020, 14:23 | #76 | Link | |||
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Quote:
Quote:
Quote:
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 4th May 2020 at 14:27. |
|||
4th May 2020, 16:09 | #77 | Link |
Registered User
Join Date: Mar 2004
Posts: 1,126
|
Mediainfo.net uses 46.7MB ram whereas the latest mediainfo uses only 5.1MB, that seems quite high for an app like this?
When registering the app in the right click menu of file explorer it shows up as "mediainfo" and without a logo. You could do with renaming it Mediainfo.NET and possibly adding a logo. Adding an option in the settings to create an icon for the application in the start menu would be nice. Last edited by hajj_3; 4th May 2020 at 16:31. |
4th May 2020, 16:37 | #78 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Other people might not like the .NET caption or the icon, with Open with++ you have full control and it allows you to learn the command line which is a very powerful concept.
MediaInfo.NET uses 35 MB here for a simple file, it's not really that much, a modern XAML based GUI uses more memory like a classic Win32 GUI.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
|
|