AForge.Video.FFMPEG used in C#

本文关键字:in used FFMPEG Video AForge | 更新日期: 2023-09-27 17:56:41

我使用 Visual C# 2008 并希望从 bmp 序列编写 AVI 文件。

我找到了AForge.Video.VWF,但它仅适用于"vmw3"或"DIB"编解码器,我想使用AForge.Video.FFMPEG,但它得到了错误。

例如,我只是编码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AForge.Video.FFMPEG;
namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            VideoFileWriter vfw = new VideoFileWriter();
        }
    }
}

但我得到了这个filenotfoundexception

{"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null}

AForge.Video.FFMPEG used in C#

为了正确使用AForge.Video.FFMPEG,您必须确保将FFmpeg dll包含在输出文件夹中。最简单的方法是将它们添加到VS项目中,继续其属性并将"复制到输出目录"选项设置为"始终"。

AForge 使用的 FFmpeg 二进制文件可以在 AForge.NET 的外部文件夹中找到,通常在 C:''Program Files (x86)''AForge.NET''Framework''Externals''ffmpeg''bin

不确定这是否仍然相关,但下载 Accord.Video.FFMPEG 会为您解决这个问题,只需记住显式构建到 x86

使用Accord.Video.FFMPEG;

发生这种情况是因为这个AForge.Video.FFMPEG.DLL依赖于另一个dll。 将所有DLL复制到输出文件夹中。