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.
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
- Popular Resources
- Popular amplifiers
- Mir T527 series core board, high-performance vehicle video surveillance, departmental standard all-in-one solution
- Akamai Expands Control Over Media Platforms with New Video Workflow Capabilities
- Tsinghua Unigroup launches the world's first open architecture security chip E450R, which has obtained the National Security Level 2 Certification
- Pickering exhibits a variety of modular signal switches and simulation solutions at the Defense Electronics Show
- Parker Hannifin Launches Service Master COMPACT Measuring Device for Field Monitoring and Diagnostics
- Connection and distance: A new trend in security cameras - Wi-Fi HaLow brings longer transmission distance and lower power consumption
- Smartway made a strong appearance at the 2023 CPSE Expo with a number of blockbuster products
- Dual-wheel drive, Intellifusion launches 12TOPS edge vision SoC
- Toyota receives Japanese administrative guidance due to information leakage case involving 2.41 million pieces of user data
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- TI Battery Tester Reference Design for High Current Applications
- [ESK32-360 Review] + TFT screen display function and expansion (1)
- [NXP Rapid IoT Review] Part 2: Detailed tutorial of online IDE - Open Rapid IoT to see the weather...
- 【GD32L233C-START Review】3. Implementation of USB keyboard
- Master the wireless communication signal transmission model in one article
- Oscilloscope Travel Guide Higher bandwidth, lower noise, more channels. Let's go on a spontaneous trip with Xiaotai!
- What is the secret to keep your spectrum analyzer from getting sick?
- Share a TI Da Vinci series support website
- FPGA Simplified Design Method Case 4
- Let's learn to design PWM breathing light