Kernel32 not found when using FFmpeg.Autogen 4.1.0.2 in Mono/LinuxIs there another way to export a frame in ffmpeg to a texture2d? My code working in Windows but not LinuxIs Mono ready for prime time?Why is it important to override GetHashCode when Equals method is overridden?When to use struct?When to use .First and when to use .FirstOrDefault with LINQ?Windows kernel32 functions in Mono on LinuxHow and when to use ‘async’ and ‘await’Compiling Unity3d for IOS error.NET Core vs MonoSystem.DllNotFoundException: > gtkbinlibgobject-2.0-0.dllGot a SIGABRT while executing native code - error when running xsp4 on AWS during Cloudformation

Why does C++ have 'Undefined Behaviour' and other languages like C# or Java don't?

Mathematica code for bifurcation diagram in 3D

Lost passport which have valid student visa but I make new passport unable paste

Is the order of words purely based on convention?

A famous scholar sent me an unpublished draft of hers. Then she died. I think her work should be published. What should I do?

A word that refers to saying something in an attempt to anger or embarrass someone into doing something that they don’t want to do?

Selection Sort Algorithm (Python)

Why does Captain Marvel in the MCU not have her sash?

How to model regression with an asymmetric loss function?

"until mine is on tight" is a idiom?

Fix Ethernet 10/100 PoE cable with 7 out of 8 wires alive

Lambda functions with template parameters, not in function parameters

What in my code changed between MacTeX 2017 and MacTex 2019?

Is determiner 'a' needed here?

How to prepare for a rapid tournament

Knights and Knaves: What does C say?

How do my husband and I get over our fear of having another difficult baby?

If a spaceship ran out of fuel somewhere in space between Earth and Mars, does it slowly drift off to the Sun?

Garage door sticks on a bolt

Received a package but didn't order it

How do we know neutrons have no charge?

How G-d can be cursing one's sons (and spouse)?

How fast can a LN payment be over TOR?

Beyond Futuristic Technology for an Alien Warship?



Kernel32 not found when using FFmpeg.Autogen 4.1.0.2 in Mono/Linux


Is there another way to export a frame in ffmpeg to a texture2d? My code working in Windows but not LinuxIs Mono ready for prime time?Why is it important to override GetHashCode when Equals method is overridden?When to use struct?When to use .First and when to use .FirstOrDefault with LINQ?Windows kernel32 functions in Mono on LinuxHow and when to use ‘async’ and ‘await’Compiling Unity3d for IOS error.NET Core vs MonoSystem.DllNotFoundException: > gtkbinlibgobject-2.0-0.dllGot a SIGABRT while executing native code - error when running xsp4 on AWS during Cloudformation






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I'm submitting a bug report while I was posting this I didn't know I could see into FFmpeg.Autogen from the stacktrace. Anyways I posted a Bug Report on Github



https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109



I'm trying to run my code in Linux that uses FFmpeg.Autogen to interface with the ffmpeg libraries. I am getting kernel32 dll not found can not figure out why. He says to not post issues to github for troubleshooting.
Possible related issue: https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/89



First thing I've tried were to include the binary helper class from the example code I tweaked it a little bit. Added the exact path to the linux files.
Second thing I did was add FFmpeg.AutoGen.dll.config if configured right and it tries to ref a windows DLL it should point to the linux one.
Stacktrace:



System.DllNotFoundException: kernel32
at at (wrapper managed-to-native) FFmpeg.AutoGen.Native.WindowsNativeMethods.GetProcAddress(intptr,string)
at FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionPointer (System.IntPtr nativeLibraryHandle, System.String functionName) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenNativeFunctionLoader.cs:55
at FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionDelegate[T] (System.IntPtr nativeLibraryHandle, System.String functionName, System.Boolean throwOnError) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenNativeFunctionLoader.cs:28
at FFmpeg.AutoGen.ffmpeg.GetFunctionDelegate[T] (System.IntPtr libraryHandle, System.String functionName) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.cs:50
at FFmpeg.AutoGen.ffmpeg+<>c.<.cctor>b__4_318 () [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.functions.export.g.cs:7163
at FFmpeg.AutoGen.ffmpeg.avformat_alloc_context () [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.functions.export.g.cs:7176
at FF8.FfccVaribleGroup..ctor () [0x0009c] in /home/robert/OpenVIII/FF8/FfccVaribleGroup.cs:53
at FF8.Ffcc..ctor (System.String filename, FFmpeg.AutoGen.AVMediaType mediatype, FF8.Ffcc+FfccMode mode) [0x00008] in /home/robert/OpenVIII/FF8/Ffcc.cs:31
at FF8.Module_movie_test.InitMovie () [0x00001] in /home/robert/OpenVIII/FF8/module_movie_test.cs:160
at FF8.Module_movie_test.Update () [0x000c5] in /home/robert/OpenVIII/FF8/module_movie_test.cs:88
at FF8.ModuleHandler.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x000ac] in /home/robert/OpenVIII/FF8/ModuleHandler.cs:43
at FF8.Game1.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x00030] in /home/robert/OpenVIII/FF8/Game1.cs:69
at Microsoft.Xna.Framework.Game.DoUpdate (Microsoft.Xna.Framework.GameTime gameTime) [0x00019] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Tick () [0x00103] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop () [0x00021] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Run (Microsoft.Xna.Framework.GameRunBehavior runBehavior) [0x0008b] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Run () [0x0000c] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at FF8.Program.Main () [0x00007] in /home/robert/OpenVIII/FF8/Program.cs:17


