1 Principle of Embedded Network Video Server
An embedded video server is an embedded device that provides network video transmission and sharing. It adopts an embedded integrated structure and a software platform for real-time processing. It integrates multiple functions such as multi-channel video and network transmission. It collects, compresses, and composites video and audio signals and converts them into network IP packets. It uses appropriate network protocols to achieve real-time network transmission of video and audio compressed data streams, so that users can obtain real-time image and sound information of the designated site through the network no matter where they are. In addition, through an embedded network server built into the video server, remote configuration of the video server and remote control and status acquisition of other auxiliary devices can be achieved.
Since the video compression and network functions are concentrated in a small device, it can be directly connected to the local area network, achieving plug-and-play, saving a variety of complex cables, and easy installation (only one IP address needs to be set). Users do not need to install any hardware equipment, just use a browser to watch, or compile a control program on the upper host and browse through the human-machine interface.
2 System Hardware Design
The main hardware functional modules of the embedded network video server based on ADSP-BF532 are: video input module, core ADSP-BF532CPU, video output module, external storage block, simulation debug interface (JTAG) module and power module.
Figure 1 is a structural diagram of the system. The specific design is as follows: the system front-end video acquisition is implemented by ADV7183, and the video data acquisition format is YUV422Planar. The acquired data is directly stored in SDRAM through the PPI interface of ADSP-BF532. ADV7183 automatically sends data to the SDRAM unit through the PPI interface under its own clock control. When a field of data is acquired, DMA generates an interrupt. In the DMA interrupt service program, video processing is completed according to the actual settings. Audio acquisition is implemented by AD1836 and corresponding peripheral circuits. The audio acquisition format is mono, 8000Samples/ s, each sample is quantized with 16Bits, and the collected data is directly stored in SDRAM through the PPI interface of ADSP-BF532. When the buffer set to store audio collection data is full, DMA generates an interrupt, and the audio data is processed according to the actual setting in the DMA interrupt service program; ADSP-BF532 sends the collected video and audio data to MPC860 through the SPI interface for processing, connects to the physical network through the MII interface of MPC860, and then sends it to the PC for real-time monitoring and listening; on the other hand, it processes the collected audio and video data in real time, compresses the encoded data and sends it to the PC, and stores it in the hard disk. The system is equipped with a JTAG interface for use in the debugging stage. This paper mainly studies the processing of video data in embedded video servers, and does not introduce audio data.
3. System software design and optimization
The system is implemented in Visual DSP++ 3.1, a software development environment for the Blackfin series, and is mainly divided into video peripheral programming, video encoding programming, video transmission programming, and system optimization.
3.1 System peripheral software design
This program uses the standard ITU-656 receiving mode to receive video data byte stream:
X_COUNT=360;Y_COUNT=288;
X_MODIFY=4;Y_MODIY=4;
After executing 2D DMA according to the above settings, the memory data is arranged starting from the first address:
0, 4, 8, ... 356
360, 360+4, 360+8,… 360+356
2×360, 2×360+4, 2×360+8… 2×360+356
…… …… …… …… ……
284×360, 284×360+4, 284×360+8,…284×360+356
Video output UART interface: Use the UART port provided by ADSP-BF532 to speed up the debugging process.
3.2 Video Coding
Considering the compression efficiency and bit rate, the core of the video server adopts the MPEG-4 Simple Profile standard for video compression encoding. It only performs intra-frame encoding (I frame) and inter-frame prediction encoding (P frame), but not bidirectional prediction encoding (B frame), which is suitable for rectangular video object encoding.
The core algorithms include DCT and IDCT. It uses 2D 8×8DCT and circular buffer, making full use of the advantages of Blackfin DSP and reducing the number of instructions executed in the loop body. MPEG-4 uses two methods to determine the quantization step size. One is to use the TM5 rate control method, and the other is to use the rate control model defined in MPEG-4. They both change the quantization coefficient according to the bit rate and image quality requirements. The DC coefficient quantization of MPEG-4 uses nonlinear quantization, and the AC coefficient can use either H.263 quantization or MPEG quantization. Here, the H.263 mode is used.
[page]
Motion prediction uses the minimum block SAD (the sum of absolute differences between the current image and the predicted image) to search for the best matching macroblock, and Blackfin DSP provides a video-specific instruction SAA, which greatly improves the speed; finally, boundary filling (PADDING) is used to reduce motion errors on the macroblock boundaries.
The upper software provides a friendly user interface and is implemented with Visual C++6.0. According to user needs, it receives video data from remote terminals through the network, including MPEG-4 decoding process, network transmission control and network command encoding. There are two ways to write it. The first one requires writing a server/client software to send and receive video image data; the second one can use the server/browser mode, that is, making the client software into a control, embedding it into a web page, and making it a digital video server based on WEB. This article adopts the first way.
The network communication module uses multicast technology to improve the efficiency of the program. The system IP network data communication flow chart is shown in Figure 3. This article specially writes a class Cmulticast to implement multicast service. It is a class specially encapsulated for video transmission and is used on both the server and the client. The public access functions of this class are introduced below.
classCMulticast :publicCobject
{
public:
void Close(); //Close the created socket
BOOL IsConnect();
Static Void Unintilize(); //Winsock terminates
Static Void Initilize(); //Read data from the specified port of the specified group
Int Send(char* lpData,int size) //Send message to destination address
BOOL Create(Cstring lpstrAddr,unsigned short port,HWND HWND); //Create and bind the send or receive socket and add the socket to the group, and set the message callback mechanism
CMulticast();
Virtual ~CMulticast()
Public:
HWND m_hWnd; //Window handle for message passing
SOCKET m_hWnd; //Window handle for message passing
SOCKET m_hSocket; //Send or receive socket
BOOL m_bConnected; //Has it joined a group?
SOCKADDR_IN addr; //Send socket address SOCKADDR_IN srcaddr; //Receive or send destination address
}
3.3 System-level optimization
The Blackfin software development platform's compilation system supports ANSI C and C++ compilation, and the system also provides a large number of multimedia operation instructions. When developing system software, we can optimize the compilation of code and the processing of specific tasks based on the hardware characteristics and the experience gained in the development and debugging process. We can also optimize the design of the upper-end software to shorten the code execution time of the display module.
4 Experimental Results
Based on this experiment, the video sequence (frame rate 30fps, CIF format) collected by ADV7183 was tested. The results show that: (1) DSP can transmit video image encoding data in real time through the SPI interface without data loss or error; (2) The quality fidelity of the reconstructed image is close to 1 when testing MPEG-4 video compression encoding; (3) In a simulation experiment on the local area network, CIF-sized video images can be transmitted in real time, and the transmission delay is controlled within 0.5s; (4) The UART interface can complete local video output. The design of the embedded network video server based on ADSP-BF532 is feasible, but some technical indicators are still not competent for actual applications. It is necessary to further improve the test results of video compression and add a large-capacity hard disk storage system to store video data.
Previous article:In-depth analysis of the definition and application technology of "cloud storage"
Next article:Gas Concentration Detection System Based on DSP and DDS Technology
- Popular Resources
- Popular amplifiers
- ICCV2023 Paper Summary: Fairness, Privacy, Ethics, Social-good, Transparency, Accountability in Vision
- Understanding and using the Controller Area Network (CAN) communication protocol: theory and practice
- Quantum interference of electromechanically stable emitters in nanophotonic devices
- CAN notes(Controller Area Network)
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- New breakthrough! Ultra-fast memory accelerates Intel Xeon 6-core processors
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- Consolidating vRAN sites onto a single server helps operators reduce total cost of ownership
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- DSPF28335 source code about SPWM
- Please tell me the function of these options in ALTIUM
- Crowdfunding of micro:bit robot PLEN:bit
- Help TI series high profit series model
- GD32F350 development board adds HMI (TFT touch LCD)
- FPGA_100 Days Journey_Blocking and Non-Blocking
- 4 charts showing how and when the chip shortage will end
- AD19 only shows wireframe after copper is laid, which does not look like laid copper
- 【EVK-NINA-B400 Evaluation Kit】Hardware
- Oh, mobile