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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th March 2020, 21:54   #61  |  Link
JKyle
App Digger
 
JKyle's Avatar
 
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.
JKyle is offline   Reply With Quote
Old 10th March 2020, 19:12   #62  |  Link
gpower2
gMKVExtractGUI author
 
gpower2's Avatar
 
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.
gpower2 is offline   Reply With Quote
Old 10th March 2020, 20:30   #63  |  Link
stax76
Registered User
 
stax76's Avatar
 
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.

Last edited by stax76; 10th March 2020 at 21:06.
stax76 is offline   Reply With Quote
Old 10th March 2020, 21:17   #64  |  Link
gpower2
gMKVExtractGUI author
 
gpower2's Avatar
 
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)
gpower2 is offline   Reply With Quote
Old 10th March 2020, 21:26   #65  |  Link
stax76
Registered User
 
stax76's Avatar
 
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.

Last edited by stax76; 10th March 2020 at 21:35.
stax76 is offline   Reply With Quote
Old 10th March 2020, 21:37   #66  |  Link
gpower2
gMKVExtractGUI author
 
gpower2's Avatar
 
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!
gpower2 is offline   Reply With Quote
Old 10th March 2020, 21:57   #67  |  Link
stax76
Registered User
 
stax76's Avatar
 
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

Last edited by stax76; 10th March 2020 at 22:41.
stax76 is offline   Reply With Quote
Old 10th March 2020, 22:39   #68  |  Link
stax76
Registered User
 
stax76's Avatar
 
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.
stax76 is offline   Reply With Quote
Old 4th April 2020, 18:46   #69  |  Link
stax76
Registered User
 
stax76's Avatar
 
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.

Last edited by stax76; 4th April 2020 at 18:57.
stax76 is offline   Reply With Quote
Old 11th April 2020, 12:07   #70  |  Link
stax76
Registered User
 
stax76's Avatar
 
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/MediaInfo.NET
stax76 is offline   Reply With Quote
Old 11th April 2020, 21:15   #71  |  Link
stax76
Registered User
 
stax76's Avatar
 
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
stax76 is offline   Reply With Quote
Old 28th April 2020, 02:14   #72  |  Link
OAKside
Cat
 
OAKside's Avatar
 
Join Date: Oct 2006
Location: Box
Posts: 21
Quote:
Originally Posted by stax76 View Post
- there was an issue with the feature that allowed to customize the settings directory, so I removed this feature
I was wondering why settings were reset (was using "portable"). No problem, awesome new right-click menu, pointed me to proper directory. Thanks again for your work on MediaInfo.NET (and of course StaxRip), honestly a pleasure to use, beautiful and customizable (esp. dark mode, windows size, font).

Request: Is it possible to format the "Menu" section differently? This is what mine looks like (MediaInfo formats fine, like this).
OAKside is offline   Reply With Quote
Old 28th April 2020, 16:01   #73  |  Link
stax76
Registered User
 
stax76's Avatar
 
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.
stax76 is offline   Reply With Quote
Old 4th May 2020, 04:24   #74  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
6.3.0.0 is a bug fix release.

https://github.com/stax76/MediaInfo.NET
stax76 is offline   Reply With Quote
Old 4th May 2020, 11:43   #75  |  Link
hajj_3
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.
hajj_3 is offline   Reply With Quote
Old 4th May 2020, 14:23   #76  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Quote:
Does this have anything to do with the regular mediainfo program
yes


Quote:
do you use their .dll file to get all the media information and use your app as the front end?
yes


Quote:
Do you have a binary of this app and your Open with++ app?
yes, on the release page but before you go to the release page please read the full main page first. Often there is important information like a description what the application is about, system requirements and install instructions and also other useful information like a list of features or screenshots.

Last edited by stax76; 4th May 2020 at 14:27.
stax76 is offline   Reply With Quote
Old 4th May 2020, 16:09   #77  |  Link
hajj_3
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.
hajj_3 is offline   Reply With Quote
Old 4th May 2020, 16:37   #78  |  Link
stax76
Registered User
 
stax76's Avatar
 
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.
stax76 is offline   Reply With Quote
Old 6th May 2020, 08:17   #79  |  Link
OAKside
Cat
 
OAKside's Avatar
 
Join Date: Oct 2006
Location: Box
Posts: 21
Quote:
Originally Posted by OAKside View Post
Request: Is it possible to format the "Menu" section differently? This is what mine looks like (MediaInfo formats fine, like this).
Quote:
Originally Posted by stax76 View Post
Thanks for the great feedback, there is a new release with the only change fixing this bug, please try the built-in update feature.
Holy cow, that was quick. Tested, indeed fixed! Looks great now! (Forgot to try update feature in my delirium, ha, I need to check it out.)
OAKside is offline   Reply With Quote
Old 7th May 2020, 12:22   #80  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by stax76 View Post
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.
Yeah, no need to add ".NET" or/and icon, it's perfect as is. Thank you for great apps!
redbtn is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.