My code that triggers this:



Format = ffmpeg.avformat_alloc_context();


Binaryhelper should set the path correctly for the file



internal static void RegisterFFmpegBinaries()

var libraryPath = "";
switch (Environment.OSVersion.Platform)

case PlatformID.Win32NT:
case PlatformID.Win32S:
case PlatformID.Win32Windows:
var current = Environment.CurrentDirectory;
var probe = Path.Combine(Environment.Is64BitProcess ? "x64" : "x86");
while (current != null)

var ffmpegDirectory = Path.Combine(current, probe);
if (Directory.Exists(ffmpegDirectory))

Console.WriteLine($"FFmpeg binaries found in: ffmpegDirectory");
RegisterLibrariesSearchPath(ffmpegDirectory);
return;

current = Directory.GetParent(current)?.FullName;

break;
case PlatformID.Unix:
libraryPath = "/usr/lib/x86_64-linux-gnu";
RegisterLibrariesSearchPath(libraryPath);
break;
case PlatformID.MacOSX:
libraryPath = Environment.GetEnvironmentVariable(LD_LIBRARY_PATH);
RegisterLibrariesSearchPath(libraryPath);
break;




The FFmpeg.Autogen.dll.config



<configuration>
<dllmap os="linux" dll="avutil-56.dll" target="/usr/lib/x86_64-linux-gnu/libavutil.so.56"/>
<dllmap os="linux" dll="avcodec-58.dll" target="/usr/lib/x86_64-linux-gnu/libavcodec.so.58"/>
<dllmap os="linux" dll="avformat-58.dll" target="/usr/lib/x86_64-linux-gnu/libavformat.so.58"/>
<dllmap os="linux" dll="avdevice-58.dll" target="/usr/lib/x86_64-linux-gnu/libavdevice.so.58"/>
<dllmap os="linux" dll="avfilter-7.dll" target="/usr/lib/x86_64-linux-gnu/libavfilter.so.7"/>
<dllmap os="linux" dll="avresample-4.dll" target="/usr/lib/x86_64-linux-gnu/libavresample.so.4"/>
<dllmap os="linux" dll="swscale-5.dll" target="/usr/lib/x86_64-linux-gnu/libswscale.so.5"/>
<dllmap os="linux" dll="swresample-3.dll" target="/usr/lib/x86_64-linux-gnu/libswresample.so.3"/>
<dllmap os="linux" dll="postproc-55.dll" target="/usr/lib/x86_64-linux-gnu/libpostproc.so.55"/>
</configuration>









share|improve this question





















  • 1





    Clearly the C# code tries to directly P/Invoke the GetProcAddress, which is a WinAPI method, requiring kernel32.dll - a Windows DLL...

    – user2819245
    Mar 28 at 19:03












  • I already see something I haven't spotted till now it's triggering off GetProcAddress Maybe this is a bug report. So it's not even the part trying to load the libraries?

    – Robert Russell
    Mar 28 at 19:04






  • 1





    Yes, it is not the part trying to load the libraries. It seems FFmpeg.Autogen has some hard-coded dependency/ies on the WinAPI. Best to check the issue tracker for FFmpeg.Autogen if the issue has already been reported, and if not, best to write a new issue report about the lacking Non-Windows compatibility.

    – user2819245
    Mar 28 at 19:06






  • 1





    Perhaps there is a platorm-neutral version of FFmpeg.Autogen available (in other words, a .NET standard port/build)? I don't know. According to the github frontpage of FFmpeg.Autogen, it should run in Linux. Are you perhaps using an old, outdated version that might not be Linux-compatible?

    – user2819245
    Mar 28 at 19:07












  • I think it's a NET45 issue that broke stuff in NET2 he has a switch case choosing which function to use. in NET45 he had it only using the windows function.

    – Robert Russell
    Mar 28 at 19:11

















