{"record":{"id":"8d04e07ff40bf2c8","repo":"stride3d/stride","slug":"could-not-find-function-functionname-in-ffmpeg-library","errorCode":null,"errorMessage":"Could not find function '{functionName}' in FFmpeg library '{libraryName}'.","messagePattern":"Could not find function '(.+?)' in FFmpeg library '(.+?)'\\.","errorType":"exception","errorClass":"EntryPointNotFoundException","httpStatus":null,"severity":"critical","filePath":"sources/engine/Stride.Video/FFmpeg/FFmpegUtils.cs","lineNumber":131,"sourceCode":"\n        // Resolves FFmpeg.AutoGen function pointers from libraries loaded by NativeLibraryHelper, so\n        // FFmpeg uses the same native resolution as the rest of the engine instead of ffmpeg.RootPath.\n        private sealed class StrideFunctionResolver : IFunctionResolver\n        {\n            public static readonly StrideFunctionResolver Instance = new();\n\n            public T GetFunctionDelegate<T>(string libraryName, string functionName, bool throwOnError)\n            {\n                if (!libraryHandles.TryGetValue(libraryName, out var handle) || handle == 0)\n                {\n                    if (throwOnError)\n                        throw new DllNotFoundException($\"FFmpeg library '{libraryName}' was not loaded.\");\n                    return default;\n                }\n                if (!NativeLibrary.TryGetExport(handle, functionName, out var function))\n                {\n                    if (throwOnError)\n                        throw new EntryPointNotFoundException($\"Could not find function '{functionName}' in FFmpeg library '{libraryName}'.\");\n                    return default;\n                }\n                return (T)(object)Marshal.GetDelegateForFunctionPointer(function, typeof(T));\n            }\n        }\n\n        /// <summary>\n        /// Converts a <see cref=\"AVDictionary\"/>* to a Dictionary&lt;string,string&gt;.\n        /// </summary>\n        /// <param name=\"avDictionary\">A pointer to a <see cref=\"AVDictionary\"/> struct</param>\n        /// <returns>A new dictionary containing a copy of all entries.</returns>\n        [NotNull]\n        internal static unsafe Dictionary<string, string> ToDictionary(AVDictionary* avDictionary)\n        {\n            var dictionary = new Dictionary<string, string>();\n            if (avDictionary == null)\n                return dictionary;\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Video/FFmpeg/FFmpegUtils.cs#L113-L149","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Ship the exact FFmpeg native binaries matching the Stride.Video binding versions instead of relying on system FFmpeg","Align system FFmpeg package versions with the expected binding versions","Rebuild/update bindings for the native FFmpeg version in use","Check for a corrupted/partially copied library; redeploy the native files"],"exampleFix":"// before\n// relying on system libavcodec\nsudo apt install libavcodec58\n// after\n// bundle matching natives with the app\ncsproj: <Content Include=\"runtimes/linux-x64/native/libavcodec.so.58\" CopyToOutputDirectory=\"PreserveNewest\" />","handlingStrategy":"validation","validationCode":"try { FFmpegUtils.EnsurePlatformSupport(); }\ncatch (EntryPointNotFoundException ex) { Log.Error($\"FFmpeg version mismatch: {ex.Message}\"); }","typeGuard":null,"tryCatchPattern":"try { media.Open(url); }\ncatch (EntryPointNotFoundException ex)\n{\n    Log.Error($\"FFmpeg export missing — bundle matching natives: {ex.Message}\");\n}","preventionTips":["Pin and bundle FFmpeg versions matching the bindings","Avoid relying on system FFmpeg for shipped apps","Test on clean machines without system FFmpeg"],"tags":["ffmpeg","entry-point","version-mismatch","native-library"],"backgroundTag":"missing-dependency","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}