stride3d/stride · critical · EntryPointNotFoundException

Could not find function

Error message

Could not find function '{functionName}' in FFmpeg library '{libraryName}'.

What it means

After locating a loaded FFmpeg library, GetFunctionDelegate resolves a named export via NativeLibrary.TryGetExport. This EntryPointNotFoundException is thrown (throwOnError=true) when the library loaded but does not export the requested function — typically a version mismatch between the native FFmpeg binaries and the bindings.

Solutions

  1. Ship the exact FFmpeg native binaries matching the Stride.Video binding versions instead of relying on system FFmpeg
  2. Align system FFmpeg package versions with the expected binding versions
  3. Rebuild/update bindings for the native FFmpeg version in use
  4. Check for a corrupted/partially copied library; redeploy the native files

Example fix

// before
// relying on system libavcodec
sudo apt install libavcodec58
// after
// bundle matching natives with the app
csproj: <Content Include="runtimes/linux-x64/native/libavcodec.so.58" CopyToOutputDirectory="PreserveNewest" />
Defensive patterns

Strategy: validation

Validate before calling

try { FFmpegUtils.EnsurePlatformSupport(); }
catch (EntryPointNotFoundException ex) { Log.Error($"FFmpeg version mismatch: {ex.Message}"); }

Try / catch

try { media.Open(url); }
catch (EntryPointNotFoundException ex)
{
    Log.Error($"FFmpeg export missing — bundle matching natives: {ex.Message}");
}

Prevention

When it happens

Trigger: Using native FFmpeg libraries whose version lacks a symbol the compiled bindings expect (older/newer avcodec/avutil/avformat), or a stripped/custom FFmpeg build missing optional functions.

Common situations: System-installed FFmpeg versions differing from the versions Stride was built against; partial upgrades of native binaries; minimal FFmpeg builds (e.g. distro builds with disabled features).

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/8d04e07ff40bf2c8. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Video/FFmpeg/FFmpegUtils.cs:131

        // Resolves FFmpeg.AutoGen function pointers from libraries loaded by NativeLibraryHelper, so
        // FFmpeg uses the same native resolution as the rest of the engine instead of ffmpeg.RootPath.
        private sealed class StrideFunctionResolver : IFunctionResolver
        {
            public static readonly StrideFunctionResolver Instance = new();

            public T GetFunctionDelegate<T>(string libraryName, string functionName, bool throwOnError)
            {
                if (!libraryHandles.TryGetValue(libraryName, out var handle) || handle == 0)
                {
                    if (throwOnError)
                        throw new DllNotFoundException($"FFmpeg library '{libraryName}' was not loaded.");
                    return default;
                }
                if (!NativeLibrary.TryGetExport(handle, functionName, out var function))
                {
                    if (throwOnError)
                        throw new EntryPointNotFoundException($"Could not find function '{functionName}' in FFmpeg library '{libraryName}'.");
                    return default;
                }
                return (T)(object)Marshal.GetDelegateForFunctionPointer(function, typeof(T));
            }
        }

        /// <summary>
        /// Converts a <see cref="AVDictionary"/>* to a Dictionary&lt;string,string&gt;.
        /// </summary>
        /// <param name="avDictionary">A pointer to a <see cref="AVDictionary"/> struct</param>
        /// <returns>A new dictionary containing a copy of all entries.</returns>
        [NotNull]
        internal static unsafe Dictionary<string, string> ToDictionary(AVDictionary* avDictionary)
        {
            var dictionary = new Dictionary<string, string>();
            if (avDictionary == null)
                return dictionary;

View on GitHub (pinned to 96fad776d2)