2















I'm submitting a bug report while I was posting this I didn't know I could see into FFmpeg.Autogen from the stacktrace. Anyways I posted a Bug Report on Github



https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109



I'm trying to run my code in Linux that uses FFmpeg.Autogen to interface with the ffmpeg libraries. I am getting kernel32 dll not found can not figure out why. He says to not post issues to github for troubleshooting.
Possible related issue: https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/89



First thing I've tried were to include the binary helper class from the example code I tweaked it a little bit. Added the exact path to the linux files.
Second thing I did was add FFmpeg.AutoGen.dll.config if configured right and it tries to ref a windows DLL it should point to the linux one.
Stacktrace:



System.DllNotFoundException: kernel32
at at (wrapper managed-to-native) FFmpeg.AutoGen.Native.WindowsNativeMethods.GetProcAddress(intptr,string)
at FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionPointer (System.IntPtr nativeLibraryHandle, System.String functionName) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenNativeFunctionLoader.cs:55
at FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionDelegate[T] (System.IntPtr nativeLibraryHandle, System.String functionName, System.Boolean throwOnError) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenNativeFunctionLoader.cs:28
at FFmpeg.AutoGen.ffmpeg.GetFunctionDelegate[T] (System.IntPtr libraryHandle, System.String functionName) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.cs:50
at FFmpeg.AutoGen.ffmpeg+<>c.<.cctor>b__4_318 () [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.functions.export.g.cs:7163
at FFmpeg.AutoGen.ffmpeg.avformat_alloc_context () [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.functions.export.g.cs:7176
at FF8.FfccVaribleGroup..ctor () [0x0009c] in /home/robert/OpenVIII/FF8/FfccVaribleGroup.cs:53
at FF8.Ffcc..ctor (System.String filename, FFmpeg.AutoGen.AVMediaType mediatype, FF8.Ffcc+FfccMode mode) [0x00008] in /home/robert/OpenVIII/FF8/Ffcc.cs:31
at FF8.Module_movie_test.InitMovie () [0x00001] in /home/robert/OpenVIII/FF8/module_movie_test.cs:160
at FF8.Module_movie_test.Update () [0x000c5] in /home/robert/OpenVIII/FF8/module_movie_test.cs:88
at FF8.ModuleHandler.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x000ac] in /home/robert/OpenVIII/FF8/ModuleHandler.cs:43
at FF8.Game1.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x00030] in /home/robert/OpenVIII/FF8/Game1.cs:69
at Microsoft.Xna.Framework.Game.DoUpdate (Microsoft.Xna.Framework.GameTime gameTime) [0x00019] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Tick () [0x00103] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop () [0x00021] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Run (Microsoft.Xna.Framework.GameRunBehavior runBehavior) [0x0008b] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Run () [0x0000c] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at FF8.Program.Main () [0x00007] in /home/robert/OpenVIII/FF8/Program.cs:17


My code that triggers this:



Format = ffmpeg.avformat_alloc_context();


Binaryhelper should set the path correctly for the file



internal static void RegisterFFmpegBinaries()

var libraryPath = "";
switch (Environment.OSVersion.Platform)

case PlatformID.Win32NT:
case PlatformID.Win32S:
case PlatformID.Win32Windows:
var current = Environment.CurrentDirectory;
var probe = Path.Combine(Environment.Is64BitProcess ? "x64" : "x86");
while (current != null)

var ffmpegDirectory = Path.Combine(current, probe);
if (Directory.Exists(ffmpegDirectory))

Console.WriteLine($"FFmpeg binaries found in: ffmpegDirectory");
RegisterLibrariesSearchPath(ffmpegDirectory);
return;

current = Directory.GetParent(current)?.FullName;

break;
case PlatformID.Unix:
libraryPath = "/usr/lib/x86_64-linux-gnu";
RegisterLibrariesSearchPath(libraryPath);
break;
case PlatformID.MacOSX:
libraryPath = Environment.GetEnvironmentVariable(LD_LIBRARY_PATH);
RegisterLibrariesSearchPath(libraryPath);
break;




The FFmpeg.Autogen.dll.config



