title: Extracting frames from image in C#
body: <p>I`ve seen some stackover flow on how to do this but i cant get it to work for myself in visual studio.</p>
  
  <p>What is wrong with code? I have downloaded FFMpeg and im using it as reference. yet, I get the error </p>
  
  <blockquote>
    <p>"Could not load file or assembly Aforge.Video.FFMPEG. dll or one of
    its dependencies"</p>
  </blockquote>
  
  <p>Here is the code.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using AForge;
  using AForge.Video;
  using AForge.Video.FFMPEG;
  
  namespace WindowsFormsApplication6
  {
  public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          // create instance of video reader
          VideoFileReader reader = new VideoFileReader( );
          // open video file
          reader.Open( "test.avi" );
          // read 100 video frames out of it
          for ( int i = 0; i &lt; 100; i++ )
          {
          Bitmap videoFrame = reader.ReadVideoFrame( );
  
          videoFrame.Save(i + ".bmp");
  
          // dispose the frame when it is no longer required
          videoFrame.Dispose( );
          }
          reader.Close( );
      }
  } 
  }
  </code></pre>
  
  <p>The program stop when i click the button and comes with an error.</p>