Comments (14)
Fixed in 84003fc
from mp-mediainfo.
Please, describe more information what is OS was used, version MediaInfo.Wrapper. Did you use .NET Core version or full .NET?
from mp-mediainfo.
Edition: Windows 10 Pro
Version: 1909
OS build: 18363.535
MediaInfo.Wrapper: 19.4.1.0
.NET Framework 4.8
from mp-mediainfo.
This still seems to happen, But i'm not sure if its the exact same issue; It works when building for x64, but AnyCPU doesn't copy any of the runtime dlls, including libmediainfo etc and the other dependencies.
All machines showing this are on Windows 10. I have a netstandard2.0 library that references the .NET Core version of the wrapper (19.09) and there are two consoles that are targetting NET Framework 4.7.2 referencing this library.
from mp-mediainfo.
I created 2 packages: .NET full and .NET standard. .NET standard should use in .NET Core services and applications only. If you run application on .NET Framework 4.8 you should use .NET full package
from mp-mediainfo.
Not sure i follow. The project that uses this library is a netstandard2.0 one, even if the root that loads it is a .NET Framework based one.
It does work well in runtime, but only if i build for x86/x64 explicitly; it just doesn't copy any of the artifacts when building to AnyCPU. Is that just not supported in general?
I'm not sure why that would be related to which runtime executes the code.
from mp-mediainfo.
MediaInfo.Native package contains MediaInfo.Native.targets (you can find it in %USERPROFILE%.nuget\packages\mediainfo.native\19.9.0) file with instructions how to build in 3 cases:
- When x64 will copy libcrypto-1_1-x64.dll, libcurl.dll (x64), libssl-1_1-x64.dll and MediaInfo.dll (x64) to target folder
- When x86 will copy libcrypto-1_1.dll, libcurl.dll (x86), libssl-1_1.dll and MediaInfo.dll (x86) to target folder
- When AnyCPU will create 2 folders x86 and x64 in target folder and will copy native libraries to them
MediaInfo.Wraper library detects what kind of process (x32 or x64) and tries find MediaInfo library in root folder or x86\x64 folder.
from mp-mediainfo.
MediaInfo.Core.Native package contains runtimes with structure of folder and libraries well known only for .NET Core runtime
from mp-mediainfo.
Then it seems unrelated to this issue, I just don't get the x86 and x64 folders in the output.
If it was a Core vs Framework issue, id expect not to get anything even when building for a specific arch.
Should i open a new issue here or on the Native package in your opinion?
from mp-mediainfo.
Could you create a simple project with mediainfo.wrapper package only and try build it? If you have same result as in your project can you share it with me?
from mp-mediainfo.
@yartat sorry for the delay - here is the repro: https://github.com/ransagy/mpMediaInfoBitnessRepro
Run the console project on either Any CPU or x64 and see the difference in outputs.
from mp-mediainfo.
I update test project. See https://github.com/yartat/mpMediaInfoBitnessRepro/commit/22aa89c43a9e5001628def18f1f2fac88b921f33
from mp-mediainfo.
Now Microsoft recommends NFX projects using PackageReference
instead of packages.config
. But the MediaInfo.Native.targets
reads,
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'x86'">
<None Include="$(MSBuildThisFileDirectory)native\x86\*">
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
</ItemGroup>
The Condition
prevents CopyToOutputDirectory
so I have to copy the .dll
s (in native/x86
) manually and it works well. And I believe I'm not alone so it's worth leaving a comment here.
The following is a very small console sample:
internal class Program
{
private static void Main(string[] args)
{
string filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "test2.mp3");
var media = new MediaInfoWrapper(filePath, NullLogger.Instance);
if (media.Success)
{
Console.WriteLine(media.Duration.ToString());
}
Console.ReadKey();
}
}
internal sealed class NullLogger : MediaInfo.ILogger
{
public static readonly NullLogger Instance = new NullLogger();
public void Log(LogLevel loglevel, string message, params object[] parameters)
{
try
{
if (parameters?.Length > 0)
{
Console.WriteLine(string.Format(message, parameters));
}
else
{
Console.WriteLine(message);
}
}
catch(Exception)
{
;
}
}
}
from mp-mediainfo.
Using mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim
or mcr.microsoft.com/dotnet/aspnet:7.0
had same MediaInfo library was not loaded!
error.
MediaInfo.Core.Native & MediaInfo.Wrapper.Core are installed for project.
As a temporary solution: manually installing required libraries fixes the problem
RUN apt update &&\
apt-get install -y libmediainfo0v5 libzen0v5
from mp-mediainfo.
Related Issues (20)
- Make `MediaInfo.Handler` public HOT 1
- Add listing attachments from mkv file HOT 4
- Network / HTTP stream support ? HOT 7
- Usage in Docker with webapi HOT 4
- AudioCodec has wrong serialization info for wma2 HOT 3
- How to get the "extra" field HOT 1
- Linux - MediaInfo.dll was not loaded! HOT 4
- MediaInfo.Open works on windows but not on Ubuntu HOT 8
- Resolution Determination is Too Strict
- LanguageMediaStreamBuilder.cs no longer retrieves language correctly
- Streaming/Byte-Wise usage
- The development of the project is postponed until the end of the war in Ukraine
- Is it a BUG when create a new instance? - v21.9.3 HOT 6
- CVE-2022-3602 OpenSSL security notice and MediaInfo.Core.Native dotnet c# package
- Wrapper language HOT 6
- Windows new MediaInfoWrapper with valid fully qualified file name and path throws error HOT 1
- Analyzing files with special characters HOT 5
- get display aspect ratio of video stream
- Has any date to update this package for release for .NET 8 HOT 1
- Memory Leak in MediaInfoWrapper Usage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mp-mediainfo.