Development of mobile video surveillance system based on Android platform

Source: Internet
Author: User
Tags network function

The trend of network informatization, following the continuous progress of streaming media technology, wireless network technology and video compression technology, video surveillance technology has been widely used, together, monitoring planning and planning is also expanding. Everyone about the need for security assurance continues to improve, and then make the past to text-based content services should not be satisfied with the needs of users, instead of audio and video multimedia services. The use of mobile terminal technology video surveillance system, not only with the size of miniaturization, equipment, such as the Fool and the advantages of flexible equipment, the most important is also to reduce costs. Because the network function and the video compression are gathered to keep in the small volume device, therefore, after the network long-distance surveillance video equipment can obtain the surveillance video. At present, network video surveillance is not only for enterprise-level customers, but also through video surveillance for the mass supply services. such as tourist attractions, scenic spots inspection, traffic navigation and so on. Mobile video surveillance based on open channels has become a hotspot in the field of surveillance research

Video surveillance system requires the transmission of data into two categories: manipulation of information and video data. Although the two types of data transmission is based on the IP protocol, but they have adopted the Application Layer Protocol and Transport Layer protocol, because the characteristics of the requirements and the end of the software planning is not the same result [3]: Top, the use of TCP Transport layer protocol for information manipulation. The use of TCP/IP transmission in the form of information manipulation, this is because the manipulation of information, although not the need for higher real-time, but the reliability of transmission requirements are very high. Therefore, the TCP Transport layer protocol with severe handshake process and retransmission mechanism is selected. Second, when transmitting video data, the RTP Application layer protocol and UDP Transport layer protocol are selected. Because the timeliness demand of network video is much higher than reliability, this paper chooses the transmission protocol of RTP application layer to support real-time transmission service. In the transport layer, although UDP as far as possible to choose to the method of data transmission, but there is no congestion control, and then about the large data volume of real-time video data comparison suitable for this approach, therefore, this thesis chooses the UDP protocol as the Transport Layer protocol. After receiving the multimedia information stream of the upper application program, the RTP is assembled into the data packets to the lower layer, and then the RTP stream is formed after the UDP/IP protocol encapsulation. The Transmission Control sub-system is constructed according to the RTP protocol, and the udpsocket of the transmission layer communication is concluded.

On the PC end of the video Surveillance System application program development, the first choice of drawing acceptance method to end the mobile channel Intelligent video Surveillance system.

The client of the video monitoring system is primarily through the TCP/IP protocol and server-side implementation of communication, together with the socket to complete the process. The socket network communication socket as the handle of the communication chain is used to depict the port and IP address. Through the socket programming, the application will send a plea to the network or respond to network requests. Socket as the pillar of communication, supporting the TCP/IP protocol network communication of the fundamental operating unit. The socket transmission form used in this program is a connection-oriented socket operation using TCP protocol. Socket in this form, it is necessary to set up a socket in the client and the server, once a good convergence, you can open, read, write and close a stream interface, and the other end in the same order to inherit all the information. Compared with the non-convergence, the data is more secure, although the operating power of the convergence-oriented operation is lower. According to the Android Video Server System terminal, it is necessary to choose Socket network communication technology to withstand the video data from the monitoring front end. Socket communication enables the monitoring of the front end and the terminal, through the network connection end data interaction. After the socket is initialized, the socket can be communicated, and the end process is the same as the socket for the connection. The socket service thread is created, and when monitoring occurs, the service master process acts as a continuous loop listener to receive the request, together with a new customer interface socket, creating a communication process for this socket. In the video surveillance system to create the socket process, first use ServerSocket serversocket=null on the server to create a socket, and then use the Serversocket=new ServerSocket (8888) listening on port 8888. If the client socket is accepted on the port, use Socketclient=serversocket.accept () to create a socket target. After establishing the connection, call InputStreamReader to accept the video data sent by the server, and then pass the BufferedReader to read the data. The data received by the server from the front-end collection system is bufferedwriter written and sent to the network client via OutputStreamWriter. After the communication is over, after Os.close (), Is.close () and Socket.close () are closed to the output input stream and the socket port is closed, the server aborts the socket communication. The network client terminal is the client that accepts the data, first uses the socketsocket=null to create a socket in the terminal, then sets the IP address and the communication port Soc of the socket communication server.Ket=new Socket ("192.168.1.101", 8888), successfully set up a connection with the server, using InputStreamReader to create the input stream, after the BufferedReader read out, to parse and appear on the user interface, After the data is accepted, after the BufferedWriter is written to the receiving end information and sent to the server via OutputStreamWriter, after the communication is over, Os.close (), Is.close (), Socket.close () Closes the input and output stream and closes the socket port, at which point all socket communication is completed.

Because the server sends the decoded picture data, the data stream that the client accepts can form a picture [5-6]. The Bitmapfactory.decodebyteallrayo function, which is supplied by Android, is able to get the bitmap pattern from the accepted data stream. The processing of this article is aimed at this bitmap target.

In order to end the display of the monitoring screen, it is necessary to inherit the view class and rewrite the OnDraw () method. What is done in the OnDraw () approach will appear on the client interface. Define a bitmap target that will be created in the canvas. When the thread that accepts the drawing accepts the new drawing data, it passes the data to the target and calls the Postlnvalidate0 method in the thread to redraw the screen. For the system to end very good presentation role, the plan has chosen a double caching mechanism. The displayed picture is stored in the original target, and the accepted picture is stored in another target of the variable. If the network is not good, and can not accept the new data in a timely manner, so that the other goal is empty, the original variable is not updated, will also appear before the screen, so that the treatment will be to a certain extent to improve the user experience, reduce the network situation is not good situation of the sudden black screen.

Based on the Android GUI system, it can end the long-distance video real-time monitoring user interface and provide the interface between player and user. Java and C language structure together constitute a GUI system, this system to the lower layer through the invocation of the input, output device driver, the Android software system and the underlying hardware link, this system on the upper layer of the Java layer of the drawing interface, The Java fabric layer of Android calls these interfaces to build various UI elements. In addition, Java is able to invoke the drawing interface.


This article is from the "audio and video Instant messenger" blog, make sure to keep this source http://yinshipin1.blog.51cto.com/9620924/1589280

Development of mobile video surveillance system based on Android platform

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.