Webcam uses spcaserv in Linux to set up a network video surveillance server (v0.1b)

Source: Internet
Author: User
1. Network Monitoring Server description;

How can I use a camera for a time-based monitoring system? That is to say, there is a dedicated network control server, and other clients use network image monitoring software or a browser to constantly monitor the camera's location and everything that happens. I have never used professional video surveillance, nor do I know what professional devices they use or what functions they have. I understand the following network monitoring server applications:

* Time-to-time monitoring function: monitors the range monitored by cameras from time to time. * Data Stream collection function: Collects monitoring data streams from time to time for future preparation of searching for relevant image data. * The photo capture function: for example, capture a photo every five minutes; * timestamp function; * data backup function (additional );


2. Linux uses a webcam for the conditions and objectives required for network monitoring servers;

First, let's define the conditions and objectives we need to use the camera (webcam) for the network's on-demand control system;


2.1 required software environment and hardware equipment;

First:You must have a webcam camera that can be supported by Linux,See:How to drive webcam in Linux

Second:In the software environment, we use spcaserv for setup;

Third:In the network environment, we have to have a network environment. For example, if I want to test whether my network monitoring system is successful, I should have at least two machines in the LAN, although one can also be done, but whether other computers on the network can be seen is unknown if there are too few computers;


2.2 goals to be achieved;

* Time Monitoring: cross-platform access is supported, and all systems are accessible for viewing and monitoring. * data collection: can be performed on servers, but must run in a desktop environment; in a Linux client; due to software restrictions, you can only say this;


3. Linux webcam driver;

See:How to drive webcam in Linux


4. Set up a network monitoring server using spcaserv in Linux;


4.1 download the software spcaview;

:Http://mxhaard.free.fr/spca50x/Download>, I downloaded the current version: spcaview-20051212.tar.gz

The spcaview-20051212.tar.gz package contains a set of tools;

* The spcaview tool is used to record data streams and play data. It can also be used as a network monitoring client;
* Spcaserv is a Streaming Media Server. We use this tool to monitor the server;
* Spcacat is a simple image capturing tool and cannot be used for network monitoring clients;


4.2 install the spcaview software package;

Dependency;

This software depends on libsdl, you need to install it first: http://www.libsdl.org, I downloaded: SDL-1.2.10.tar.gz

Http://www.libsdl.org/download-1.2.php

 

[root@localhost ~]# tar zxvf SDL-1.2.10.tar.gz
[root@localhost ~]# cd SDL-1.2.10
[root@localhost SDL-1.2.10]# ./configure ; make ;make install

 

Install the spcaview package:

 

[root@localhost ~]# tar zxvf spcaview-20051212.tar.gz
[root@localhost ~]# cd spcaview-20051212
[root@localhost spcaview-20051212]# make ; make install

 

Configure the executable program path:

The executable tool is installed in the/usr/local/bin directory, so we need to configure the user's environment variable path. Configure the command execution path and add the following line to the. bashrc file in the current user's home directory;

 

export PATH=".:/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"

 

Run the following command;

 

[root@localhost spcaview-20051212]# source .bashrc

 

For more information about path configuration, see:Linux Command and executable program path settings; Linux File System Path understanding


4.3 configure and run the spcaserv server;


4.31 run the spcaserv server;

The spcaserv running method is as follows;

 

spcaserv [-h -d -g -f -s] [-w Port]

 

Parameter description:

-H to view help;-D/dev/videox specifies the camera device, such as/dev/video0-g use read method for grab instead MMAP-F image format, the default is yuv420p, fourcc i420 jpg jpeg fourcc mjpg YUV rjfourcc i420 R16 rgb565 16 bits fourcc rgb2 R24 RGB 24 bits fourcc rgb3 R32 RGB 32 bits fourcc rgb4-V raw data fourcc rawd-s settings resolution, width x height, such as 320x240, 640x480, or 160x120;-W specifies the network address or port of the server, such as 192.168.1.3: 8888


