IP摄像机

什么是IP摄像机

IP摄像机的主要优点是直接以数字流的形式输出,可以直接通过以太网进行访问。因此,IP摄像机不仅仅拥有摄像头而且还有嵌入式的计算机板子,一般运行linux系统,原因有一下两条:1把模拟图像信号转换为数字图像信号。2能够通过IP地址访问图像,要配备网卡。视频服务器是非常复杂的设备,一般不配备摄像头,但是预留有一些摄像头接口,可以通过接口进行连接,能够把模拟图像信号转换为数字图像信号并提供网络访问功能。

事实上网络摄像机和服务器有很多优点,如可以随时随地在任何有网络的地方访问摄像头,不再像传统的那样仅仅拘泥于本地访问,而且访问设备也是多样化的如服务器,小型机,pad 和智能手机等等。它的运用也更加广泛,交通,家庭监控,医院等等。

视频格式

 

 

string sourceURL = "http://webcam.mmhk.cz/axis-cgi/jpg/image.cgi";
byte[] buffer = new byte[100000];
int read, total = 0;
// create HTTP request
HttpWebRequest req = (HttpWebRequest) WebRequest.Create( sourceURL );
// get response
WebResponse resp = req.GetResponse( );
// get response stream
Stream stream = resp.GetResponseStream( );
// read data from stream
while ( ( read = stream.Read( buffer, total, 1000 ) ) != 0 )
{
    total += read;
}
// get bitmap
Bitmap bmp = (Bitmap) Bitmap.FromStream( 
              new MemoryStream( buffer, 0, total ) );

 

  但是好多摄像头都是需要口令才能进入的因此需要添加

// create HTTP request
HttpWebRequest req = 
   (HttpWebRequest) WebRequest.Create( sourceURL );
// set login and password
req.Credentials = new NetworkCredential( login, password );
...

 

posted @ 2012-09-21 19:20  射手炎魂  阅读(349)  评论(0编辑  收藏  举报