network informatization Trend, with the continuous progress of streaming media technology, wireless network technology and video compression technology, video surveillance technology has been widely used, at the same time, The scale and scope of monitoring are also expanding. People's demand for safety and security is constantly improving, so that the past text-based content services should not be able to meet the needs of users, instead of audio and video multimedia services. The video surveillance system using mobile terminal technology not only has the advantage of miniaturization, installation and flexibility, but also lowers the cost. Because network functions and video compression are centrally stored in small-volume devices, surveillance video can be obtained by monitoring video devices remotely over a network. At present, network video surveillance is not only for enterprise-level customers, but also to provide services to the public through video surveillance. such as tourist attractions, attractions view, traffic navigation and so on. Mobile video surveillance based on open platform has become a hotspot in the field of surveillance research. The transmission data required by the video surveillance system is divided into two categories: control information and video data. Although both types of data are transmitted based on the IP protocol, they take the application layer protocol and the Transport Layer protocol respectively, which is due to the characteristics of both the requirements and the size of the implementation of the software caused by different [3]: First, the use of TCP Transport layer protocol for information control. The reason of using TCP/IP transmission mode For information control, this is because the control information does not require high real-time, but the reliability requirements for transmission is very high. Therefore, a TCP Transport layer protocol with strict handshake process and retransmission mechanism is adopted. Second, the RTP Application layer protocol and the UDP Transport layer protocol are used when transmitting video data. Because the timeliness of the network video is much higher than the reliability, this paper uses the RTP application layer's transport protocol to support the real-time transmission service. In the transport layer, although UDP as far as possible delivery method of data transmission, but there is no congestion control, so that the large data volume of real-time video data is suitable for this way, therefore, this paper uses the UDP protocol as the Transport Layer protocol. After receiving the multimedia information stream of the upper application, the RTP is assembled into the data packets to the lower layer, then the RTP stream is formed after encapsulation through the UDP/IP protocol. The transport control subsystem is built on the RTP protocol and is completed by the udpsocket used by the Transport layer communication.
The development of video surveillance System application on PC, mainly adopts picture receiving mode to realize intelligent video surveillance system of mobile platform.
The server-side function is mainly to initialize the camera and network port number and host address, turn on the video monitoring service, real-time capture monitoring the scene image and then wait for the client connection request [4]. After a successful connection has been made to the remote requesting mobile client, the video image information is sent to the client. The server-side design Flowchart 2 shows. The PC server, which is responsible for on-site monitoring, needs to be initialized to control the monitoring device, which is implemented using the C++/MFC language in the Visual Studio programming environment. In the network communication transmission, the system is built based on the RTP protocol, and the communication between the server and the client is realized by using the udpsocket of the transport layer communication to achieve stable image transmission. The part of the socket communication is implemented by the CSocket class in the MFC language, while the camera image acquisition and control is implemented using the SDK provided by the corresponding service vendors. In the video capture, the Ccapturevideo class is designed and implemented, and the video capture is realized by invoking the class in the video response function. When the captured video image is processed, the captured video image is converted into a contiguous JPEG format image stored in the data buffer, which continuously accepts the client's connection request and sends the image to the client.
The client of the video monitoring system mainly communicates through the TCP/IP protocol and the server side, and uses the socket to realize the whole process. The socket network communication socket as the handle of the communication chain is used to describe the port and IP address. With socket programming, applications make requests to the network or answer network requests. As the cornerstone of communication, the socket supports the basic operating unit of network communication of TCP/IP protocol. The socket transfer mode used in this program is a connection-oriented socket operation using the TCP protocol. Socket in this mode, the client and the server must establish a socket connection, once the connection is established, you can open, read, write and close operations on one stream interface, while the other end in the same order to accept all the information. While connection-oriented operations are less efficient than no connection, data is more secure. Based on the Android video Server System terminal, the video data from the monitoring front end must be accepted by using socket network communication technology. Socket communication enables monitoring of the front-end and terminal to enable data interaction over a network connection. The socket connection is initialized for socket communication, and the implementation process is the same as for connection-oriented socket communication. The socket service thread is created, and when the listener is generated, the service master process is responsible for continually looping through the received requests while establishing a new client connection socket to create a communication process for this socket. The process of creating a socket in a video surveillance system, first creating a socket on the server side with ServerSocket serversocket=null, and then using the serversocket= Newserversocket (8888) listening on port 8888. If a client socket request is received on that port, the socket Client=serversocket.accept () is used to create a socket object. After establishing the connection, call InputStreamReader to receive the video data sent by the server, and then read the data through BufferedReader. The data received by the server from the front-end acquisition system is written through BufferedWriter and sent to the network client via OutputStreamWriter. After the communication is complete, the output input stream is closed and the socket port is closed by Os.close (), Is.close (), and Socket.close (), and the server stops the socket communication. The network client terminal is the client that receives the data, first creates a socket in the terminal with socket socket=null, then sets the IP address and communication port of the server for socket communication soCket=new Socket ("192.168.1.101", 8888), after successful connection with the server, create an input stream with InputStreamReader, then read it through BufferedReader, parse it and display it on the client interface , after the data received, through the BufferedWriter write to receive complete information and sent to the server through OutputStreamWriter, after the communication is complete, through Os.close (), Is.close (), Socket.close () Closes the input and output stream and closes the socket port so that the entire socket communication is complete.
Because the server sends the decoded picture data, the data stream received by the client can form a picture [5-6]. With the Bitmapfactory.decodebyteallrayo function provided by Android, you can get an object in bitmap format from the received data stream. The following processing is done for this bitmap object.
To implement the display of the monitor screen, inherit the view class and rewrite the OnDraw () method. The content that is implemented in the OnDraw () method is displayed on the client interface. Defines a bitmap object that will be drawn in the canvas. When the thread responsible for receiving the picture receives the new picture data, it passes the data to the object and calls the Postlnvalidate0 method in the thread to redraw the screen. In order to achieve a better display of the system, this design adopts a double-buffering mechanism. The displayed picture is stored in the original object, and the received picture is stored in another object of the variable. If the network is not good, and can not receive the new data in time, so that the other object is empty, the original variable is not updated, will also display the previous screen, so that processing will improve the user experience to a certain extent, reduce the network condition of the sudden black screen.
According to the Android GUI system, it can realize the user interface of remote video real-time monitoring and provide the interface between player and user. The Java and C language frameworks form a GUI system that links the Android software system to the underlying hardware by invoking the driver for the display input and output devices on the lower layer, which provides a Java-level drawing interface to the upper layer. The Java framework layer of Android calls these interfaces to build various UI elements. In addition, Java can invoke the drawing interface.
Development of audio-video surveillance system in mobile phone