xVir / aforge

Automatically exported from code.google.com/p/aforge
Other
1 stars 0 forks source link

How To Extract specific Frame in video file using AForge Library #375

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
hi i m trying to extract the specific frame on current video file.i have a 
frame what i want when i play a video file with aforge library and called new 
frame event if new frame match with my specific frame then it show me a message 
frame match.this specific frame randomly appears in a video file here is my code

private void Form1_Load(object sender, EventArgs e)
{
    IVideoSource videoSource = new FileVideoSource(@"e:\media\test\a.mkv");
    playerControl.VideoSource = videoSource;
    playerControl.Start( );
    videoSource.NewFrame += new AForge.Video.NewFrameEventHandler(Video_NewFrame );
}

private void Video_NewFrame(object sender, AForge.Video.NewFrameEventArgs 
eventArgs)
{
    //Create Bitmap from frame
    Bitmap FrameData = new Bitmap(eventArgs.Frame);
    //Add to PictureBox
    pictureBox1.Image   = FrameData;
    //compare current frame to specific fram
    if (pictureBox1.Image == pictureBox2.Image)
    {
        MessageBox.Show("Frame Match");  
    }
}
pictureBox2.image is a fix frame that i want to match .this code is working 
fine to play video file and extract new frame but i m unable to compare new 
frame to specific frame.please guide me how to achieve this.

Original issue reported on code.google.com by zahid.ma...@gmail.com on 5 Jan 2014 at 4:35

GoogleCodeExporter commented 9 years ago

Original comment by andrew.k...@gmail.com on 5 Jan 2014 at 7:40