<configuration>
<dllmap os="linux" dll="avutil-56.dll" target="/usr/lib/x86_64-linux-gnu/libavutil.so.56"/>
<dllmap os="linux" dll="avcodec-58.dll" target="/usr/lib/x86_64-linux-gnu/libavcodec.so.58"/>
<dllmap os="linux" dll="avformat-58.dll" target="/usr/lib/x86_64-linux-gnu/libavformat.so.58"/>
<dllmap os="linux" dll="avdevice-58.dll" target="/usr/lib/x86_64-linux-gnu/libavdevice.so.58"/>
<dllmap os="linux" dll="avfilter-7.dll" target="/usr/lib/x86_64-linux-gnu/libavfilter.so.7"/>
<dllmap os="linux" dll="avresample-4.dll" target="/usr/lib/x86_64-linux-gnu/libavresample.so.4"/>
<dllmap os="linux" dll="swscale-5.dll" target="/usr/lib/x86_64-linux-gnu/libswscale.so.5"/>
<dllmap os="linux" dll="swresample-3.dll" target="/usr/lib/x86_64-linux-gnu/libswresample.so.3"/>
<dllmap os="linux" dll="postproc-55.dll" target="/usr/lib/x86_64-linux-gnu/libpostproc.so.55"/>
</configuration>









share|improve this question





















  • 1





    Clearly the C# code tries to directly P/Invoke the GetProcAddress, which is a WinAPI method, requiring kernel32.dll - a Windows DLL...

    – user2819245
    Mar 28 at 19:03












  • I already see something I haven't spotted till now it's triggering off GetProcAddress Maybe this is a bug report. So it's not even the part trying to load the libraries?

    – Robert Russell
    Mar 28 at 19:04






  • 1





    Yes, it is not the part trying to load the libraries. It seems FFmpeg.Autogen has some hard-coded dependency/ies on the WinAPI. Best to check the issue tracker for FFmpeg.Autogen if the issue has already been reported, and if not, best to write a new issue report about the lacking Non-Windows compatibility.

    – user2819245
    Mar 28 at 19:06






  • 1





    Perhaps there is a platorm-neutral version of FFmpeg.Autogen available (in other words, a .NET standard port/build)? I don't know. According to the github frontpage of FFmpeg.Autogen, it should run in Linux. Are you perhaps using an old, outdated version that might not be Linux-compatible?

    – user2819245
    Mar 28 at 19:07












  • I think it's a NET45 issue that broke stuff in NET2 he has a switch case choosing which function to use. in NET45 he had it only using the windows function.

    – Robert Russell
    Mar 28 at 19:11













2












2








2








I'm submitting a bug report while I was posting this I didn't know I could see into FFmpeg.Autogen from the stacktrace. Anyways I posted a Bug Report on Github



https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109



I'm trying to run my code in Linux that uses FFmpeg.Autogen to interface with the ffmpeg libraries. I am getting kernel32 dll not found can not figure out why. He says to not post issues to github for troubleshooting.
Possible related issue: https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/89



First thing I've tried were to include the binary helper class from the example code I tweaked it a little bit. Added the exact path to the linux files.
Second thing I did was add FFmpeg.AutoGen.dll.config if configured right and it tries to ref a windows DLL it should point to the linux one.
Stacktrace:



System.DllNotFoundException: kernel32
at at (wrapper managed-to-native) FFmpeg.AutoGen.Native.WindowsNativeMethods.GetProcAddress(intptr,string)
at FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionPointer (System.IntPtr nativeLibraryHandle, System.String functionName) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenNativeFunctionLoader.cs:55
at FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionDelegate[T] (System.IntPtr nativeLibraryHandle, System.String functionName, System.Boolean throwOnError) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenNativeFunctionLoader.cs:28
at FFmpeg.AutoGen.ffmpeg.GetFunctionDelegate[T] (System.IntPtr libraryHandle, System.String functionName) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.cs:50
at FFmpeg.AutoGen.ffmpeg+<>c.<.cctor>b__4_318 () [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.functions.export.g.cs:7163
at FFmpeg.AutoGen.ffmpeg.avformat_alloc_context () [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.functions.export.g.cs:7176
at FF8.FfccVaribleGroup..ctor () [0x0009c] in /home/robert/OpenVIII/FF8/FfccVaribleGroup.cs:53
at FF8.Ffcc..ctor (System.String filename, FFmpeg.AutoGen.AVMediaType mediatype, FF8.Ffcc+FfccMode mode) [0x00008] in /home/robert/OpenVIII/FF8/Ffcc.cs:31
at FF8.Module_movie_test.InitMovie () [0x00001] in /home/robert/OpenVIII/FF8/module_movie_test.cs:160
at FF8.Module_movie_test.Update () [0x000c5] in /home/robert/OpenVIII/FF8/module_movie_test.cs:88
at FF8.ModuleHandler.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x000ac] in /home/robert/OpenVIII/FF8/ModuleHandler.cs:43
at FF8.Game1.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x00030] in /home/robert/OpenVIII/FF8/Game1.cs:69
at Microsoft.Xna.Framework.Game.DoUpdate (Microsoft.Xna.Framework.GameTime gameTime) [0x00019] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Tick () [0x00103] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop () [0x00021] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Run (Microsoft.Xna.Framework.GameRunBehavior runBehavior) [0x0008b] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Run () [0x0000c] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at FF8.Program.Main () [0x00007] in /home/robert/OpenVIII/FF8/Program.cs:17


