在C#中使用AForge.Video.FFMPEG

cuo*_*yen 7 c# ffmpeg aforge

我使用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();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但我得到了这个 filenotfoundexception

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

Ces*_*sar 11

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

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

  • 这已在最新的Accord.NET NuGet包中修复.如果从NuGet下载Accord.Video.FFMPEG,则应自动安装FFMPEG dll并将其包含在输出目录中. (2认同)