Back to Blog

Design and Implementation of a Low-Latency Video Transmission System Based on RK3399/RK3588 H.265/HEVC

#h.265#音视频#人工智能

In recent years, with the rise of short video live streaming, video transmission equipment has become increasingly prevalent in daily life. Demands for technical indicators such as image clarity, frame rate, and bitrate are continuously increasing, and the amount of data contained in video frames is also rapidly growing. Under limited network bandwidth, traditional video capture devices face technical bottlenecks such as insufficient compression ratio, low frame rate, and high latency, which prevents their application in ultra-high-definition image transmission scenarios. Therefore, in the face of continuously improving video quality, enhancing the encoding and decoding efficiency of video transmission systems and reducing transmission latency becomes particularly crucial.

To address the aforementioned issues, this paper proposes a low-latency video transmission system based on the H.265 encoding and decoding protocol, designed to solve the problem of high transmission latency in ultra-high-definition image transmission scenarios. The paper focuses on RK3399 hardware design, Linux+Android embedded development, and H.265 encoding/decoding, introducing multiple optimization strategies to reduce system transmission latency and improve encoding efficiency. The main contributions are as follows:

  1. Designed and proposed a low-latency video transmission system based on the H.265 encoding and decoding protocol, enabling low-latency transmission of ultra-high-definition images. Compared to traditional video transmission equipment, the features of this design include: Utilizing software encoding technology to avoid the issue of difficult parameter modification after data integration at the hardware level in hardware encoding, thereby improving system portability and scalability; Achieving low-latency transmission of ultra-high-definition 1080P video based on the H.265 encoding and decoding protocol, addressing the high latency problem of software encoding in ultra-high-definition video encoding scenarios; Integrating functional modules of the encoding terminal in the system hardware design, with dimensions of 120mm100mm15mm, offering advantages of small size and portability.

  2. Optimized the overall latency of the video transmission system through various low-latency strategies. Leveraging the powerful computing capabilities of RK3399, the X265 encoder configuration was optimized to accelerate encoding speed; Controlling the slow-start time of the congestion control algorithm to reduce data fluctuations caused by packet loss, thereby enhancing network transmission stability and reducing transmission latency; Replacing traditional linear buffer designs with a circular FIFO data structure to improve system operational efficiency under multi-threaded scheduling; Optimizing decoder configuration by calling Android's native MediaCodec, combined with hardware acceleration, to achieve efficient H.265 decoding; Optimizing Android display controls to accelerate video refresh rate and achieve high frame rate display; Rewriting multi-threaded content using AsyncTask to bypass the worker thread + Handler asynchronous message transmission combination, thereby achieving efficient asynchronous communication.

  3. Implemented testing and analysis of the H.265-based low-latency video transmission system in an experimental environment. Transmission tests were conducted on five different resolution video sequences under varying signal strengths, and the results show that: Within a local area network, while maintaining encoding quality, transmitting 1080P video resulted in an end-to-end network transmission latency of 127ms, a compression ratio of 131.8, and encoding terminal power consumption of less than 6W. Compared to the unoptimized video transmission system, the optimized system reduced total latency by 11.9%. The system is fully functional, performs excellently, meets low-latency requirements, and possesses practical utility.