DynamicallyLoadedBindings.LibrariesPath vs Initialize() vs ffmpeg.RootPath? #328
-
|
What are the differences between them? Which one should I use? // Why System.NullReferenceException:“Object reference not set to an instance of an object.”?
Debug.WriteLine($"FFmpeg version info: {ffmpeg.av_version_info()}");
public static void RegisterFFmpegBinaries()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
string? current = Environment.CurrentDirectory;
string ffmpegPath = Path.Combine(current, "runtimes", "win-x64", "native");
if (!Directory.Exists(ffmpegPath))
{
throw new DirectoryNotFoundException($"FFmpeg binaries not found at {ffmpegPath}");
}
ffmpeg.RootPath = ffmpegPath;
//DynamicallyLoadedBindings.Initialize();
Debug.WriteLine($"FFmpeg version info: {ffmpeg.av_version_info()}");
}
else
{
throw new NotSupportedException(); // fell free add support for platform of your choose
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
|
Hi there I’ll take a look just back from surgery table Indubhave solution for this please wait a bit. Family and health first. |
Beta Was this translation helpful? Give feedback.
-
|
@Ruslan-B Hi, Thanks! Hope you’re doing okay after the surgery. I finally tested the correct solution. First, the ffmpeg binary version must be correct. I initially used nuget/FFmpeg.GPL, which was convenient, but the version seemed to be incorrect. Second, the namespace must be selected correctly, and
using FFmpeg.AutoGen.Bindings.DynamicallyLoaded;
DynamicallyLoadedBindings.LibrariesPath = ffmpegPath;
DynamicallyLoadedBindings.Initialize(); |
Beta Was this translation helpful? Give feedback.
-
|
I guess we can do breaking changes in this case or force user to fail as there reasons why it is one of them speed second it is static so assuming this there’s is legitimate way to break stable api and stop this from happening. Besides I did realized it is complet project for me I have to pass library to community - I’ll do this in a right way. |
Beta Was this translation helpful? Give feedback.
-
|
So look deeper it is okay to refactor this part as users will be impacted anyway |
Beta Was this translation helpful? Give feedback.
-
|
Оорв wrong poket. They are from different packages, the one from dyn loaded is an cross platform abstraction, dynamically liked lib the way to go as you can write a bindings redirection via dotnet |
Beta Was this translation helpful? Give feedback.









Okay, it's still a namespace issue!
❌:
✅: