A detailed explanation of the implementation process of a remote real-time video acquisition system based on an embedded video server

With the rapid development of communication network technology, network-based high-quality video transmission has gradually replaced the traditional text and voice interaction mode and has become one of the main research areas of digital communication today. With the continuous improvement of embedded operating system and integrated circuit design level, the integration of embedded technology, communication network and multimedia technology will become the mainstream development trend in the field of digital video communication in the future.

For a long time, real-time video transmission over the network has placed high requirements on embedded software and hardware. This article uses the S3C2440 embedded microprocessor based on the ARM920T core and adopts the H. 264 video compression standard and open source embedded Linux system, designed a remote real-time video capture system based on embedded video server.

1 Acquisition system platform construction

1.1 System hardware platform

The acquisition system uses a PC as a client, an ARM9 development board Mini2440 developed by Guangdong Friendly Arm Computer Technology Co., Ltd. as a video server, uses Samsung S3C2440 as a microprocessor, and uses a professional and stable CPU core power chip and reset chip to ensure system operation The stability. The 16/32-bit RISC microprocessor S3C2440 launched by Samsung adopts ARM920T core with a typical main frequency of 400 MHz and a maximum of 533 MHz. It uses 5-stage pipeline technology and uses a wealth of control modules to provide various applications. Extension. The structure of the acquisition system is shown in Figure 1.

A detailed explanation of the implementation process of a remote real-time video acquisition system based on an embedded video server

1.2 System software platform construction

The PC uses the Linux 5 Red Hat Enterprise Edition with a kernel version of 2.6.18. Because of the subsequent need to perform FTP data transmission and other tasks on the Windows platform, the method of installing Linux on the virtual machine is adopted to facilitate the data network between Linux and Windows Interactive. The software version of the virtual machine is Vmware 6.5.1, and the transmission software used is Flash Fxp based on the SFTP protocol. The cross-compilation tools are mainly Binutils, Gcc and Glibc.

An embedded system software perspective is mainly divided into three levels: boot loader, Linux kernel, and file system. The boot loader is the first piece of software code that runs after the system is powered on. BootLoader is a program that runs before the operating system kernel runs. In the Hash memory responsible for booting, it is usually distributed in the order shown in Figure 2.

A detailed explanation of the implementation process of a remote real-time video acquisition system based on an embedded video server

Because the later process of writing and transplanting camera drivers requires a lot of debugging, a network-based NFS root file system is more suitable. Based on this consideration, U-boot with powerful network functions was selected as the BootLoader. The main tasks of transplanting U-boot are as follows: (1) Modify the compilation conditions, add register definitions, and modify the clock. (2) Modify the interrupt prohibition part and add the interrupt prohibition code of S3C24 40. (3) Create a new development board directory in the board directory. (4) Take smdk2410. c Modify the settings of PLL and UPLL for the template. (5) Modify the corresponding configuration line of Makefile to support the development board.

After the modification is completed, enter the working directory for board-level configuration, and compile the modified code through the cross-compilation tool chain. Use H-JTAG software to burn and write, as shown in Figure 3, it is successful and completed through the HyperTerminal guide.

A detailed explanation of the implementation process of a remote real-time video acquisition system based on an embedded video server

There are three main ways to mount the root file system: ramdisk, NFS and initramfs. Making a self-starting embedded device needs to use initramfs as the kernel of the root file system for programming. First, U-boot is stored at address 0, which is about 100 kB; then, about 64 kB of environment variables are stored at 0x0000~0x40000. These two items are fixed, so the size of uImage must be controlled below 1.75 MB and stored from 0x40000. uImage includes two parts, the kernel and the root file system, which need to be cut to meet the project requirements.

In embedded systems, BusyBox is a software toolkit commonly used to construct file systems. This article uses it to build the root file system. The target board kernel used in this project is Linux 2. 6.29, but it is tailored according to the needs of the project's self-starting, and cut according to the minimum system standard. The serial port, network port, and root file system are available, and the camera driver required in this article is retained. , The size of the cut kernel is 1.3 MB, which meets the needs of the system, as shown in Figure 4.

A detailed explanation of the implementation process of a remote real-time video acquisition system based on an embedded video server

2 Video driver writing and C/S software design

2.1 T. 264 encoding library optimized porting

T. 264 is an open source encoder jointly developed by the China Video Coding Freedom Organization. 264 feature support is single, the encoder can output standard 264 bit stream, and the decoder can decode T.264. The code stream generated by the 264 encoder absorbs the advantages of JM, X264 and XVID, and is suitable for network streaming media transmission. Since the video acquisition system studied in this paper is used in videophone video conferences and other applications, it has higher requirements for network transmission. After comprehensive comparison, T. 264 as the software encoder of this system.

Use H. The basic grade in 264 can meet the application requirements only by using the CAVLC entropy coding method. Considering the coding performance under different average bit rates and the network transmission capacity, for a video sequence with smooth motion in QCIF format, when the encoding output frame rate is 15 f·s-1, set the average bit rate to 128 kb·s-1. More appropriate choice. Use T. 264 open source encoder, and T. 264 performs code-level optimization and compilation. The following options have been added at the compile level: (1) The -fomit-frame-pointer option ignores unnecessary frame pointers in functions and saves instruction overhead. (2)-04 almost opened all optimization options to improve the efficiency of the program as much as possible. (3) -msoft-float: Generate soft floating-point target code based on floating-point arithmetic function library calls.

2.2 Video driver writing and C/S software design

