PDA

View Full Version : آموزش: Ready Project for Connect to IP Camera in C#‎‎‎ 1



sali2010
دوشنبه 06 دی 1395, 14:03 عصر
connect to ip camera in C#‎‎‎‎‎‎ using AForge library (Visual Studio 2013)h
you need url of IP Camera , so you can search on google and find url of camera
example for search in google:
'url EasyN' , 'url panasonic' , 'url hikvision'
example for url:
"http://192.168.1.198/videostream.cgi?user=admin&pwd="
you can download project from: http://www.uplooder.net/files/f7ced6d24b8b8ca3f179e713e4e1a2fc/WindowsFormsApplication14.zip.html


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 WindowsFormsApplication14
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}


private void button1_Click(object sender, EventArgs e)
{
AForge.Video.MJPEGStream videoSource = new MJPEGStream("http://192.168.1.198/videostream.cgi?user=admin&pwd=");
videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
videoSource.Start();



}
public void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
Bitmap img = (Bitmap)eventArgs.Frame.Clone();
//do processing here
picBox.Image = img;
}
}
}