My code that triggers this:



Format = ffmpeg.avformat_alloc_context();


Binaryhelper should set the path correctly for the file



internal static void RegisterFFmpegBinaries()

var libraryPath = "";
switch (Environment.OSVersion.Platform)

case PlatformID.Win32NT:
case PlatformID.Win32S:
case PlatformID.Win32Windows:
var current = Environment.CurrentDirectory;
var probe = Path.Combine(Environment.Is64BitProcess ? "x64" : "x86");
while (current != null)

var ffmpegDirectory = Path.Combine(current, probe);
if (Directory.Exists(ffmpegDirectory))

Console.WriteLine($"FFmpeg binaries found in: ffmpegDirectory");
RegisterLibrariesSearchPath(ffmpegDirectory);
return;

current = Directory.GetParent(current)?.FullName;

break;
case PlatformID.Unix:
libraryPath = "/usr/lib/x86_64-linux-gnu";
RegisterLibrariesSearchPath(libraryPath);
break;
case PlatformID.MacOSX:
libraryPath = Environment.GetEnvironmentVariable(LD_LIBRARY_PATH);
RegisterLibrariesSearchPath(libraryPath);
break;




The FFmpeg.Autogen.dll.config



<configuration>
<dllmap os="linux" dll="avutil-56.dll" target="/usr/lib/x86_64-linux-gnu/libavutil.so.56"/>
<dllmap os="linux" dll="avcodec-58.dll" target="/usr/lib/x86_64-linux-gnu/libavcodec.so.58"/>
<dllmap os="linux" dll="avformat-58.dll" target="/usr/lib/x86_64-linux-gnu/libavformat.so.58"/>
<dllmap os="linux" dll="avdevice-58.dll" target="/usr/lib/x86_64-linux-gnu/libavdevice.so.58"/>
<dllmap os="linux" dll="avfilter-7.dll" target="/usr/lib/x86_64-linux-gnu/libavfilter.so.7"/>
<dllmap os="linux" dll="avresample-4.dll" target="/usr/lib/x86_64-linux-gnu/libavresample.so.4"/>
<dllmap os="linux" dll="swscale-5.dll" target="/usr/lib/x86_64-linux-gnu/libswscale.so.5"/>
<dllmap os="linux" dll="swresample-3.dll" target="/usr/lib/x86_64-linux-gnu/libswresample.so.3"/>
<dllmap os="linux" dll="postproc-55.dll" target="/usr/lib/x86_64-linux-gnu/libpostproc.so.55"/>
</configuration>









share|improve this question
















I'm submitting a bug report while I was posting this I didn't know I could see into FFmpeg.Autogen from the stacktrace. Anyways I posted a Bug Report on Github



https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109



I'm trying to run my code in Linux that uses FFmpeg.Autogen to interface with the ffmpeg libraries. I am getting kernel32 dll not found can not figure out why. He says to not post issues to github for troubleshooting.
Possible related issue: https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/89



First thing I've tried were to include the binary helper class from the example code I tweaked it a little bit. Added the exact path to the linux files.
Second thing I did was add FFmpeg.AutoGen.dll.config if configured right and it tries to ref a windows DLL it should point to the linux one.
Stacktrace:



