Compression coding stable bit rate streaming method, device and application thereof
Through intra-frame refresh and buffering current sharing technology, the problem of unstable video data transmission and delay in wireless image transmission is solved, and the continuous and smooth transmission of high-definition video is realized, which is suitable for the real-time video requirements of drone applications.
Patent Information
- Application Number
- CN202410741635.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing wireless image transmission technology is difficult to achieve continuous and smooth transmission of high-definition videos when the bandwidth is limited and the network environment is unstable, resulting in video playback freezes, picture loss and delays, and cannot meet the high standards of real-time video transmission for drone applications. Require.
Intra-frame refresh technology is used to refresh I frames into P frames. Through the buffer current sharing module and real-time frame insertion technology, uniform output and stable transmission of video data are achieved, bit rate spikes are eliminated, and smooth transmission and playback experience of the video stream are ensured.
Through intra-frame refresh and buffering current sharing technology, stable and smooth output of video data is achieved, which improves the stability of wireless transmission and the smoothness of video playback, reduces video playback delay, and enhances the robustness of the system. It is suitable for Delay-sensitive and bandwidth-limited wireless transmission scenarios.
Smart Images

Figure CN118317093B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicles, and in particular to a method and device for streaming with a stable bit rate based on a compression encoding RK3588 platform and applications thereof. Background Art
[0002] In today's era of rapid technological progress, drone technology, as an important innovative achievement, has been widely used in civil and military fields, which has significantly improved operational efficiency and information acquisition capabilities, and the market demand is growing. When drones are operating, real-time, high-quality video feedback is essential for monitoring, reconnaissance, search and rescue, and this demand is inseparable from efficient and stable wireless image transmission technology. As the key communication link between drones and ground stations, wireless image transmission systems face severe challenges, especially how to achieve continuous and smooth high-definition video transmission under limited bandwidth resources.
[0003] One of the core issues of current wireless image transmission technology is how to effectively manage bandwidth occupancy and bitrate control during video encoding and transmission. Although the traditional H.264 / H.265 video coding standards have made remarkable achievements in compression efficiency and image quality, their inherent coding structure design—especially in the processing of key frames (I frames) and predicted frames (P frames)—is still not adaptable to wireless transmission environments. Specifically, because I frames contain complete image information, their data volume far exceeds that of P frames that rely on the information of previous and next frames for predictive coding, which makes it easy to form periodic data peaks during transmission. This uneven bitrate distribution not only places high demands on network bandwidth, but also easily causes video playback freezes, picture loss, and other phenomena, especially when bandwidth is limited or the network environment is unstable.
[0004] In addition, due to the instantaneous nature of data transmission in the H.264 / H.265 encoding standard, a large amount of data is concentrated and transmitted instantly after the I frame is encoded, and the network resource utilization rate is low during the rest of the time, which aggravates the imbalance of network load. This is a major obstacle for wireless transmission applications that pursue low latency and high stability. At the same time, the transmission delay of large-size I frames under limited bandwidth and the time difference between the subsequent fast-played P frames further deteriorate the continuity and real-time performance of video playback. Moreover, in order to ensure smooth decoding, the receiving end usually needs to pre-buffer a certain amount of bitstream, which directly leads to significant lag in video display, seriously affecting instant decision-making and operation feedback.
[0005] In summary, the existing technologies have limitations in dealing with burst bitrate control, efficient bandwidth utilization, and reducing video playback delay in wireless image transmission. There is an urgent need for a new encoding and transmission strategy to achieve smoother bitrate output, improve the dynamic adaptability of network resources, and reduce the time lag of video playback to meet the high standards of drone applications for real-time video transmission. Summary of the invention
[0006] The embodiments of the present invention provide a compression coding stable bit rate streaming method and its application, which aims to solve the problems of unstable bit rate, strong I frame dependence leading to difficulty in parsing, and uneven network transmission efficiency in the current technology during the coding and streaming process.
[0007] The core technology of the present invention mainly modifies the encoding module to increase the intra-frame refresh technology support, and adds a buffer flow equalization module, and finally adds the insertion of a pure color I frame before parsing the image to facilitate the normal parsing of the code stream data after equalization.
[0008] In a first aspect, the present invention provides a compression coding stable bit rate streaming method, the method comprising the following steps:
[0009] S00, collecting video data and preprocessing;
[0010] S10, flushing the I frame of the video data into the P frame through the intra-frame refresh strategy to complete the encoding, so that the first frame is an IDR frame and all subsequent frames are P frames;
[0011] S20, sending the encoded code stream queue to the next level device through the network;
[0012] S30, averaging the encoded video data through a first-in-first-out queue through a buffer averaging strategy, and controlling the output rate of the queue so that the data is sent through the UDP protocol at a uniform speed to eliminate the bit rate spike phenomenon in a short period of time;
[0013] S40, inserting a pure color image I frame into the received video data when the player is playing, so as to achieve playback.
[0014] Furthermore, in step S30, the output rate matches a preset rate.
[0015] Furthermore, in step S30, a dynamic bit rate adjustment mechanism is implemented to adjust the output rate of the queue in a timely manner according to the network status and feedback from the receiving end.
[0016] Furthermore, in step S40, before playback starts or when an I frame is lost, a solid color image is automatically inserted into the front end of the bitstream as a virtual I frame, which contains necessary resolution and encoding parameter information to ensure that the player can initialize and correctly parse subsequent P frame content.
[0017] Furthermore, in step S40, a temporary decoding context is established using the virtual I frame as a reference, so that when the actual I frame has not arrived, the image content is temporarily constructed through prediction technology to ensure the continuity of video playback.
[0018] Furthermore, in step S40, the coding efficiency and network transmission status are monitored in real time. When network congestion or reduced coding efficiency is detected, the intra-frame refresh strategy and buffer equalization strategy are dynamically adjusted to optimize the overall streaming performance and ensure smooth transmission and playback experience of the video stream.
[0019] Furthermore, in step S10, during the encoding process, the timing of intra-frame refresh is adaptively determined by analyzing the image content, so as to maintain the video quality while ensuring the stability of the bit rate.
[0020] In a second aspect, the present invention provides a compression encoding stable bit rate streaming device based on the RK3588 platform, comprising:
[0021] Acquisition module, collects video data and performs preprocessing;
[0022] The intra-frame refresh module flushes the I frame of the video data into the P frame through the intra-frame refresh strategy to complete the encoding, so that the first frame is an IDR frame and all subsequent frames are P frames;
[0023] The code stream queue module sends the encoded code stream queue to the next level device through the network;
[0024] The buffer flow balancing module uses a buffer flow balancing strategy to balance the encoded video data through a first-in-first-out queue. By controlling the output rate of the queue, the data is sent through the UDP protocol at a uniform speed to eliminate the bit rate spike phenomenon in a short period of time.
[0025] The real-time frame insertion module inserts a solid color image I frame into the video data received during player playback to achieve playback.
[0026] In a third aspect, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the above-mentioned compression encoding and smooth bit rate streaming method.
[0027] In a fourth aspect, the present invention provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute the process. The process includes the method for streaming at a stable bit rate according to the above-mentioned compression encoding.
[0028] The main contributions and innovations of the present invention are as follows: 1. Compared with the prior art, through the steps of the present invention, the collected images can be compressed by H.264 / H.265 and pushed to the next-level device in a stable code stream, and can be analyzed and displayed normally. Due to the stability of the code stream, no data spikes will be generated, which facilitates the stable transmission of image encoding data under low bandwidth conditions;
[0029] 2. Compared with the prior art, by adopting the intra-frame refresh technology (GDR format), the present invention can effectively eliminate the bit rate spike phenomenon caused by the traditional I frame while maintaining the video quality, realize the continuous and stable transmission of video data, and improve the stability of wireless transmission and the smoothness of video playback.
[0030] 3. Compared with the existing technology, the introduced buffer flow balancing technology manages the sending of encoded data through a first-in-first-out queue, ensuring that data packets are transmitted at a uniform rate in the network, reducing extreme conditions of network idleness and congestion, and improving the overall network resource utilization and transmission efficiency.
[0031] 4. Compared with the existing technology, by innovatively adding real-time interpolation technology on the player side, that is, inserting pure color I frames when there are no I frames, the parsing problem when there are only P frames is solved, ensuring that the video stream can be decoded and played correctly and quickly, reducing the startup delay, usually less than 200ms, and enhancing the user experience.
[0032] 5. Compared with the existing technology, the overall robustness of the video encoding and streaming system is enhanced by the comprehensive application of the above technologies, so that it can better adapt to the decoding capabilities of different network environments and terminal devices, and is especially suitable for wireless transmission scenarios that are sensitive to delays and bandwidth constraints.
[0033] 6. Compared with traditional methods, the present invention achieves a significant improvement in the quality and efficiency of wireless image transmission through software-level optimization without significantly increasing hardware costs, thereby simplifying the complexity of system integration and maintenance.
[0034] The details of one or more embodiments of the invention are set forth in the following drawings and description so that other features, objects, and advantages of the invention are more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0036] Figure 1 This is the process of the compression encoding stable bit rate streaming method based on the RK3588 platform according to an embodiment of the present invention;
[0037] Figure 2 It is a schematic diagram of encoded data using H264 encoding in the prior art;
[0038] Figure 3 It is a schematic diagram of encoded data using H264 encoding according to the solution of the present invention;
[0039] Figure 4 This is a schematic diagram of data transmission in the prior art where data is directly transmitted;
[0040] Figure 5 is a schematic diagram of data transmission using the scheme of the present invention to send data;
[0041] Figure 6 It is a schematic diagram of the scheme of the prior art;
[0042] Figure 7 4 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0044] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0045] The conventional encoding process is as follows Figure 6 As shown in the figure, the captured image is pre-processed and then put into the encoding module, and the encoded code stream queue is sent to the next-level device through the network. The next-level device receives the data and parses and plays it. There are problems such as unstable bit rate during the encoding and streaming process, strong I-frame dependence leading to difficulty in parsing, and uneven network transmission efficiency.
[0046] Based on this, the present invention solves the problems existing in the prior art based on intra-frame refresh, buffer flow sharing and real-time frame insertion.
[0047] Embodiment 1
[0048] The present invention aims to propose a compression coding and stable bit rate streaming method, which increases the support of intra-frame refresh technology by modifying the coding module, adds a buffer flow balancing module, and finally inserts a pure color I frame before parsing the image, so as to facilitate the normal parsing of the bit stream data after the flow balancing.
[0049] Specifically, the embodiment of the present invention provides a compression coding stable bit rate streaming method, specifically, based on the high-performance RK3588 platform, referring to Figure 1 , the method comprising:
[0050] Step 1, intra-frame refresh technology: intra-frame refresh technology is used to refresh I frames into P frames. In conventional H.264 / H.265 encoding, a complete picture (I frame) is used as a reference for other frames (P frames) every several frames (GOP) to parse the correct picture. The structure is IPPP...PPIPPP...PPI. In the structure of intra-frame refresh, only the first frame is an I frame (actually an IDR frame), and all the subsequent frames are P frames. The structure of intra-frame refresh is IPPPPPPPPP..., which is called the video progressive refresh GDR (Gradual decoder refresh) format. The subsequent I frames of intra-frame refresh are actually refreshed into P frames, and the required pictures can be parsed from several P frames. Figure 2 This represents H.264 encoding in normal mode. From the figure, we can see that a large red I frame appears every few frames, and the blue P frames at other times are smaller. The I frame transmission process may cause bandwidth spikes. If the network bandwidth is limited, network congestion or video reception delay may occur. Figure 3 The data showing that the intra-frame refresh is enabled by the solution of the present invention shows that except for the first frame which is a red I frame, the rest of the frames are blue P frames, and the code stream is obviously stable without obvious spikes. In this case, the bandwidth is always relatively stable, and there will be no network congestion or video reception delay.
[0051] Among them, I frame (Intra-coded Picture, key frame) and P frame (Predictive-coded Picture, predicted frame) are two basic frame types used in video compression coding. They are based on the concepts in MPEG and H.26x series video coding standards and are widely used in video processing, transmission and storage. The IDR (Instantaneous Decoding Refresh) frame is a special type of I frame in H.264 and subsequent video coding standards. Although the IDR frame is essentially an I frame, it means that it uses intra-frame coding and can be decoded independently without relying on other frames.
[0052] Preferably, during the encoding process, the timing of intra-frame refresh is adaptively determined by analyzing the image content to maintain video quality while ensuring the stability of the bit rate. This can be achieved through the following key technical steps:
[0053] 1. Image content analysis: First, use image processing algorithms (such as edge detection, motion estimation, texture analysis, etc.) to evaluate the content complexity of each frame. This step may involve calculating the entropy and activity of the image, or using machine learning models to identify dynamically changing and static areas in the image. The more complex or changing the image content, the more frequent refreshes may be required to ensure accurate communication of details.
[0054] 2. Adaptive refresh strategy formulation: Based on the results of image content analysis, the intra-frame refresh (I / P frame conversion) strategy is dynamically adjusted. For example, at the scene boundary where the image content changes dramatically, such as the appearance or disappearance of fast-moving objects, intra-frame refresh points are automatically inserted to avoid cumulative errors caused by long-term reliance on prediction. On the contrary, in scenes with relatively static or slowly changing content, the length of the P frame sequence is extended to reduce unnecessary I frame insertion to maintain high compression efficiency and bit rate stability.
[0055] 3. Bitrate control and quality balance: Combine the current network conditions (such as bandwidth availability, packet loss rate, etc.) and the target video quality requirements to adjust the refresh strategy in real time. For example, when the network bandwidth is tight, the I frame frequency can be appropriately reduced or a less complex refresh method can be used to avoid network congestion, while using content adaptability to minimize the impact on video quality.
[0056] 4. Feedback and optimization loop: The encoder must also be able to receive feedback from the decoder or terminal device, such as real-time bit rate feedback or playback quality reports from the receiving end, to further fine-tune the choice of refresh timing, forming a closed-loop control to ensure the best balance between video quality and transmission efficiency.
[0057] 5. Achieve algorithm and hardware collaboration: On a high-performance platform such as RK3588, its powerful CPU and GPU resources can be used to achieve efficient image analysis and encoding processing, ensuring that the adaptive refresh strategy can be executed in real time, while optimizing hardware resource allocation and reducing processing delays. In this way, not only can the encoding strategy be intelligently adjusted according to image content and network conditions, but also the stability of the bit rate and transmission efficiency can be significantly improved while maintaining video quality. It is especially suitable for wireless image transmission application scenarios that have strict requirements on real-time performance and bandwidth management.
[0058] Step 2: Buffered flow equalization technology: The conventional streaming process encodes the image and transmits it to the outside through the network port. The data is sent to the network port only when the encoded data is completed, and it is idle at other times. In addition, software such as FFMPEG also performs bit rate control over a relatively long period of time, and there are still relatively large spikes in bit rate control in a relatively short period of time. This solution equalizes the encoded data through a first-in-first-out (FIFO) queue, takes out data of different lengths entering at different times from the queue at a uniform speed, and sends it out through UDP. The short-term speed here must match the rate configured by the encoding software, otherwise the data will be played too fast or too slow, or even seriously delayed.
[0059] Figure 4 Indicates the data transmission without current balancing. For example, if 25 frames are sent per second, a frame of data is sent every 40ms. Since the data is not evenly distributed, it is very likely that the data is sent in the first 10ms, but the next 30ms are idle. As a result, the network bandwidth in the first 10ms is large, while the network bandwidth in the next 30ms is very small. In this way, a data spike can be seen every 40ms at the microscopic level.
[0060] Figure 5 This means that after the data is evenly distributed in this solution, data transmission will no longer have spikes in a short period of time. Specifically, a frame of data is collected and then sent evenly at a certain rate; for example, if 25 frames are sent per second, a frame of data is sent evenly within 40ms, thus eliminating the spikes that occur every 40 frames.
[0061] In this embodiment, after the encoder completes the encoding of a frame of image, it immediately sends the encoded data packet into a preset first-in-first-out (FIFO) queue. Each data packet carries its corresponding encoded frame type (such as I frame, P frame) and timestamp information for subsequent processing. A control module can be developed to monitor the status of the queue (such as queue length, accumulated data volume, etc.) and manage the data dequeue rate. The module calculates the required dequeue rate based on the average bit rate preset by the encoding software, and adjusts the frequency at which the data packet is removed from the queue and sent accordingly. Then, a timer or event-driven method is used to ensure that data packets are extracted from the FIFO queue at uniform time intervals and sent out through the UDP protocol. This step requires precise control of the sending interval to match the preset output rate to avoid network congestion and bit rate spikes caused by sudden large data packets.
[0062] Preferably, a dynamic bit rate adjustment mechanism can be implemented to adjust the output rate of the queue in a timely manner according to the network status and feedback from the receiving end to ensure the continuity and stability of data transmission. The details are as follows:
[0063] 1. Network monitoring: Integrated network monitoring function, regular or real-time measurement of network status, including available bandwidth, packet loss rate, latency and other key indicators. This can be done using ICMP ping, TCP handshake or dedicated network detection packages.
[0064] 2. Feedback from the receiving end: The receiving end should provide feedback to the sending end on the actual receiving situation, such as receiving bit rate, decoding delay, buffer status, etc. This can be achieved through RTCP (Real-time Transport Control Protocol) reports or other proprietary protocols.
[0065] 3. Adaptive adjustment strategy: Dynamically adjust the FIFO queue dequeue rate based on network monitoring results and receiving end feedback. For example, when the network condition deteriorates, reduce the data transmission rate to avoid data accumulation and network congestion; when the network condition improves, increase the transmission rate appropriately to make full use of bandwidth resources.
[0066] 4. Trade-off between bit rate and quality: When adjusting the bit rate, the loss of video quality is taken into consideration, and the encoding parameters (such as quantization parameters and frame rate) can be dynamically adjusted to find the best balance between maintaining video smoothness and quality.
[0067] 5. Smooth transition: Any bit rate adjustment should be as smooth as possible to avoid sudden changes, so as not to cause obvious freezes or quality fluctuations in video playback. Therefore, a rate adjustment buffer or smoothing algorithm can be introduced to gradually adjust to the new bit rate setting. It can effectively manage and control the transmission rate of video data, ensuring that video streaming transmission is both stable and efficient in complex and changeable network environments, and at the same time flexibly adjust according to actual conditions to achieve the best transmission effect.
[0068] Step 3: Real-time interpolation technology: After the encoded data is refreshed within the frame, it is likely that the image cannot be correctly parsed through conventional bitstream parsing, because only the first frame has an I frame, and there are no I frames in the subsequent frames. If the parsing program does not receive the I frame of the first frame, it cannot parse the data normally. In order to solve this problem, this solution inserts a frame of pure color image I frame in the player so that it can normally parse the image resolution and other information, and subsequent images can be parsed normally.
[0069] In this embodiment, at the player end, the initial state of the input code stream or whether a key I frame is lost during playback is first detected. This can be achieved by checking the code stream header information, timestamp continuity or a specific marker bit. Once the missing I frame is confirmed, the decoding logic inside the player will automatically generate a solid color image and assign necessary metadata to it. These metadata include but are not limited to image resolution, encoding parameters (such as encoding format, bit rate), frame rate, etc., to ensure that this virtual I frame can be used as the starting point for decoding. The virtual I frame and its metadata are then inserted into the beginning of the actual video stream or the position where the I frame is missing to ensure that the decoder can correctly identify and process this special image.
[0070] Preferably, a virtual I frame can also be used as a reference to establish a temporary decoding context, so that when the actual I frame has not arrived, the image content can be temporarily constructed through prediction technology to ensure the continuity of video playback.
[0071] 1. Decoder initialization: Based on the metadata of the virtual I frame, the decoder initializes the decoding parameters and decoding context, including setting the decoder's working parameters, such as image size, color space, etc., and creating the memory structure required for decoding.
[0072] 2. Prediction and reconstruction: In the absence of an actual I frame as a reference, the decoder uses a virtual I frame as a basis and attempts to construct the initial content of subsequent P frames through prediction techniques (such as motion compensation prediction). Even if it is not accurate enough, it is enough to provide continuous visual effects until the next real I frame arrives.
[0073] 3. Dynamic update: Once the actual I frame arrives, the decoder should immediately use the newly received I frame information to update the decoding context, replace the previous virtual I frame as the new reference frame, and continue to decode subsequent P frames based on this, thereby restoring the normal decoding process.
[0074] 4. Smooth transition: When the actual I frame is connected, the decoder also needs to smoothly transition to avoid image jumps caused by sudden changes in the reference frame. A progressive update strategy or hybrid decoding technology can be used before and after the I frame to gradually transition the decoding reference from the virtual I frame to the actual I frame. In this way, even in the absence of key I frames, the smooth start and continuity of video playback can be guaranteed, and seamless connection can be achieved after the actual I frame arrives, ensuring the continuity of the viewing experience and the correct interpretation of the video content.
[0075] Embodiment 2
[0076] Based on the same concept, the present invention also proposes a compression coding stable bit rate streaming device, comprising:
[0077] Acquisition module, collects video data and performs preprocessing;
[0078] The intra-frame refresh module flushes the I frame of the video data into the P frame through the intra-frame refresh strategy to complete the encoding, so that the first frame is an IDR frame and all subsequent frames are P frames;
[0079] The code stream queue module sends the encoded code stream queue to the next level device through the network;
[0080] The buffer flow balancing module uses a buffer flow balancing strategy to balance the encoded video data through a first-in-first-out queue. By controlling the output rate of the queue, the data is sent through the UDP protocol at a uniform speed to eliminate the bit rate spike phenomenon in a short period of time.
[0081] The real-time frame insertion module inserts a solid color image I frame into the video data received during player playback to achieve playback.
[0082] Embodiment 3
[0083] This embodiment also provides an electronic device, referring to Figure 7 , comprises a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above method embodiments.
[0084] Specifically, the processor 402 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0085] Among them, the memory 404 may include a large capacity memory 404 for data or instructions. For example, but not limitation, the memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 404 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 404 may be inside or outside the data processing device. In a specific embodiment, the memory 404 is a non-volatile memory. In a specific embodiment, the memory 404 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable Programmable Read-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0086] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .
[0087] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any compression encoding and stable bit rate streaming method in the above embodiments.
[0088] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .
[0089] The transmission device 406 can be used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 406 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0090] Input / output devices 408 are used to input or output information.
[0091] Embodiment 4
[0092] This embodiment also provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute a process. The process includes the compression encoding and smooth bit rate streaming method based on the RK3588 platform according to the first embodiment.
[0093] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0094] In general, various embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the boxes, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0095] Embodiments of the present invention can be implemented by computer software, which is executable by a data processor of a mobile device, such as in a processor entity, or implemented by hardware, or implemented by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. Computer program products can include one or more computer executable components configured to perform embodiments when the program is running. One or more computer executable components can be at least one software code or a part thereof. In addition, at this point, it should be noted that any box of the logic flow in the figure can represent program steps, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored in physical media such as memory chips or storage blocks implemented in processors, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and data variants thereof, CDs. Physical media are non-transient media.
[0096] Those skilled in the art should understand that the technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0097] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A compression coding and stable bit rate streaming method, characterized in that: The following steps are involved: S00, collecting video data and preprocessing; S10, flushing the I frame of the video data into the P frame through the intra-frame refresh strategy to complete the encoding, so that the first frame is an IDR frame and all subsequent frames are P frames; S20, using a buffer equalization strategy to equalize the encoded video data through a first-in-first-out bitstream queue, and then send it to the next-level device, and by controlling the output rate of the queue, the data is sent through the UDP protocol at a uniform speed to eliminate the bitrate spike phenomenon in a short period of time; The output rate is matched with the preset rate, and a dynamic bit rate adjustment mechanism is implemented to adjust the output rate of the queue in a timely manner according to the network status and feedback from the receiving end; S30, inserting a pure color image I frame when the player plays the received video data to achieve playback; Among them, before the start of playback or when the I frame is lost, a frame of pure color image is automatically inserted into the front end of the code stream as a virtual I frame, which contains resolution and encoding parameter information to ensure that the player can initialize and correctly parse the subsequent P frame content; using the virtual I frame as a reference, a temporary decoding context is established, so that when the actual I frame has not arrived, the image content can be temporarily constructed through prediction technology to ensure the continuity of video playback.
2. The compression coding stable bit rate streaming method according to claim 1, characterized in that: In step S30, the coding efficiency and network transmission status are monitored in real time. When network congestion or reduced coding efficiency is detected, the intra-frame refresh strategy and buffer equalization strategy are dynamically adjusted to optimize the overall streaming performance and ensure smooth transmission and playback experience of the video stream.
3. The compression coding stable bit rate streaming method according to claim 1 or 2, characterized in that: In step S10, during the encoding process, the timing of intra-frame refresh is adaptively determined by analyzing the image content to maintain the video quality while ensuring the stability of the bit rate.
4. A compression coding stable bit rate streaming device, characterized in that: include: Acquisition module, collects video data and performs preprocessing; The intra-frame refresh module flushes the I frame of the video data into the P frame through the intra-frame refresh strategy to complete the encoding, so that the first frame is an IDR frame and all subsequent frames are P frames; The buffer flow balancing module uses a buffer flow balancing strategy to balance the encoded video data through a first-in-first-out code stream queue, and then sends it to the next-level device. By controlling the output rate of the queue, the data is sent at a uniform speed through the UDP protocol to eliminate the code rate spike phenomenon in a short period of time; The output rate is matched with the preset rate, and a dynamic bit rate adjustment mechanism is implemented to adjust the output rate of the queue in a timely manner according to the network status and feedback from the receiving end; The real-time frame insertion module inserts a solid color image I frame when the player plays the received video data to achieve playback; Among them, before the start of playback or when the I frame is lost, a frame of pure color image is automatically inserted into the front end of the code stream as a virtual I frame, which contains resolution and encoding parameter information to ensure that the player can initialize and correctly parse the subsequent P frame content; using the virtual I frame as a reference, a temporary decoding context is established, so that when the actual I frame has not arrived, the image content can be temporarily constructed through prediction technology to ensure the continuity of video playback.
5. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the compression encoding and stable bit rate streaming method according to any one of claims 1 to 3.
6. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which includes a program code for controlling a process to execute a process, and the process includes the compression encoding and stable bit rate streaming method according to any one of claims 1 to 3.
