Design of Embedded Video Monitoring System Based on B/S Mode

Publisher:SparklingMoonLatest update time:2010-05-07 Keywords:Embedded Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The video surveillance system accurately, clearly and quickly transmits the real-time images and data of the monitored scene to the monitoring center server. The monitoring center can directly and directly grasp the current situation of each monitored scene (including images, sounds and other sensitive data) in real time, so as to respond quickly to sensitive events [1]. Video surveillance is booming towards digital, networked and integrated embedded video surveillance. Compared with traditional video acquisition monitoring systems, embedded video surveillance systems have the advantages of high reliability, convenient networking and remote monitoring, and are therefore more suitable for security systems in industrial control, banks and government departments [2].

This paper designs an embedded video surveillance system with the characteristics of zero user maintenance, low price, stable performance, etc. The system uses ARM processor S3C2440 and embedded Linux operating system as the core platform, collects video data through USB camera, and transmits network data based on TCP/IP protocol. Users can monitor remote video through browser, and the video can be saved for playback.

1 Video surveillance system design

1.1 Monitoring system hardware platform design

The hardware platform of the monitoring system is the foundation of the entire monitoring system and plays a vital role in the system design. The success or failure of hardware selection directly determines the quality of the system function. The main hardware in this design includes NAND FLASH, embedded processor S3C2440, SDRAM, network card, USB interface camera, etc.

The hardware structure of the video surveillance system is shown in Figure 1. The system is based on the S3C2440 processor and other peripheral devices. The S3C2440 processor is a highly integrated chip developed by SAMSUNG based on the ARM920T processor core of ARM. It has a main frequency of 400 MHz and provides a relatively complete set of universal peripheral device interfaces. It supports NAND FLASH booting with a very high cost performance and can support the porting of multiple operating systems such as Linux [3].

1.2 Monitoring system software design

This system selects Linux operating system as the software development platform, the compilation environment adopts cross-compilation and debugging, the embedded Linux kernel uses 2.6.13, and the root file system uses yaffs.

A complete video surveillance system should at least include functions such as video data acquisition, processing, transmission, storage and control. In order to achieve the above functions well, this system is divided into three functional modules: embedded streaming media server, embedded Web server and user video surveillance terminal. The embedded streaming media server module mainly realizes functions such as video data acquisition, storage and transmission; the embedded Web server module is responsible for processing requests sent by the monitoring terminal and providing a monitoring platform for users through interaction with the browser; the user video surveillance terminal module realizes real-time monitoring of remote videos and can control the brightness and contrast of the video.

2 Implementation of Embedded Streaming Media Server

The main functions of the streaming media server module are video acquisition, video compression, video storage and video transmission. This system uses a USB camera with the ZC0301 chip produced by Vimicro Corporation. The ZC0301 is mainly composed of five functional modules, namely system control, image signal processing, subsampling and horizontal scanning module, JPEG encoder and USB device control [4]. Cameras using this chip are the most widely used and easy to purchase and maintain. After being processed by this chip, the bit stream obtained is JPEG encoded, which realizes video compression.

2.1 Video Capture Based on Video4Linux

[page]

Video4Linux (V4L for short) is a kernel driver for video devices in Linux. It provides a system interface function for application programming of video devices. The basic process of video acquisition is shown in Figure 2. Programming USB cameras using V4L requires two system calls under Linux, namely ioctl() and mmap().

The V4L standard provides multiple data structures and control commands. The program controls the device by calling functions to complete the task of video acquisition. The main device control commands in the ioctl() function are:

(1) VIDIOCGCAP: Get basic information about the acquisition device, such as the maximum and minimum resolutions supported;

(2)VIDIOCSPICT, VIDIOCGPICT: respectively set and obtain various attributes of the acquired image;

(3)VIDIOCGMBUF: Get buffer information, such as the size of each frame, the maximum number of frames supported, etc.

(4) VIDIOCMCAPTURE: capture images and obtain image information;

(5)VIDIOCSYNC: Waiting for the acquisition of one frame of image to be completed.

There are two ways for applications to obtain image data collected by the camera, namely read() (direct reading method) and mmap() (memory mapping method). The mmap() system call enables memory sharing between processes by mapping the same file. The advantage is high efficiency, because the process can directly read and write memory without any data copying, which speeds up I/O access. This system adopts this method.

[page]

2.2 Video transmission based on TCP/IP protocol

TCP/IP refers to two network protocols used on the Internet, namely the Transmission Control Protocol and the Internet Protocol. TCP is a reliable point-to-point protocol, and IP is a transport layer protocol. The TCP/IP protocol suite can connect various operating systems and network components, and it provides a standard method for moving data between various systems[5].

In this system, the server first creates a socket through the socket function and binds the socket to a port using the bind function; then calls the listen function, the server will be in the * state, waiting for the user monitoring end to request to connect to the specified port; when receiving the connection request from the user monitoring end, the server calls the accept function to establish communication with the user monitoring end; after successfully establishing communication, communication can be carried out through the read function or write function.

This system can be used for human-computer interaction. Users can transmit control information to the video server through the web page, such as adjusting the frame rate, brightness, etc. When the connection is established, the user monitoring end first sends a client_t structure data containing control information to the video server; then the video server collects a frame of video data based on the control information, and generates a frame_t structure data containing this frame of video information, and sends them to the user monitoring end. This completes a human-computer interaction, and this cycle continues to achieve data transmission.

3 Implementation of Embedded Web Server

3.1 Selection of Embedded Web Server

There are three main embedded Web servers under Linux, namely httpd, thttpd and Boa. httpd is the simplest Web server with the weakest function. It does not support authentication and CGI. Both thttpd and Boa support authentication and CGI, and have relatively complete functions. This system uses the Boa Web server, which processes multiple HTTP connection requests by establishing an HTTP request list, saving system resources, which is crucial for embedded systems. At the same time, it also has functions such as automatic directory generation and automatic file decompression. Boa has a high HTTP request processing speed and efficiency, and has high application value in embedded systems.

3.2 Porting and Configuration of Boa on ARM

(1) Transplantation process

Download Boa source code from http://www.boa.org/ , select boa-0.94.13.tar.gz, and enter the decompression command "tar xzvf boa-0.94.13.tar.gz"; enter the src subdirectory under the decompressed source code directory, enter the command "./configure" to generate the Makefile file; modify the Makefile file, change the values ​​of CC and CPP to the path where the cross-compiler is installed; enter the command "make" to cross-compile and generate the executable file Boa, and download it to /bin under the root file system through the serial port to achieve the transplantation.

(2) Configuration

Create a new Boa directory in the /etc directory, which stores the main Boa configuration file boa.conf. There is a sample boa.conf in the Boa source directory, which can be modified based on it; change Group nogroup to Group root, change User nobody to User root, where root is the group and user of the development board; change #ServerName www.your.org.here to ServerName cs2440; change DocumentRoot /var/www to DocumentRoot /www, set the main directory of HTML documents to /www, and use the default settings for other settings. In addition, you also need to copy the mime.types file to the /etc directory, which can usually be copied directly from the /etc directory of the Linux host.

4 Implementation of user video monitoring terminal based on B/S mode

The system adopts the B/S model. Compared with the C/S model, users do not need to do any maintenance. This saves users' manpower, material resources, time and costs. It can also be operated across platforms, which is really convenient for users.

The system develops Java Applet applications and embeds them into web pages. The web page name is set as the default home page name of the Boa Web server and saved in /www. The user enters the IP address of the video server in the browser address bar to display the surveillance image of the camera on the web page. The Java Applet interacts with the video server to control, transmit and play video data. The main functional steps and main functions in the Java Applet program can be described as:

[page]

(1) Create a socket, input stream, and output stream.

connection=new Socket(m_strServer,port);

in=connection.getInputStream();

ut=connection.getOutputStream();

The IP address and port are passed in as parameters of the part embedded in HTML, and the input and output streams of this Socket object are created.

(2) Allocate receive buffer: byte[]buffer = new byte[512*1024];

(3) Send a user control message. It is generated by the user clicking an icon with the mouse. When the user clicks the video window in the browser, icons such as brightness will be displayed at the top. Control information can be written by clicking the "+" and "-" on both sides of the icon. When clicking anywhere other than the icon, the icon disappears, realizing full-window video, which is easy to monitor and simple to operate.

Public void mouse(MouseEvent evt) {…};

out.write(b); //b is the name of the character array containing control information

(4) Read a frame of image header information to confirm the correctness of the image data and obtain the size of the image data.

n=in.read(buffer,0,HDRLEN); //HDRLEN is the length of the image information header, set to 50 B

The agreed characters contained in the header information are judged. If they are correct, the image data can be received. If they are incorrect, the system returns to (3).

(5) Read the image data and write the image data after the header information into the buffer for playback and display.

r=in.read(buffer,HDRLEN,buffer.length-HDRLEN);

(6) Realize image display. Since the buffer contains image header information, in order to use the image data alone, the image data needs to be copied to another buffer buffer2.

