来自IP摄像机的视频使用Aforge.Net库 [英] video from IP camera using the Aforge.Net library

查看:129
本文介绍了来自IP摄像机的视频使用Aforge.Net库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用WinForm中的Aforge.Net库从IP摄像机获取实时视频流。

我不知道我错在哪里,因为代码编译但没有流我的C#应用​​程序。

我试过Andrew Kirilow的文章摄像机视觉 - C#上的视频监控 它没有编译。以下是我到目前为止所尝试的内容



 使用系统; 
使用 System.Collections.Generic;
使用 System.ComponentModel;
使用 System.Data;
使用 System.Drawing;
使用 System.Linq;
使用 System.Text;
使用 System.Windows.Forms;

使用 AForge.Controls;
使用 AForge;
使用 AForge.Video.DirectShow;
使用 AForge.Video;
使用 PictureBox = AForge.Controls.PictureBox;

命名空间 test2
{
public partial class Form1:Form
{

public PictureBox picBox;
public Form1()
{
InitializeComponent();
}

public void video_NewFrame( object sender,NewFrameEventArgs eventArgs)
{
Bitmap img =(Bitmap)eventArgs.Frame.Clone();
// 在此处理
picBox.Image = img;
}

private void picBox_Click( object sender,EventArgs e)
{
MJPEGStream videoSource = new MJPEGStream( http:// admin:admin@192.168.1.227:81 / videostream.cgi?rate = 11);
videoSource.NewFrame + = new NewFrameEventHandler(video_NewFrame);
videoSource.Start();
}
}
}

解决方案

我搜索并得到答案这是你可以获得直接代码的链接只需从链接下载34.8MB fileNameAForge.NET Framework 2.2.4 ZIP精选



http://code.google .com / p / aforge / downloads / list





然后exract然后去打开得到样品然后视频然后播放器然后运行项目视觉工作室和享受IP摄像头代码









提前欢迎

I am trying to get live video stream from IP camera using the Aforge.Net library in WinForm.
I do not know where i am wrong, since the code compiles but there is no stream in my C# application.
I have tried the Article by Andrew Kirilow Camera Vision - video surveillance on C# it did not compiled. Following is what i have tried so far

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using AForge.Controls;
using AForge;
using AForge.Video.DirectShow;
using AForge.Video;
using PictureBox = AForge.Controls.PictureBox;

namespace test2
{
    public partial class Form1 : Form
    {
        
        public PictureBox picBox;
        public Form1()
        {
            InitializeComponent();
        }

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

        private void picBox_Click(object sender, EventArgs e)
        {           
            MJPEGStream videoSource = new MJPEGStream("http://admin:admin@192.168.1.227:81/videostream.cgi?rate=11");
            videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
            videoSource.Start();
        }
    }
}

解决方案

i searched and get answer this is the link where u can get direct code just download 34.8MB fileName"AForge.NET Framework 2.2.4 ZIP Featured" from link

"http://code.google.com/p/aforge/downloads/list"


then exract then go to open got to sample then video then player then run project visual studio and enjoy ip camera code




advance welcome


这篇关于来自IP摄像机的视频使用Aforge.Net库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