System.DllNotFoundException: kernel32
at at (wrapper managed-to-native) FFmpeg.AutoGen.Native.WindowsNativeMethods.GetProcAddress(intptr,string)
at FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionPointer (System.IntPtr nativeLibraryHandle, System.String functionName) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenNativeFunctionLoader.cs:55
at FFmpeg.AutoGen.Native.FunctionLoader.GetFunctionDelegate[T] (System.IntPtr nativeLibraryHandle, System.String functionName, System.Boolean throwOnError) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenNativeFunctionLoader.cs:28
at FFmpeg.AutoGen.ffmpeg.GetFunctionDelegate[T] (System.IntPtr libraryHandle, System.String functionName) [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.cs:50
at FFmpeg.AutoGen.ffmpeg+<>c.<.cctor>b__4_318 () [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.functions.export.g.cs:7163
at FFmpeg.AutoGen.ffmpeg.avformat_alloc_context () [0x00000] in D:FFmpeg.AutoGenFFmpeg.AutoGenFFmpeg.functions.export.g.cs:7176
at FF8.FfccVaribleGroup..ctor () [0x0009c] in /home/robert/OpenVIII/FF8/FfccVaribleGroup.cs:53
at FF8.Ffcc..ctor (System.String filename, FFmpeg.AutoGen.AVMediaType mediatype, FF8.Ffcc+FfccMode mode) [0x00008] in /home/robert/OpenVIII/FF8/Ffcc.cs:31
at FF8.Module_movie_test.InitMovie () [0x00001] in /home/robert/OpenVIII/FF8/module_movie_test.cs:160
at FF8.Module_movie_test.Update () [0x000c5] in /home/robert/OpenVIII/FF8/module_movie_test.cs:88
at FF8.ModuleHandler.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x000ac] in /home/robert/OpenVIII/FF8/ModuleHandler.cs:43
at FF8.Game1.Update (Microsoft.Xna.Framework.GameTime gameTime) [0x00030] in /home/robert/OpenVIII/FF8/Game1.cs:69
at Microsoft.Xna.Framework.Game.DoUpdate (Microsoft.Xna.Framework.GameTime gameTime) [0x00019] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Tick () [0x00103] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop () [0x00021] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Run (Microsoft.Xna.Framework.GameRunBehavior runBehavior) [0x0008b] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at Microsoft.Xna.Framework.Game.Run () [0x0000c] in <4fc8466c27384bb19c7b81b2a6a71083>:0
at FF8.Program.Main () [0x00007] in /home/robert/OpenVIII/FF8/Program.cs:17


My code that triggers this:



Format = ffmpeg.avformat_alloc_context();


Binaryhelper should set the path correctly for the file



internal static void RegisterFFmpegBinaries()

var libraryPath = "";
switch (Environment.OSVersion.Platform)

case PlatformID.Win32NT:
case PlatformID.Win32S:
case PlatformID.Win32Windows:
var current = Environment.CurrentDirectory;
var probe = Path.Combine(Environment.Is64BitProcess ? "x64" : "x86");
while (current != null)

var ffmpegDirectory = Path.Combine(current, probe);
if (Directory.Exists(ffmpegDirectory))

Console.WriteLine($"FFmpeg binaries found in: ffmpegDirectory");
RegisterLibrariesSearchPath(ffmpegDirectory);
return;

current = Directory.GetParent(current)?.FullName;

break;
case PlatformID.Unix:
libraryPath = "/usr/lib/x86_64-linux-gnu";
RegisterLibrariesSearchPath(libraryPath);
break;
case PlatformID.MacOSX:
libraryPath = Environment.GetEnvironmentVariable(LD_LIBRARY_PATH);
RegisterLibrariesSearchPath(libraryPath);
break;




The FFmpeg.Autogen.dll.config



<configuration>
<dllmap os="linux" dll="avutil-56.dll" target="/usr/lib/x86_64-linux-gnu/libavutil.so.56"/>
<dllmap os="linux" dll="avcodec-58.dll" target="/usr/lib/x86_64-linux-gnu/libavcodec.so.58"/>
<dllmap os="linux" dll="avformat-58.dll" target="/usr/lib/x86_64-linux-gnu/libavformat.so.58"/>
<dllmap os="linux" dll="avdevice-58.dll" target="/usr/lib/x86_64-linux-gnu/libavdevice.so.58"/>
<dllmap os="linux" dll="avfilter-7.dll" target="/usr/lib/x86_64-linux-gnu/libavfilter.so.7"/>
<dllmap os="linux" dll="avresample-4.dll" target="/usr/lib/x86_64-linux-gnu/libavresample.so.4"/>
<dllmap os="linux" dll="swscale-5.dll" target="/usr/lib/x86_64-linux-gnu/libswscale.so.5"/>
<dllmap os="linux" dll="swresample-3.dll" target="/usr/lib/x86_64-linux-gnu/libswresample.so.3"/>
<dllmap os="linux" dll="postproc-55.dll" target="/usr/lib/x86_64-linux-gnu/libpostproc.so.55"/>
</configuration>






c# dll ffmpeg mono autogen






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 20:06







Robert Russell

















asked Mar 28 at 19:00









Robert RussellRobert Russell

747 bronze badges




747 bronze badges










  • 1





    Clearly the C# code tries to directly P/Invoke the GetProcAddress, which is a WinAPI method, requiring kernel32.dll - a Windows DLL...

    – user2819245
    Mar 28 at 19:03












  • I already see something I haven't spotted till now it's triggering off GetProcAddress Maybe this is a bug report. So it's not even the part trying to load the libraries?

    – Robert Russell
    Mar 28 at 19:04






  • 1





    Yes, it is not the part trying to load the libraries. It seems FFmpeg.Autogen has some hard-coded dependency/ies on the WinAPI. Best to check the issue tracker for FFmpeg.Autogen if the issue has already been reported, and if not, best to write a new issue report about the lacking Non-Windows compatibility.

    – user2819245
    Mar 28 at 19:06






  • 1





    Perhaps there is a platorm-neutral version of FFmpeg.Autogen available (in other words, a .NET standard port/build)? I don't know. According to the github frontpage of FFmpeg.Autogen, it should run in Linux. Are you perhaps using an old, outdated version that might not be Linux-compatible?

    – user2819245
    Mar 28 at 19:07












  • I think it's a NET45 issue that broke stuff in NET2 he has a switch case choosing which function to use. in NET45 he had it only using the windows function.

    – Robert Russell
    Mar 28 at 19:11












  • 1





    Clearly the C# code tries to directly P/Invoke the GetProcAddress, which is a WinAPI method, requiring kernel32.dll - a Windows DLL...

    – user2819245
    Mar 28 at 19:03












  • I already see something I haven't spotted till now it's triggering off GetProcAddress Maybe this is a bug report. So it's not even the part trying to load the libraries?

    – Robert Russell
    Mar 28 at 19:04






  • 1





    Yes, it is not the part trying to load the libraries. It seems FFmpeg.Autogen has some hard-coded dependency/ies on the WinAPI. Best to check the issue tracker for FFmpeg.Autogen if the issue has already been reported, and if not, best to write a new issue report about the lacking Non-Windows compatibility.

    – user2819245
    Mar 28 at 19:06






  • 1





    Perhaps there is a platorm-neutral version of FFmpeg.Autogen available (in other words, a .NET standard port/build)? I don't know. According to the github frontpage of FFmpeg.Autogen, it should run in Linux. Are you perhaps using an old, outdated version that might not be Linux-compatible?

    – user2819245
    Mar 28 at 19:07












  • I think it's a NET45 issue that broke stuff in NET2 he has a switch case choosing which function to use. in NET45 he had it only using the windows function.

    – Robert Russell
    Mar 28 at 19:11







1




1





Clearly the C# code tries to directly P/Invoke the GetProcAddress, which is a WinAPI method, requiring kernel32.dll - a Windows DLL...

– user2819245
Mar 28 at 19:03






Clearly the C# code tries to directly P/Invoke the GetProcAddress, which is a WinAPI method, requiring kernel32.dll - a Windows DLL...

– user2819245
Mar 28 at 19:03














I already see something I haven't spotted till now it's triggering off GetProcAddress Maybe this is a bug report. So it's not even the part trying to load the libraries?

– Robert Russell
Mar 28 at 19:04





I already see something I haven't spotted till now it's triggering off GetProcAddress Maybe this is a bug report. So it's not even the part trying to load the libraries?

– Robert Russell
Mar 28 at 19:04




1




1





Yes, it is not the part trying to load the libraries. It seems FFmpeg.Autogen has some hard-coded dependency/ies on the WinAPI. Best to check the issue tracker for FFmpeg.Autogen if the issue has already been reported, and if not, best to write a new issue report about the lacking Non-Windows compatibility.

– user2819245
Mar 28 at 19:06





Yes, it is not the part trying to load the libraries. It seems FFmpeg.Autogen has some hard-coded dependency/ies on the WinAPI. Best to check the issue tracker for FFmpeg.Autogen if the issue has already been reported, and if not, best to write a new issue report about the lacking Non-Windows compatibility.

– user2819245
Mar 28 at 19:06




1




1





Perhaps there is a platorm-neutral version of FFmpeg.Autogen available (in other words, a .NET standard port/build)? I don't know. According to the github frontpage of FFmpeg.Autogen, it should run in Linux. Are you perhaps using an old, outdated version that might not be Linux-compatible?

– user2819245
Mar 28 at 19:07






Perhaps there is a platorm-neutral version of FFmpeg.Autogen available (in other words, a .NET standard port/build)? I don't know. According to the github frontpage of FFmpeg.Autogen, it should run in Linux. Are you perhaps using an old, outdated version that might not be Linux-compatible?

– user2819245
Mar 28 at 19:07














I think it's a NET45 issue that broke stuff in NET2 he has a switch case choosing which function to use. in NET45 he had it only using the windows function.

– Robert Russell
Mar 28 at 19:11





I think it's a NET45 issue that broke stuff in NET2 he has a switch case choosing which function to use. in NET45 he had it only using the windows function.

– Robert Russell
Mar 28 at 19:11












1 Answer
1






active

oldest

votes


















1
















https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109#issuecomment-477756443



Ruslan-B said he's going to fix it.



After applying a fix it's mostly working I figure I'm only not seeing video because the colorspace i'm using is wrong for linux that's my guess. Audio is working fine.



But this issue is closed.



Elgonzo in comments helped point out the correct issue was not the libraries failing to load. And that it is that FFmpeg.Autogen is using the wrong windows-only function.






share|improve this answer

























  • I figured out why it wasn't drawing the video in the question below. So everything is working now. And the fix has been applied to FFmpeg.Autogen. stackoverflow.com/questions/55437187/…

    – Robert Russell
    Apr 15 at 9:53













Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55405051%2fkernel32-not-found-when-using-ffmpeg-autogen-4-1-0-2-in-mono-linux%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1
















https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109#issuecomment-477756443



Ruslan-B said he's going to fix it.



After applying a fix it's mostly working I figure I'm only not seeing video because the colorspace i'm using is wrong for linux that's my guess. Audio is working fine.



But this issue is closed.



Elgonzo in comments helped point out the correct issue was not the libraries failing to load. And that it is that FFmpeg.Autogen is using the wrong windows-only function.






share|improve this answer

























  • I figured out why it wasn't drawing the video in the question below. So everything is working now. And the fix has been applied to FFmpeg.Autogen. stackoverflow.com/questions/55437187/…

    – Robert Russell
    Apr 15 at 9:53















1
















https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109#issuecomment-477756443



Ruslan-B said he's going to fix it.



After applying a fix it's mostly working I figure I'm only not seeing video because the colorspace i'm using is wrong for linux that's my guess. Audio is working fine.



But this issue is closed.



Elgonzo in comments helped point out the correct issue was not the libraries failing to load. And that it is that FFmpeg.Autogen is using the wrong windows-only function.






share|improve this answer

























  • I figured out why it wasn't drawing the video in the question below. So everything is working now. And the fix has been applied to FFmpeg.Autogen. stackoverflow.com/questions/55437187/…

    – Robert Russell
    Apr 15 at 9:53













1














1










1









https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109#issuecomment-477756443



Ruslan-B said he's going to fix it.



After applying a fix it's mostly working I figure I'm only not seeing video because the colorspace i'm using is wrong for linux that's my guess. Audio is working fine.



But this issue is closed.



Elgonzo in comments helped point out the correct issue was not the libraries failing to load. And that it is that FFmpeg.Autogen is using the wrong windows-only function.






share|improve this answer













https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/109#issuecomment-477756443



Ruslan-B said he's going to fix it.



After applying a fix it's mostly working I figure I'm only not seeing video because the colorspace i'm using is wrong for linux that's my guess. Audio is working fine.



But this issue is closed.



Elgonzo in comments helped point out the correct issue was not the libraries failing to load. And that it is that FFmpeg.Autogen is using the wrong windows-only function.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 28 at 21:38









Robert RussellRobert Russell

747 bronze badges




747 bronze badges















  • I figured out why it wasn't drawing the video in the question below. So everything is working now. And the fix has been applied to FFmpeg.Autogen. stackoverflow.com/questions/55437187/…

    – Robert Russell
    Apr 15 at 9:53

















  • I figured out why it wasn't drawing the video in the question below. So everything is working now. And the fix has been applied to FFmpeg.Autogen. stackoverflow.com/questions/55437187/…

    – Robert Russell
    Apr 15 at 9:53
















I figured out why it wasn't drawing the video in the question below. So everything is working now. And the fix has been applied to FFmpeg.Autogen. stackoverflow.com/questions/55437187/…

– Robert Russell
Apr 15 at 9:53





I figured out why it wasn't drawing the video in the question below. So everything is working now. And the fix has been applied to FFmpeg.Autogen. stackoverflow.com/questions/55437187/…

– Robert Russell
Apr 15 at 9:53




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55405051%2fkernel32-not-found-when-using-ffmpeg-autogen-4-1-0-2-in-mono-linux%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현