C# 无法加载文件或程序集';Accord.Video.FFMPEG.x64.DLL';或者它的一个依赖项。找不到指定的模块

C# 无法加载文件或程序集';Accord.Video.FFMPEG.x64.DLL';或者它的一个依赖项。找不到指定的模块,c#,ffmpeg,webforms,accord.net,C#,Ffmpeg,Webforms,Accord.net,正在尝试合并图像和音频文件以创建视频文件 我试过了 更改拱门(x86和x64) 手动将“Accord.Video.FFMPEG.x64.DLL”的所有相关.DLL移动到bin 同时使用Accord和Aforge,两者都有相同的问题 已安装VC++可在2013年和2015-19年重新分发 基本代码如下: private const string _basePath = @"D:\R&D Projects\AudioVideoConvertor\VideoAudioMerger

正在尝试合并图像和音频文件以创建视频文件

我试过了

  • 更改拱门(x86和x64)
  • 手动将“Accord.Video.FFMPEG.x64.DLL”的所有相关.DLL移动到bin
  • 同时使用Accord和Aforge,两者都有相同的问题
  • 已安装VC++可在2013年和2015-19年重新分发
基本代码如下:

private const string _basePath = @"D:\R&D Projects\AudioVideoConvertor\VideoAudioMerger\VideoAudioMerger\Images\";

    protected void Page_Load(object sender, EventArgs e)
    {
        int width = 2500;
        int height = 2100;
        int frameRate = 10;// Shuld be fix
        using (var videoWriter = new VideoFileWriter())
        {
            // default frame size 340, 220
            videoWriter.Open(_basePath + "test.avi", width, height, frameRate, VideoCodec.WMV1);
            ResizeNearestNeighbor filter = new ResizeNearestNeighbor(width, height);
            var images = Directory.GetFiles(_basePath, "*.jpg");
            var tfile = TagLib.File.Create(_basePath + "audio.mp3");
            //string title = tfile.Tag.Title;
            TimeSpan duration = tfile.Properties.Duration;
            decimal timeinSecond = Math.Round((Convert.ToDecimal(duration.TotalSeconds) * frameRate) / images.Length);
            foreach (string img in images)
            {

                using (Bitmap image = Bitmap.FromFile(img) as Bitmap)
                {
                    //As per audio length rotate image in video frame.
                    for (int i = 0; i < timeinSecond; i++)
                    {
                        videoWriter.WriteVideoFrame(filter.Apply(image));
                    }
                }
            }
            videoWriter.Close();
            MergeAudioAndVideo();
        }
    }

    private static void MergeAudioAndVideo()
    {

        File.Delete(_basePath + "mergedvideo.avi");
        Process pss = new Process();
        ProcessStartInfo si = new ProcessStartInfo();
        si.FileName = @"D:\R&D Projects\AudioVideoConvertor\VideoAudioMerger\VideoAudioMerger\ffmpeg-win64-static\bin\ffmpeg.exe";
        si.UseShellExecute = false;
        si.CreateNoWindow = true;
        si.Arguments = "-i \"" + _basePath + "test.avi\" -i \"" + _basePath + "audio.mp3\" -c:v copy -c:a copy -map 0:v:0 -map 1:a:0 \"" + _basePath + "mergevideo1" + ".avi\"";
        pss.StartInfo = si;
        pss.Start();
        pss.WaitForExit();
        File.Delete(_basePath + "test.avi");
    }
Could not load file or assembly 'Accord.Video.FFMPEG.x64.DLL' or one of its dependencies. The specified module could not be found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Accord.Video.FFMPEG.x64.DLL' or one of its dependencies. The specified module could not be found.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FileNotFoundException: Could not load file or assembly 'Accord.Video.FFMPEG.x64.DLL' or one of its dependencies. The specified module could not be found.]
 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +232
 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +113
 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +23
 System.Reflection.Assembly.Load(String assemblyString) +35
 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +49

[ConfigurationErrorsException: Could not load file or assembly 'Accord.Video.FFMPEG.x64.DLL' or one of its dependencies. The specified module could not be found.]
 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +762
 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +259
 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +167
 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +238
 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +78
 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +334
 System.Web.Compilation.BuildManager.ExecutePreAppStart() +178
 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +746

[HttpException (0x80004005): Could not load file or assembly 'Accord.Video.FFMPEG.x64.DLL' or one of its dependencies. The specified module could not be found.]
 System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737