AForge在加载大尺寸AVI文件时显示错误:“无法打开指定的AVI文件”

时间:2018-06-18 04:18:55

标签: c# video aforge avi

我开发了一个原型来捕获和重放视频文件(* .avi)。为此,我使用 AForge API。在录制AVI文件时,我使用了 WMV3 压缩。问题在于视频重播模块,当我加载一个大尺寸的AVI文件时,它在以下行提供错误无法打开指定的AVI文件

_aviReader.Open(_videoFileName);

我已经在网上查了很多但是还没有找到任何解决方案。任何帮助或领导,以解决这个问题,将非常感激。

VideoReplay.cs

private void OpenVideoSource()
{
    try
    {
         if (_aviReader != null)
         {
              _aviReader.Close();
         }

         if (_videoFileName != null)
         {
             _aviReader.Open(_videoFileName);  // At this line, I am getting Error "A first chance exception of type 'System.IO.IOException' occurred in AForge.Video.VFW.dll" /*can't open the specified AVI file*/
             if (_aviReader == null)
             {
                 throw new ArgumentException(String.Format("{0} failed to read video file.", _videoFileName), "playFile");
             }
             else
             {
                 _totalFrames = _aviReader.Length;
                 _frameRate = _aviReader.FrameRate;
             }
         }
     }
     catch (Exception ex)
     {
         // Logging Error
     }
 }

0 个答案:

没有答案
相关问题