The camera adopts the main control chip of Taiwan Songhan SONIX613a, which has a large domestic market share. The camera supports Jpeg format and 4:2:0 sampling YUV raw video data output. The data volume is small, and it can be directly used as H. The original video data source of video compression coding standards such as 264 avoids complicated digital processing such as image resampling and color space transformation, and is suitable for embedded real-time video capture applications.

2.2.1 Modification and transplantation of the driver Gspca

Gspca/Spca5xx is a universal USB camera driver released by the Free Software Foundation. But because this solution has no driver support in the Linux kernel, drivers must be added and modified for it, as shown in Figure 5.

A detailed explanation of the implementation process of a remote real-time video acquisition system based on an embedded video server

2.2.2 C/S software design

For the consideration of specific application objects and cost, this paper adopts H.264 streaming media transmission based on wired Ethernet network. 264 video solution. The open source software VLC is used as a streaming media server and a client player for unidirectional point-to-point real-time video communication. Figure 6 is a flow chart of the video capture system.

A detailed explanation of the implementation process of a remote real-time video acquisition system based on an embedded video server

(1) Server-side software design.

The server side of the video acquisition system adopts the background control program video_server to accept the remote management and settings of the VLC video server by the client video_client, and communicates through the same port (3490) and the same set of message codes. And in the system initialization script /etc/init. After activating the network card in d/rcS, add the command to run the server control program Video Server in the background to make the development board automatically run the video_server in the background after startup. It first creates a socket descriptor on the server side, and it is unified with the server port address and the client side. The communication port is bound, and then enters the main loop body of the service response, listens to the socket data and connection, and provides different services according to the message request from the client. The video_server software process is shown in Figure 7.

A detailed explanation of the implementation process of a remote real-time video acquisition system based on an embedded video server

(2) Client software design.

The client program Video Client runs on the PC platform and is used to send remote control commands to the Server. Through remote control commands, you can configure the server-side video format code rate and transmission protocol, start and stop the server-side VLC process, and adjust the local VLC player to receive and play video images from the server-side.

For this program, a GUI operation interface is designed using the cross-platform interface library QT, which is helpful for user interaction.

Since the server side has a slower speed of image acquisition and compression in CIF format, the program only supports these two grades: QCIF64 kb·s-1 and QCIF-128 kb·s-1. After setting, click the Connect button, and the client sends a connection request with server setting parameters to the server. If an OK message is received from the server, it indicates that the server has accepted the local connection request and started the VLC server on the server, and the client will Connect The button is set to the Disconnect button, and the local VLC player is called with the same call to receive and play the video data sent by the server: if the NOK message is received from the server, an error occurs. When the server receives and plays the video data sent by the server normally, if the Disconnect button is clicked, it will send an SRV_QUIT request to the server and close the local VLC player at the same time. After the server receives the SRV_QUIT message, it closes the VLC server on the server side.

The PC of the entire system is the client, and the Mini2440 development platform based on the S3C2440 processor is an embedded video server. The Client program connects to the server via Ethernet. After the server responds to the request, it starts VLC for video capture and transmits the video data to the client, and then the Client The program calls the VLC player window to play the received code stream in real time, and the normal working situation is shown in Figure 8.

From the point of view of the video image frame rate, the optimized T. When the average bit rate of 264 encoder for QCIF video is 128 kbit·s-1, the encoding speed can reach 16 f·s-1, but because the USB camera collects QCIF format images at about 13 f·s-1, it needs to be on the server The compressed frame rate is set to 13 f·s-1 on the end, which can ensure that the client decodes the video stream at the original frame rate. Considering the overall performance of the system, this bit rate can meet applications such as distance education and video surveillance.

3 concluding remarks

Researched the development technology of embedded Linux, established a Linux development platform based on the Mini2440 development board, including building a cross-compilation environment, designing and transplanting BootLoader and Linux 2.6.29 kernels, building a root file system based on BusyBox, and developing for video capture The dedicated camera driver of the system. Researched H. 264 video compression coding standard, for the video acquisition system to open source T. 264 encoder performs compilation and code-level optimization to meet real-time application requirements. The network transmission scheme based on UDP protocol is studied, and the acquisition program on the server side and the video decoding and playback program on the client side are modified and designed, and finally the operation of the embedded video acquisition system is realized.

LiFePO4 Battery

With 5 years full replacement warranty, and a design lifespan of over 10 years, Saintish Lithium Iron Phosphate Battery has built-in BMS to protect it from overcharge, over-discharge, over-current and short circuit. The bluetooth function is able to monitor lithium battery status.

Saintish lithium iron batteries are manufactured by A Grade LiFePO4 Cells with more stable performance, high energy density and greater power. Our Lithium iron phosphate batteries are approved by CE, UN 38.3 and MSDS Test. With no acid in the battery, you're able to safely mount in any position. The pack case is ABS-FR material, and ODM/OEM with customer label is acceptable.

LiFePO4 battery's flat discharge curve keeps above 12.8V for up to 95% of its capacity usage, offering astronomical boosts in run-time compared to only 50% in Lead Acid. Without memory effect, no matter what state the battery is, it can be used as soon as it is charged. Saintish 12V Lithium Battery can be used in most applications like Caravan, Marine, Backup power supply, Solar off grid system and lead acid replacement.

12v lithium battery

Lithium Ion Battery,Lithium Battery, LFP Battery, Battery Pack

Hangzhou Saintish Technology Co.,Ltd. , https://www.saintishtech.com

This entry was posted in on