BufferedImage image= ImageIO.read(new ByteArrayInputStream(buffer2));

ImageIcon ii=new ImageIcon(image);

m_label.setIcon(ii); //Display image

Through the continuous loop operation of (3) to (6) above, users can see continuous dynamic images on the monitoring web page. The effect is very good, the picture is smooth, there is no obvious delay, and video monitoring is realized.

Compared with the traditional C/S mode, the B/S-based embedded video surveillance system proposed in this paper truly realizes zero maintenance for users, can monitor across platforms, and is convenient for users. The combination of embedded processors and Linux operating systems well demonstrates the advantages of this monitoring system, such as integration, networking, and low power consumption, and can be widely extended to many fields such as industrial control, videophone, and traffic management.

Keywords:Embedded Reference address:Design of Embedded Video Monitoring System Based on B/S Mode

Previous article:Image Enhancement Technology and Its Application in Video Surveillance
Next article:Application design of SoPC technology in image acquisition and processing system

Recommended ReadingLatest update time:2024-11-16 20:30

Linux 2.6.32 ported to MINI 2440 (1) Preliminary porting
    According to the manual provided by Friendly Arms - "MINI2440 Linux Porting and Development Practical Guide - Kernel Part - 2010.9.9" and some posts on the Internet, I would like to express my gratitude for their work. The basic process is mostly the same, mainly to familiarize yourself with the basic kernel porti
[Microcontroller]
s3c2440 migration u-boot-2016.03 Part 3 supports Nor flash recognition
When selected, NOR flash is enabled, and NOR FLASH can be accessed. /common/board_r.c 364 line: initr_flash() flash_size = flash_init(); /drivers/mtd/cfi_flash.c If you want to enable debugging, define this #define DEBUG flash_init() debug("JEDEC PROBE: ID %x %x %xn", info- manufacturer_id, info- device_id, info- devi
[Microcontroller]
s3c2440 migration u-boot-2016.03 Part 3 supports Nor flash recognition
ARM driver Linux kernel driver interrupt lower half programming
This article partially refers to Huaqing Yuanjian documents The upper half of the interrupt requires the execution of a time interval, so the code with longer processing time is often placed in the lower half of the interrupt for processing. Interrupt the application of the lower half: the upper half of the network
[Microcontroller]
ARM-Linux: Device-mixer-linux system sound effect adjustment
System: arm board/Linux system  kernel: 2.6.7  Device: /dev/mixer  Function: Linux system sound effect adjustment  File name: xxx.c  Compilation: gcc xxx.c -o mixerSet  Terminal execution: ./mixerSet   Test: No problem #include unistd.h #include stdlib.h #include stdio.h #include sys/ioctl.h #include fcntl.h #in
[Microcontroller]
Design of network projector system based on ARM9 core and embedded Linux
Projector networking is becoming an important trend in the development of projectors. Through standard wired and wireless network interfaces or optional network adapters, users can more conveniently transmit display control signals to the projector through a computer, display output content on the projector, and mon
[Microcontroller]
Design of network projector system based on ARM9 core and embedded Linux
ARM-Linux kernel transplantation--based on FL2440 development board (modified to Linux single system)
Hardware platform: FL2440 development board Kernel version: 2.6.28 Host: Ubuntu 11.04 Kernel version: 2.6.39   I originally thought that the size of the nand flash of fl2440 was 128M. I asked the customer service and found out that FL2440 now uses modern flash, which is now 256M. However, Feiling's bootloader
[Microcontroller]
ARM-Linux kernel transplantation--based on FL2440 development board (modified to Linux single system)
OK6410A Development Board (VIII) 99 linux-5.11 OK6410A File Access Example Comparison between mmap and read
Implementation of mmap and write The implementation of both of them actually focuses on Linux, so to compare their differences, we should pay attention to the differences in the following processes in the Linux kernel: open - addr=mmap(...); - addr - close open - read - close Same point To get the "file contents
[Microcontroller]
Teach you how to write Linux device drivers step by step --- interrupt (three) -- workqueue implementation (based on friendlyarm 4412 development board)
In the previous section, we talked about how to implement the tasklet mechanism http://blog.csdn.NET/morixinguan/article/details/69666935 In this section, we will implement the work queue for the lower half of the interrupt: Before writing this demo, we need to understand the relevan
[Microcontroller]
Teach you how to write Linux device drivers step by step --- interrupt (three) -- workqueue implementation (based on friendlyarm 4412 development board)
Latest Security Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号