China has entered the era of 3G technology, and the era of wireless network access to fixed networks has arrived. With the continuous development of streaming media and embedded technology, wireless monitoring based on wireless networks and embedded technology will replace traditional monitoring methods and be widely used in many aspects, such as banks, supermarkets, communities, remote education fields, and various industrial places. This article focuses on the practical application requirements of network video monitoring equipment, integrates new technologies such as video compression and embedded system wireless communication, and designs and implements an H.264 wireless video monitoring system based on 3G technology. Due to the excessive emphasis on universality in the rate control strategy of the H.264 standard and the lack of consideration for factors such as high error rate, high jitter, and limited processing power of embedded terminals in wireless networks, this system has been optimized based on the implementation of the rate control strategy in the H.264 standard, enhancing the stability of the system.
1. Overall structure of video surveillance system
The video surveillance system consists of a video capture node, a video acquisition control module, a network proxy module, and a viewing terminal. Among them, the shooting node is a high-precision camera responsible for collecting the original video; The video acquisition control module consists of an acquisition card and control software. The acquisition card is installed on the embedded motherboard, compressing the raw video data collected by the camera into H.264 format bitstream and callback it to the system for processing; The control software runs on an embedded Linux system, obtains compressed H.264 format bitstream through the driver program of the acquisition card, and controls the connection with the network proxy module, as well as the transmission and response of data and commands. For example, transmitting the compressed bitstream to the network proxy and issuing control commands to a certain camera through a serial port; The network proxy module is responsible for managing network connections with video viewing terminals, as well as controlling the transmission of commands and video data; The viewing terminal is a mainstream smartphone based on Symbian operating system.
2 System hardware composition and main modules
The hardware environment of the mobile video monitoring system consists of a camera, an acquisition card, an embedded motherboard, and a smartphone. The camera uses SONYFCB2EX480CP; The embedded motherboard uses the Weisheng EPIANR series Nano2ITX embedded motherboard, model EPIANR10000EG; Smartphones use the current mainstream Symbian operating system based Nokia N95. The system diagram is shown in Figure 1, and the shooting node is a controllable camera. The following mainly introduces the functions and components of the video acquisition control module and network proxy module.
2.1 Video capture control
The video capture control module is mainly responsible for video capture, compression, and response to control commands. When IS400JPDHG1ABB IS410JPDHG1A collects videos, it is mainly responsible for the startup, initialization, and various control operations of the capture card, as well as some control operations related to the camera. The specific software architecture is shown in Figure 2. Among them, the NCCMain module is responsible for managing various sub modules, opening the Socket to listen to port 7020, and responding and receiving data when there is a connection request from the network proxy module; The data processing module is responsible for processing various commands (such as video opening and focus adjustment commands), and sending confirmation messages in response to these commands; The RS2232 serial cable control module controls the camera’s shooting focal length through the RS2232 serial cable in response to focal length adjustment commands; The board acquisition management module is mainly responsible for initializing the board, opening the acquisition channel, setting various H.264 parameters (I, P frame spacing, quantization parameters, encoding formats (CIF, QCIF), setting callback functions, connecting with the agent to send video streams, and other operations. This module is based on the collection card development package and implements various functions by calling the driver program provided by the manufacturer through an interface.
The workflow of this module is as follows:
a) Call the driver provided by the manufacturer to set the initial parameters for video capture;
b) Start the network management program, open the socket monitoring port 7020, respond to the connection request and receive the command when receiving the connection request, call the command processing module after receiving the command, and carry out different processing according to different commands;
c) When receiving the start video command, a connection request is sent to the agent. After the request responds, the connection is established. IS400JPDHG1ABB IS410JPDHG1A sends video data to the agent through this connection and saves the connection descriptor in the forwarding table;
d) When receiving the command to close the video, close the video transmission connection with the proxy, and clear the corresponding table entries for the post;
e) After receiving the focus adjustment command, call the RS2232 serial port control module to set the camera focus, then establish a connection with the 7005 port monitored by the network agent, and report the current focus level information to the network agent.
2.2 Network Proxy
The network proxy module is mainly responsible for responding to connection requests and control commands from handheld devices, and sending video data to them. It also includes the following sub modules:
a) Connect the request listening module. This module, as a separate thread, listens to port 9000 and sends a confirmation message when receiving a proxy information request command from a handheld device.
b) Control command processing module. It is responsible for processing various commands sent by handheld devices and sending corresponding processing commands to the video acquisition control module; Receive command responses from the video capture control module and respond accordingly to commands from handheld devices.
c) Video data transmission and reception module. When receiving the H.264 video stream from the video capture control module, the video data stream is forwarded to the handheld device issuing the on-demand command. The structural relationship of the network proxy module is shown in Figure 3.
2.3 Communication process of video surveillance system
The overall process of the wireless video surveillance system is as follows:
a) Handheld devices are connected to the network. Handheld devices connect to wired networks through 3G wireless networks, cross mobile gateways, interact with video service network proxies, register their own information, and collect device information from proxy nodes in the network.
b) Perform video browsing operations. After the handheld device is connected to the network, it can browse videos as needed. The user selects the node and camera to browse, sends control commands to them, turns on the camera for collection, and the obtained video data is transmitted to the handheld device through the video service network proxy through the 3G network for viewing on the handheld device.
c) Perform video control operations. After the handheld device obtains the video of the shooting node, it can control the shooting node as needed to obtain a more interesting video area. If the user is interested in a scene further away from the shooting node, it can send an amplification command to make the video capturing camera zoom towards the distance; Users can also send camera or node switching instructions to the agent according to their needs, and the agent responds and starts the corresponding camera according to user needs.
3-rate control optimization algorithm
In the H.264 standard, rate control is achieved by dynamically adjusting quantization parameters and other coefficients based on the current bandwidth and buffer usage. Considering the significant differences in processing power of mobile terminals and the high bit error rate and jitter in wireless networks, this system has been optimized based on the implementation of the rate control strategy in the H.264 standard. In the rate control process, not only the bandwidth and buffer usage are considered, but also the video processing ability of the terminal and the condition of the wireless network are dynamically adjusted to adjust the encoder parameters. In addition, a frame skipping strategy has been added, and the frame skipping strategy has been optimized in combination with this system to achieve better rate control effects.