Introduction
Video surveillance systems in industrial, military and civilian fields have a wide range of applications, as the industry's safety and environmental monitoring plays an important role.
Video surveillance system is gradually by simulation of digitization, along with the rapid development of semiconductor technology and multimedia video codec technology matures, high performance, complex video streaming compression algorithm in embedded system applications become a reality. Now that the monitoring system uses the special-purpose processor or RISC embedded processor and DSP implementation of methods, this article on the ARM processor and software compression combined approach.Video surveillance system design
First, you need to master plan to the system, the system is divided into several functional modules, each module implementation.
The entire video monitoring system using C/S structure, from the body is divided into two parts: server and client. Server-side include S3C2410 platforms of acquisition, compression, transmission procedures, the client is running on a PC, extract, playback received. Video monitoring terminal from field camera capture real-time compression of video information, after the adoption of Ethernet transfer to video monitoring on the server.As system chart (Figure 1) shows, video image acquisition and packaging to send on the server side is complete, the image receives the unpacking and playback will be completed in the client.
System hardware design
The system is modular in design, mainly include the following modules: main controller module, Stockpiling circuit module, peripheral interface circuit module, power, and reset circuit, as shown in Figure 2.
S3C2410 master module
Master module is the core of the entire system, using a Samsung S3C2410 processor is a processor core ARM920T based company of 16/32-bit micro-controller, the processor maximum operating frequency may reach 203MHz, its low power consumption, simplify and full static design particularly suitable for cost and power sensitive applications.
S3C2410 provides a wealth of on-chip resources to support Linux, is a suitable choice of the system. It can complete the entire system of scheduling work, in the system is electrified all required work of configured chip function registers, the complete encoding of the video stream, and through the Ethernet controller controls the physical layer chips send video code stream.System memory module
Master also need some external storage unit such as Nand Flash and SDRAM.
Nand Flash contains a Linux Bootloader, kernel and file systems, applications, and environment variables and system configuration files; SDRAM read and write speed, the system is running as a memory unit. The design incorporates a Nand Flash and 64M 64M SDRAM.Peripheral circuit module
This is designed to have a USB interface for peripherals, network interface, RS232 interface and JTAG interface.
Video monitoring terminal of the USB host controller module through a dedicated USB hub and multiple USB camera connected.
In the live monitoring mode, the camera captured image data through USB hub transport to video monitoring terminal of the USB host controller module, and then by the USB host controller module processor set the S3C2410. S3C2410 on acquisition to conduct real-time encoding of image compression, encoding of the stream directly after transfer to send buffer for sending.This design uses the CS8900A extended network interfaces, it is the CIRRUS LOGIC company production of 16-bit Ethernet controller, via internal registers of settings to meet the different application environments.
S3C2410 by address, data, control cable and movie selected signal cable to the CS8900A network chip control and communication. CS8900A and S3C2410 connections as shown in Figure 3, the CS8900A from S3C2410 nGCS3 signal gating, CS8900A of INTRQ0-end is used to generate interrupt signal, and the S3C2410 16-bit data bus, address line uses A [24: 0].
CS8900A Ethernet controller chip through DMA channels for data transmission.
First set the good transmission control and transport address registers of parametric, point from the specified data storage area to read data into internal send buffer, use the MAC to send data for the package. A set of data after the request is sent, the DMA interrupts are handled by the S3C2410.RS-232 interface and PC serial bus connected through PC on embedded system related information display and control.
And JTAG interface mainly on system debugging, you can also write to the Flash program to burn.System software design
Video monitoring terminal software design is mainly done on two aspects:
(1) build on hardware, a software platform to build an embedded Linux software development platforms need complete UBOOT transplantation, transplantation of embedded Linux operating system kernel and embedded Linux device driver development.
(2) in the software platform, based on the development system's application.
With cross-compilation tools, the development of video surveillance terminal running acquisition, compression, transmission procedures.Building a Linux platform based S3C2410
Linux has a number of excellent
Points, such as open source; powerful kernel that supports multi-user, multi-threaded, multi-process, real-time performance, powerful and stable; size features customizable; support for multiple architectures.Building embedded Linux development platform you need to build cross-compilation environment, as shown in Figure 4.
A complete set of cross-compilation environment including the host and the target machine. In the development of a host is a computer equipped with a Red Hat company FedoreCore 2 PC operating system, the target machine is based on the video monitor Terminal S3C2410. Selection of a cross-compiler for ARM version is GCC3.3.4, embedded Linux kernel source package version number 2.6.8RC.
2.6.8RC Edition of the Linux kernel source code package contains all the function modules.
The system is used only to a part of it. Therefore, before you can compile the kernel must first configure the kernel, cuts off the redundant function modules that have been customized kernel is consistent with the system design. The steps are as follows:(1) type the command make menuconfig, kernel configuration, select YAFFS file system to support NFS boot, the system uses a USB interface of the camera, so you want to enable USB devices support module, including USB device file support module, USB host controller driver module.
In addition, the USB camera belonging to the video device, in order to enable applications to access it, you need to enable the Video4Linux modules.(2) make dep command generates kernel dependencies between programs.
(3) make zImage command generates kernel image file.
(4) make modules and make modules_install command generates system can load the module.
This will generate a zImage kernel image file, download it to the target platform of Flash.
This design uses USB external camera, in the kernel configuration is required as modules loaded.
First of all to complete the driver, the driver needs to provide basic i/o interface function to open, read, write, close, to interrupt processing, memory mapping capabilities, as well as on the i/o channel control interface function ioctl, etc., and they define struct file_operations. So when the application on the device file such as open, close, read, write, and so on, the system invokes the operation, the embedded Linux kernel via the file_operations structure access driver-supplied function. Then put the USB driver is compiled as a module can be loaded dynamically, so the camera can work properly.Video monitoring terminal software design
Video monitoring terminal software functionality is divided into three parts: video capture, compression, transmission.
This software is based on a previously configured embedded kernel.(1) video collection section
Using the Video4Linux interface functions to access USB camera equipment, capture live video stream.
First complete v4l_struct data structure definitions, such as device profile, image properties, such as the signal source properties; acquisition module connection through a USB hub acquisition USB camera images, on the other hand start multiple collection threads, respectively on a different port to listen on, once the request connection, collecting thread immediately from the device buffer the video stream data readout, into video processing buffer to the next step of the process.(2) of the video data compression parts
In the video surveillance system, a large amount of data to be transmitted over the network, in order to ensure the transmission quality and transmit real-time performance, you need to encode compressed before transmission to reduce the amount of data, this article uses MPEG-4 coding standard for data compression.
On the network, you can download the open source software as video compression xvidcore core algorithm, is a highly efficient xvidcore, implanted very strong multimedia encoding software, set it on PC for cross-compiling generated files copied to the target system.(3) video data transmission parts
Transport module is to compress the video stream after transfer to the remote PC client, video streams of data transmission are based on TCP/IP protocol.
Video transmission using the standard RTP transport protocol. RTP is currently addressing streaming real-time transmission problems the best way, on the Linux platform for real-time streaming media programming, you need to use some open source libraries, such as RTP LIBRTP, JRTPLIB, etc. Defines a relatively simple Handshake Protocol: PC-acquisition programs continually FA request packet to the Terminal, the Terminal to have captured the image package is returned to the host. Each RTP packet is encapsulated in the UDP message, and then encapsulated in IP packets sent. The receiver automatically assembling the received data frames, restore the video data.Closing remarks
This article describes an arm-based video surveillance system design, with soft compression algorithm, discusses the system's hardware and software design.
This system and the market compared to other video surveillance system, short development cycle, low price, suitable for video image requirements are not too high.
No comments:
Post a Comment