1
if (_capture == null)
        {
            try
            {
                _capture = new Capture("video1.mpg");
            }
            catch (NullReferenceException ex)
            {   //show errors if there is any
                MessageBox.Show(ex.Message);
            }
        }

video1.mpg ファイルは bin フォルダーにあります。any-video-converter を使用して、avi ファイルを MPEG-1 形式に変換しました。 しかし、まだこの形式は機能していません。私もmencoderを試しました。それでも同じエラー。

Unable to create capture from video1.mpg

emguと互換性を持たせるにはCapture

4

2 に答える 2

1

まず、Vedio ファイルを .avi 形式に変換し、他のツールを使用して必要な vedio ファイルを変換する必要があります。現在使用しているツールはデモ版である可能性があり、そのため正しく変換されない可能性があります..そして、次のコードを試してください:

   string nameOfFile = @"D:\somefile.avi";// your vedio path
Capture _capture = new Capture(name);
      try
        {
            _capture = new Capture(nameOfFile);
        }
        catch (NullReferenceException ex)
        {   //show errors if there is any
            MessageBox.Show(ex.Message);
        }
于 2015-03-06T08:01:41.620 に答える