4.32 spcaserv running example;

I use 192.168.1.3 as the network monitoring server and specify that the server runs on port 8888. The screen displayed during client monitoring is 320x240;

 

[root@localhost spcaview-20051212]# spcaserv -s 320x240 -w 192.168.1.3:8888&

 


4.33 configure the httpd server so that the client can be viewed in the browser;

First:Install and configure the httpd server;

For the httpd server, which is commonly used in Linux, is the Apache server. you can install the httpd server by using the software package provided by your release, or compile and install it on your own. there are many such posts in the top posts in the org network discussion area. After the httpd server is installed, start the server.

In fedora or RedHat, if it is installed using the RPM package provided by fedora or RedHat, start it as follows;

 

[root@localhost spcaview-20051212]# /etc/init.d/httpd start

 

Second:Copy the http-Java-applet directory in the decompressed directory of the spcaview package to the Home Directory of the Web server;

For example, the default home directory of the httpd server of fedora is/var/www/html. I am clear on my machine, so I want to do the following work;

 

[root@localhost spcaview-20051212]# cp -R http-java-applet /var/www/html/webcam/
[root@localhost spcaview-20051212]# chmod -R 755 /var/www/html/webcam

 

Third:Go to the/var/www/html/webcam directory to create the video homepage;

 

[root@localhost spcaview-20051212]# cd /var/www/html/webcam
[root@localhost webcam]# cp index-sample.html index.htm

 

You can use the javasindex.htm file to change the content of the file, that is, change the foreign text to Chinese. You can do it as needed;


5. network client monitoring tools;

For client network monitoring, cross-platform clients only use browsers. This is the most convenient method. In addition, spcaview is available in Linux. Here we will introduce it one by one;


5.1 browser monitoring;


5.11 install JRE to allow the browser to support Java programs;

We can monitor it through a browser and use browser monitoring across platforms. In this way, no matter Linux, windows, MacOS, BSD, or other UNIX systems, as long as there is a GUI browser, in the desktop environment, you can monitor the range of the "controlled" by the camera (webcam.

Because the web page on the server contains Java controls, you must install the Java environment. Make the browser support Java Plug-ins.

In Linux, you can refer to: JRE installation and configuration to suit the environment in which Java programs run

In Windows, you can click the mouse to complete the operation;


5.12 browser monitoring example (cross-platform );
 

After JRE is installed, enter the spcaserv monitoring server address in the address bar of the browser to check whether the server address is displayed? For example, my server address is:

http://192.168.1.3/webcam/index.htm

, We can see that computers on the LAN can be monitored through Browsers;


5.2 Linux clients use spcaview;


5.21 spcaview monitors the network from time to time;

Spcaview is a Linux network client monitoring tool. It can also be used for local camera tests. If spcaserv occupies the camera, it can only be used as a network monitoring tool, use the-W parameter to specify the spcaserv server address;

The constant monitoring of spcaserv is very simple. You can get help through spcaserv-H. For example, we can get the monitoring data stream on the spcaserv server. You can use the following method;

 

[root@localhost ~]# spcaview -s 320x240 -w 192.168.1.3

 

Of course, you can run the preceding command on the server. If you run the command on the server, you must have a desktop environment;


5.22 use spcaview to collect data streams;

Data Stream collection can be performed on the server or the client. Of course, both the server and client have a desktop environment. The spcaview tool uploads data streams to a file through the-O parameter. You can also use the-Z parameter to compress data streams;

 

[Root @ localhost ~] # Spcaview-H Note: View help;

 

I tested and succeeded in collecting data by specifying the spcaserv server address in spcaview, because the data cannot be written to the output file. I will learn more first. If you have succeeded, please leave a message after this article. Thank you.

Sorry...


6. other network monitoring servers;


7. About this article;


8. Update logs;

The text of 2006.06.10 v0.1b has been completed and enters the revision phase;


9. references;

Spcaview-H
Spcaserv-H
Readme in spcaview;


10. related documents;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.