Code rate adjusting method and device, electronic equipment and computer program product
By calculating the maximum available code rate of the media stream and adjusting the expected code rate, the problem of insufficient delay control capability of the code rate adaptation in the existing technology is solved, and better anti-packet loss and delay control is achieved in real-time communication scenarios, and the user experience is optimized.
Patent Information
- Application Number
- CN202411999200.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The existing code rate adaptation solution lacks delay control capabilities in real-time communication scenarios, and cannot effectively meet the low-latency needs of cloud gaming and other applications.
By obtaining the sending code rate of the current video frame and the bit rate statistics information in the historical statistical time period, the maximum available code rate of the media stream is calculated, and the expected code rate is adjusted according to the preset delay parameters, and the encoder is controlled to encode the next video frame.
It improves the delay control capability during bit rate adaptation, meets the anti-packet loss and delay control requirements in real-time transmission scenarios, and optimizes the real-time communication experience.
Smart Images

Figure CN119893184A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a bit rate adjustment method, a bit rate adjustment device, an electronic device, and a computer program product. Background Art
[0002] In the real-time communication scenario, the network bandwidth resources are limited. When the network congestion detection algorithm responds to bandwidth changes by adjusting the sending rate, the real-time communication system also needs to quickly adjust the production rate of the media source (audio, video) to adapt to the change in the sending rate, thereby optimizing the communication experience, including clarity, delay, fluency, etc. For example, in the cloud gaming scenario, the industry standard recommends that the interaction delay should be controlled within 100 milliseconds to obtain a better user experience.
[0003] As the demand for applications such as real-time communications and cloud gaming grows, the delay control capabilities of current bitrate adaptation solutions are not accurate enough to effectively address the above needs.
[0004] In view of this, there is an urgent need in the art for a code rate adjustment method that can improve the delay control capability during code rate adaptation and optimize the real-time communication experience. Summary of the invention
[0005] The purpose of the present disclosure is to provide a bit rate adjustment method, a bit rate adjustment device, an electronic device and a computer program product, thereby at least to a certain extent being able to improve the delay control capability during bit rate adaptation and optimize the real-time communication experience.
[0006] According to a first aspect of the present disclosure, a method for adjusting a bit rate is provided, comprising:
[0007] Get the sending bit rate of the current video frame when it is sent;
[0008] Obtaining the maximum available bit rate of the media stream according to the bit rate statistical information in the historical statistical time period and the sending bit rate of the current video frame;
[0009] Determining an expected bit rate when sending the next video frame according to the maximum available bit rate of the media stream;
[0010] The expected bit rate is adjusted according to the preset delay parameter, and the encoder is controlled to encode the next video frame according to the adjusted expected bit rate.
[0011] In an exemplary embodiment of the present disclosure, obtaining the maximum available bit rate of the media stream according to the bit rate statistical information in the historical statistical time period and the sending bit rate of the current video frame includes:
[0012] Obtaining the maximum sending bit rate of the media stream according to the bit rate statistical information within the historical statistical time period and the sending bit rate of the current video frame;
[0013] The maximum available bit rate of the media stream is obtained according to the maximum sending bit rate of the media stream.
[0014] In an exemplary embodiment of the present disclosure, obtaining the maximum sending bit rate of the media stream according to the bit rate statistical information in the historical statistical time period and the sending bit rate of the current video frame includes:
[0015] The maximum sending bit rate of the media stream is obtained according to the average media bit rate, the average forward error correction bit rate, the average arrival confirmation bit rate, the total sending bit rate and the sending bit rate of the current video frame in the historical statistical time period.
[0016] In an exemplary embodiment of the present disclosure, obtaining the maximum available bit rate of the media stream according to the maximum sending bit rate of the media stream includes:
[0017] Obtain cache statistics information, and obtain an expected cache drain rate based on the cache statistics information;
[0018] A maximum available bit rate of the media stream is obtained according to the maximum sending bit rate and the expected buffer draining rate.
[0019] In an exemplary embodiment of the present disclosure, obtaining an expected cache drain rate according to the cache statistical information includes:
[0020] The expected cache draining rate is obtained according to the ratio of the sending cache value in the cache statistical information to the expected cache draining duration.
[0021] In an exemplary embodiment of the present disclosure, determining the expected bit rate when sending the next video frame according to the maximum available bit rate of the media stream includes:
[0022] An expected forward error correction redundancy ratio is obtained, and an expected bit rate for sending the next video frame is obtained according to the maximum available bit rate of the media stream and the forward error correction redundancy ratio.
[0023] In an exemplary embodiment of the present disclosure, adjusting the expected bit rate according to a preset delay parameter includes:
[0024] Get the video frame parameters of the maximum video frame in the historical sending process;
[0025] The adjusted expected bit rate is obtained according to the video frame parameters of the maximum video frame and the preset delay parameters.
[0026] According to a second aspect of the present disclosure, a device for adjusting a bit rate is provided, comprising:
[0027] A current bit rate acquisition module is configured to execute acquisition of a sending bit rate of a current video frame when it is being sent;
[0028] A maximum bit rate determination module is configured to obtain a maximum available bit rate of a media stream based on bit rate statistical information within a historical statistical time period and a sending bit rate of the current video frame;
[0029] An expected bit rate determination module is configured to determine an expected bit rate when sending the next video frame according to the maximum available bit rate of the media stream;
[0030] The expected bit rate adjustment module is configured to adjust the expected bit rate according to a preset delay parameter, and control the encoder to encode the next video frame according to the adjusted expected bit rate.
[0031] In an exemplary embodiment of the present disclosure, the maximum bit rate determination module includes:
[0032] A maximum transmission bit rate determination unit is configured to obtain a maximum transmission bit rate of the media stream according to bit rate statistical information within a historical statistical time period and the transmission bit rate of the current video frame;
[0033] The maximum available bit rate determining unit is configured to obtain the maximum available bit rate of the media stream according to the maximum sending bit rate of the media stream.
[0034] In an exemplary embodiment of the present disclosure, the maximum transmission code rate determining unit includes:
[0035] The maximum sending bit rate calculation unit is configured to obtain the maximum sending bit rate of the media stream based on the media average bit rate, the forward error correction average bit rate, the arrival confirmation average bit rate, the total sending bit rate and the sending bit rate of the current video frame within a historical statistical time period.
[0036] In an exemplary embodiment of the present disclosure, the maximum available bit rate determining unit includes:
[0037] a cache drain rate determination unit, configured to obtain cache statistical information and obtain an expected cache drain rate according to the cache statistical information;
[0038] The maximum available bit rate calculation unit is configured to obtain the maximum available bit rate of the media stream according to the maximum sending bit rate and the expected buffer emptying rate.
[0039] In an exemplary embodiment of the present disclosure, the cache drain rate determination unit includes:
[0040] The cache drain rate calculation unit is configured to obtain the expected cache drain rate based on the ratio of the send cache value in the cache statistical information to the expected cache drain duration.
[0041] In an exemplary embodiment of the present disclosure, the expected bit rate determination module includes:
[0042] The expected bit rate calculation unit is configured to obtain an expected forward error correction redundancy ratio and obtain an expected bit rate when sending the next video frame according to the maximum available bit rate of the media stream and the forward error correction redundancy ratio.
[0043] In an exemplary embodiment of the present disclosure, the expected bit rate adjustment module includes:
[0044] A maximum video frame parameter acquisition unit, configured to execute acquisition of video frame parameters of a maximum video frame in a historical sending process;
[0045] The expected bit rate adjustment unit is configured to execute the video frame parameter of the maximum video frame and the preset delay parameter to obtain the adjusted expected bit rate.
[0046] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement any one of the above-mentioned bit rate adjustment methods.
[0047] According to a fourth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method for adjusting the bit rate described in any one of the above is implemented.
[0048] The exemplary embodiments of the present disclosure may have the following beneficial effects:
[0049] In the bitrate adjustment method of the exemplary implementation method of the present disclosure, the maximum available bitrate of the media stream is obtained by the sending bitrate of the current video frame when it is sent and the bitrate statistics information in the historical statistical time period, and then the expected bitrate when the next video frame is sent is determined according to the maximum available bitrate of the media stream, and then the expected bitrate is adjusted according to the preset delay parameter, and the encoder is controlled to encode the next video frame according to the adjusted expected bitrate. The bitrate adjustment method in the exemplary implementation method of the present disclosure, on the one hand, can meet the anti-packet loss requirements in the real-time transmission scenario by calculating the maximum available bitrate of the media stream, and solve the problems of buffer accumulation and encoding frame size fluctuation at the sender; on the other hand, the expected bitrate is adjusted by the preset delay parameter, which can meet the delay control requirements in the real-time transmission scenario, improve the delay control capability during bitrate adaptation, and achieve the optimal real-time communication experience under the constraint of the delay parameter. The bitrate adjustment method in the exemplary implementation method of the present disclosure realizes a low-delay bitrate adaptation scheme by comprehensively considering the anti-packet loss requirements and delay control requirements in the real-time transmission scenario, which can control the delay of the sender and ensure the user experience of low-delay services.
[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0052] Figure 1 A schematic flow chart showing a method for adjusting a bit rate according to an exemplary embodiment of the present disclosure is shown;
[0053] Figure 2 A schematic diagram of a process of obtaining a maximum available bit rate of a media stream according to bit rate statistics and a sending bit rate of a current video frame in an exemplary embodiment of the present disclosure is shown;
[0054] Figure 3 A schematic diagram of a process of obtaining a maximum available bit rate according to a maximum sending bit rate of a media stream in an exemplary embodiment of the present disclosure is shown;
[0055] Figure 4 A schematic flow chart of a method for adjusting a bit rate in a specific implementation manner of the present disclosure is shown;
[0056] Figure 5A schematic diagram showing a system architecture for bit rate adjustment in a specific embodiment of the present disclosure is shown;
[0057] Figure 6 A block diagram showing a device for adjusting a code rate according to an exemplary embodiment of the present disclosure is shown;
[0058] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0059] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein.
[0061] The following example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0062] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0063] In the RTC (Realtime Communication) transmission system, flow control is mainly completed by congestion control and bit rate adaptation. The congestion control algorithm is used to control the sending rate of the sender, and the sending controller smoothes the data transmission according to the rate. The bit rate adaptation algorithm is used to control the generation rate of the upper layer media.
[0064] Due to the characteristics of the video encoding algorithm, the size of the video frame is naturally volatile, and the instantaneous encoding bit rate may be much higher than the sending rate, resulting in a send buffer pile-up. At the same time, due to changes in the available network bandwidth, the sending rate drops, and the encoder code control cannot respond in time, which can also cause a send buffer pile-up. In addition, due to the problem of network packet loss, in order to ensure the arrival rate and delay of the transmission, a certain rate needs to be consumed to combat packet loss.
[0065] In some related embodiments, the rate adaptation algorithm in WebRTC (Web Realtime Communication) can be used to adjust the media source rate through congestion control sending rate, expected FEC (Forward Error Correction) rate, and expected retransmission rate. However, the rate adaptation algorithm in WebRTC only allocates the sending rate to media, FEC, and retransmission according to historical statistics, and does not fully consider factors such as fluctuations in the size of encoded video frames and sending buffers, and cannot optimize the communication experience.
[0066] In other related embodiments, the media rate can be adjusted by a media rate control algorithm based on network queuing delay according to BUR (Bandwidth Utilization Ratio) using MIMD (Multiplicative-Increase / Multiplicative-Decrease) or AIMD (Additive-Increase / Multiplicative-Decrease). However, this method does not take into account the bandwidth consumed when the anti-packet loss requirement is not met under a weak network, and does not consider the problem of fluctuations in the size of the encoded video frame. In addition, the algorithm based on queuing delay is easily affected by network jitter and cannot optimize the communication experience.
[0067] Based on the above problems, this exemplary embodiment first provides a method for adjusting the bit rate. Figure 1 As shown, the above-mentioned method for adjusting the bit rate may include the following steps:
[0068] Step S110: Obtain the sending bit rate of the current video frame when it is sent.
[0069] Step S120: Obtain the maximum available bit rate of the media stream according to the bit rate statistical information in the historical statistical time period and the sending bit rate of the current video frame.
[0070] Step S130: Determine the expected bit rate for sending the next video frame according to the maximum available bit rate of the media stream.
[0071] Step S140: Adjust the expected bit rate according to the preset delay parameter, and control the encoder to encode the next video frame according to the adjusted expected bit rate.
[0072] The bitrate adjustment method in the example implementation of the present disclosure, on the one hand, can meet the packet loss resistance requirements in the real-time transmission scenario by calculating the maximum available bitrate of the media stream, and solve the problems of buffer accumulation and encoding frame size fluctuation at the sender end; on the other hand, by adjusting the expected bitrate through preset delay parameters, it can meet the delay control requirements in the real-time transmission scenario, improve the delay control capability during bitrate adaptation, and achieve the optimal real-time communication experience under the constraints of delay parameters. The bitrate adjustment method in the example implementation of the present disclosure, by comprehensively considering the packet loss resistance requirements and delay control requirements in the real-time transmission scenario, realizes a low-latency bitrate adaptation scheme, which can control the delay at the sender end and ensure the user experience of low-latency services.
[0073] Next, combine Figures 2 to 5 The above steps of this exemplary embodiment are described in more detail.
[0074] In step S110, the sending bit rate of the current video frame when it is sent is obtained.
[0075] In this example implementation, during the real-time transmission of the media stream, after the current congestion control algorithm updates the sending bit rate, the current sending bit rate will be sent to the sending controller, i.e., the sending end of the video frame, and the sending controller will send the current video frame according to the current sending bit rate.
[0076] In step S120, the maximum available bit rate of the media stream is obtained according to the bit rate statistical information in the historical statistical time period and the sending bit rate of the current video frame.
[0077] In this example implementation, the maximum available bit rate of the currently transmitted media stream may be obtained according to the sending bit rate pacing_rate when the sending controller sends the current video frame and bit rate statistics information within a historical statistical time period.
[0078] In this example implementation, Figure 2As shown, according to the bit rate statistics information in the historical statistical time period and the sending bit rate of the current video frame, the maximum available bit rate of the media stream is obtained, which may specifically include the following steps:
[0079] Step S210: Obtain the maximum sending bit rate of the media stream according to the bit rate statistical information in the historical statistical time period and the sending bit rate of the current video frame.
[0080] In this example implementation, the maximum transmission bit rate of the media stream can be obtained according to the media average bit rate, forward error correction average bit rate, arrival confirmation average bit rate, total transmission bit rate and transmission bit rate of the current video frame in the historical statistical time period. Among them, the media average bit rate app_rate is the average bit rate actually sent by the media in the historical statistical time period, the forward error correction average bit rate fec_rate is the average bit rate of fec (Forward Error Correction, forward error correction code) in the historical statistical time period, and the arrival confirmation average bit rate ack_rate is the average bit rate of confirmed reception in the historical statistical time period.
[0081] The bitrate statistics information within the historical statistical time period may include app_rate (average media bitrate), fec_rate (average fec bitrate), ack_rate (average ack bitrate), and total_sent_rate (total sent bitrate). The maximum sending bitrate of the media stream may be calculated based on the above historical statistical information.
[0082] Exemplarily, a first difference can be calculated based on the sending bit rate pacing_rate and the average arrival confirmation bit rate ack_rate, and a first ratio can be calculated using the average media bit rate app_rate, the average forward error correction bit rate fec_rate, the total sending bit rate total_sent_rate and the average arrival confirmation bit rate ack_rate, and then the maximum sending bit rate is obtained based on the first difference and the first ratio.
[0083] Exemplarily, the first difference may be expressed as pacing_rate-ack_rate, and the first ratio may be expressed as The calculation formula for the maximum transmission code rate is obtained by multiplying the first difference by the first ratio:
[0084] Step S220: Obtain the maximum available bit rate of the media stream according to the maximum sending bit rate of the media stream.
[0085] In this example implementation, the maximum available bit rate of the media stream can be calculated based on the maximum sending bit rate of the media stream and the cache statistical information, wherein the cache statistical information refers to statistical information related to the sending cache.
[0086] In this example implementation, Figure 3 As shown, the maximum available bit rate of the media stream is obtained according to the maximum sending bit rate of the media stream, which may specifically include the following steps:
[0087] Step S310: Obtain cache statistical information, and obtain an expected cache emptying rate according to the cache statistical information.
[0088] The cache statistics information may include a send buffer value and an expected cache drain duration, wherein the send buffer value buffer refers to the size of the send buffer, and the expected cache drain duration drain_duration refers to the expected value of the duration required to drain the send buffer. According to the ratio of the send buffer value in the cache statistics information to the expected cache drain duration, the expected cache drain rate may be obtained, and the expected cache drain rate refers to the expected value of the drain rate of the send buffer.
[0089] Step S320: Obtain the maximum available bit rate of the media stream according to the maximum sending bit rate and the expected buffer drain rate.
[0090] The maximum available bit rate of the media stream can be obtained based on the difference between the maximum sending bit rate and the expected buffer drain rate.
[0091] Exemplarily, the maximum transmission bit rate calculated based on the bit rate statistics within the historical statistical time period is expressed as The expected cache drain rate is expressed as The maximum available bit rate ideal_rate is calculated as follows:
[0092]
[0093] In step S130, the expected bit rate for sending the next video frame is determined according to the maximum available bit rate of the media stream.
[0094] In this example implementation, the maximum available bit rate of the media stream can be adjusted according to a certain redundancy ratio to obtain the expected bit rate when the next video frame is sent. For example, the expected forward error correction redundancy ratio can be obtained, and the expected bit rate when the next video frame is sent can be obtained according to the maximum available bit rate of the media stream and the forward error correction redundancy ratio. The expected forward error correction redundancy ratio fec_ratio can be used to combat the problem of network packet loss.
[0095] Exemplarily, the rate adjustment ratio may be calculated based on the expected forward error correction redundancy ratio fec_ratio, and then the expected rate expect_rate of the next frame of the media stream may be obtained according to the rate adjustment ratio and the maximum available rate ideal_rate.
[0096] Exemplarily, the bit rate adjustment ratio is expressed as The expected bit rate expect_rate of the next frame of media stream is calculated as follows:
[0097]
[0098] In step S140, the expected bit rate is adjusted according to the preset delay parameter, and the encoder is controlled to encode the next video frame according to the adjusted expected bit rate.
[0099] In this example implementation, the video frame parameters of the maximum video frame in the historical sending process may be acquired, and the adjusted expected bit rate may be obtained according to the video frame parameters of the maximum video frame and the preset delay parameters.
[0100] If the video frame is sent directly according to the expected bit rate, the ideal sending time of the video frame of size F at the expected bit rate expect_rate is:
[0101]
[0102] Due to the volatility of the encoded video frame size, the actual size of the video frame can be ignored when adjusting the expected bit rate. Instead, the expected bit rate can be adjusted based on the size of the maximum video frame in the historical sending process. At the same time, the maximum acceptable delay can be combined so that the adjusted expected bit rate can meet the sending delay requirement.
[0103] For example, the adjustment ratio of the expected bit rate can be obtained according to the expected bit rate, the delay parameter and the maximum video frame, and then the expected bit rate is adjusted according to the adjustment ratio of the expected bit rate. For example, the adjusted expected bit rate can be obtained by calculating the expected bit rate and multiplying it by the adjustment ratio.
[0104] For example, under the frame delay requirement max_sent_delay, the adjustment ratio of the expected bit rate can be expressed as The expected bit rate of the adjusted media satisfies the following formula:
[0105]
[0106] Among them, max_frame_size is the maximum frame size of historical statistics, and max_sent_delay is the delay parameter, which indicates the maximum acceptable delay. By adjusting the expected bit rate through the preset delay parameter, the sending delay requirement can be met. Finally, the audio and video encoder is controlled to encode the next video frame according to the adjusted expected bit rate.
[0107] like Figure 4 FIG. 1 is a complete flow chart of a method for adjusting a bit rate in a specific implementation manner of the present disclosure. Figure 5A schematic diagram showing a system architecture for bit rate adjustment in a specific implementation of the present disclosure is provided, which is an example of the above steps in this example implementation. The specific steps of the flowchart are as follows:
[0108] Step S410: Update the sending code rate.
[0109] After the congestion control algorithm updates the sending controller's sending bit rate pacing_rate when sending the current video frame, the bit rate adaptation algorithm process is triggered.
[0110] Step S420: Calculate the maximum available bit rate.
[0111] The maximum available bit rate ideal_rate of the media stream is calculated according to the bit rate statistics information in the historical statistical time period and the sending bit rate pacing_rate when the sending controller sends the current video frame.
[0112] Step S430: Bit rate allocation.
[0113] The bit rate is allocated according to the expected FEC redundancy ratio to obtain the expected bit rate expect_rate of the next frame of the media stream.
[0114] Step S440: Coding adaptation.
[0115] Under the frame delay requirement max_sent_delay, adjust the expected bit rate expect_rate to obtain expect_media_rate to meet the sending delay requirement.
[0116] Step S450. Feedback.
[0117] The adjusted expected bit rate is fed back to the audio and video encoder to send the next video frame.
[0118] In this example implementation, by proposing a low-latency bitrate adaptation method, the sender delay can be controlled within the maximum delay max_sent_delay, and the real-time communication experience can be optimized in the case of packet loss network and coded frame size fluctuations. The bitrate adjustment method in the example implementation of this disclosure has been fully implemented in scenarios such as short video RTC, cloud games, and low-latency live broadcasts, among which the average online control delay of cloud games can be effectively controlled within 100 milliseconds.
[0119] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0120] Furthermore, the present disclosure also provides a device for adjusting the bit rate. Figure 6 As shown, the bit rate adjustment device may include a current bit rate acquisition module 610, a maximum bit rate determination module 620, an expected bit rate determination module 630, and an expected bit rate adjustment module 640. Among them:
[0121] The current bit rate acquisition module 610 is configured to execute acquisition of the sending bit rate of the current video frame when it is sent;
[0122] The maximum bit rate determination module 620 is configured to obtain the maximum available bit rate of the media stream according to the bit rate statistical information in the historical statistical time period and the sending bit rate of the current video frame;
[0123] The expected bit rate determination module 630 is configured to determine the expected bit rate when sending the next video frame according to the maximum available bit rate of the media stream;
[0124] The expected bit rate adjustment module 640 is configured to adjust the expected bit rate according to a preset delay parameter, and control the encoder to encode the next video frame according to the adjusted expected bit rate.
[0125] In some exemplary embodiments of the present disclosure, the maximum code rate determination module 620 may include a maximum transmission code rate determination unit and a maximum available code rate determination unit.
[0126] The maximum transmission bit rate determination unit is configured to obtain the maximum transmission bit rate of the media stream according to the bit rate statistical information in the historical statistical time period and the transmission bit rate of the current video frame;
[0127] The maximum available bit rate determining unit is configured to obtain the maximum available bit rate of the media stream according to the maximum sending bit rate of the media stream.
[0128] In some exemplary embodiments of the present disclosure, the maximum sending bit rate determination unit may include a maximum sending bit rate calculation unit, which is configured to execute the maximum sending bit rate of the media stream based on the average media bit rate, the forward error correction average bit rate, the arrival confirmation average bit rate, the total sending bit rate and the sending bit rate of the current video frame within a historical statistical time period.
[0129] In some exemplary embodiments of the present disclosure, the maximum available code rate determination unit may include a cache emptying rate determination unit and a maximum available code rate calculation unit.
[0130] a cache drain rate determination unit, configured to obtain cache statistical information and obtain an expected cache drain rate according to the cache statistical information;
[0131] The maximum available bit rate calculation unit is configured to obtain the maximum available bit rate of the media stream according to the maximum sending bit rate and the expected buffer emptying rate.
[0132] In some exemplary embodiments of the present disclosure, the cache drain rate determination unit may include a cache drain rate calculation unit configured to obtain an expected cache drain rate based on a ratio of a sent cache value in cache statistics information to an expected cache drain duration.
[0133] In some exemplary embodiments of the present disclosure, the expected bit rate determination module 630 may include an expected bit rate calculation unit, which is configured to execute acquisition of an expected forward error correction redundancy ratio, and obtain an expected bit rate when the next video frame is sent based on the maximum available bit rate of the media stream and the forward error correction redundancy ratio.
[0134] In some exemplary embodiments of the present disclosure, the expected bit rate adjustment module 640 may include a maximum video frame parameter acquisition unit and an expected bit rate adjustment unit.
[0135] A maximum video frame parameter acquisition unit, configured to execute acquisition of video frame parameters of a maximum video frame in a historical sending process;
[0136] The expected bit rate adjustment unit is configured to execute the video frame parameters of the maximum video frame and the preset delay parameters to obtain the adjusted expected bit rate.
[0137] The specific details of each module / unit in the above-mentioned bit rate adjustment device have been described in detail in the corresponding method embodiment part, and will not be repeated here.
[0138] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown.
[0139] It should be noted that Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0140] like Figure 7As shown, computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. Various programs and data required for system operation are also stored in RAM 703. CPU 701, ROM 702 and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to bus 704.
[0141] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0142] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present disclosure are executed.
[0143] The exemplary embodiments of the present disclosure further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned bit rate adjustment method is implemented.
[0144] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0145] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0146] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0147] The computer program may be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. The electronic device may convert the signal carrying the computer program into a digital signal, thereby running the computer program. When the computer program is run on an electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device may execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned bit rate adjustment method.
[0148] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0149] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules described above can be concretized in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be concretized.
[0150] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0151] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for adjusting a bit rate, characterized in that: include: Get the sending bit rate of the current video frame when it is sent; Obtaining the maximum available bit rate of the media stream according to the bit rate statistical information in the historical statistical time period and the sending bit rate of the current video frame; Determining an expected bit rate when sending the next video frame according to the maximum available bit rate of the media stream; The expected bit rate is adjusted according to the preset delay parameter, and the encoder is controlled to encode the next video frame according to the adjusted expected bit rate.
2. The method for adjusting the bit rate according to claim 1, characterized in that: The obtaining, according to the bit rate statistics information in the historical statistical time period and the sending bit rate of the current video frame, the maximum available bit rate of the media stream includes: Obtaining the maximum sending bit rate of the media stream according to the bit rate statistical information within the historical statistical time period and the sending bit rate of the current video frame; The maximum available bit rate of the media stream is obtained according to the maximum sending bit rate of the media stream.
3. The method for adjusting the bit rate according to claim 2, characterized in that: The obtaining, according to the bit rate statistics information in the historical statistical time period and the sending bit rate of the current video frame, the maximum sending bit rate of the media stream includes: The maximum sending bit rate of the media stream is obtained according to the average media bit rate, the average forward error correction bit rate, the average arrival confirmation bit rate, the total sending bit rate and the sending bit rate of the current video frame in the historical statistical time period.
4. The method for adjusting the bit rate according to claim 2, characterized in that: The obtaining, according to the maximum sending bit rate of the media stream, a maximum available bit rate of the media stream includes: Obtain cache statistics information, and obtain an expected cache drain rate based on the cache statistics information; A maximum available bit rate of the media stream is obtained according to the maximum sending bit rate and the expected buffer draining rate.
5. The method for adjusting the bit rate according to claim 4, characterized in that: The obtaining an expected cache drain rate according to the cache statistical information includes: The expected cache draining rate is obtained according to the ratio of the sending cache value in the cache statistical information to the expected cache draining duration.
6. The method for adjusting the bit rate according to claim 1, characterized in that: The determining, according to the maximum available bit rate of the media stream, the expected bit rate when sending the next video frame includes: An expected forward error correction redundancy ratio is obtained, and an expected bit rate for sending the next video frame is obtained according to the maximum available bit rate of the media stream and the forward error correction redundancy ratio.
7. The method for adjusting the bit rate according to claim 1, characterized in that: The adjusting the expected bit rate according to the preset delay parameter includes: Get the video frame parameters of the maximum video frame in the historical sending process; The adjusted expected bit rate is obtained according to the video frame parameters of the maximum video frame and the preset delay parameters.
8. A bit rate adjustment device, characterized in that: include: A current bit rate acquisition module is configured to execute acquisition of a sending bit rate of a current video frame when it is being sent; A maximum bit rate determination module is configured to obtain a maximum available bit rate of a media stream based on bit rate statistical information within a historical statistical time period and a sending bit rate of the current video frame; An expected bit rate determination module is configured to determine an expected bit rate when sending the next video frame according to the maximum available bit rate of the media stream; The expected bit rate adjustment module is configured to adjust the expected bit rate according to a preset delay parameter, and control the encoder to encode the next video frame according to the adjusted expected bit rate.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instruction to implement the bit rate adjustment method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for adjusting the bit rate according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Video coding method and device, computer readable storage medium and computer equipment
CN110213585A
Video coding method and device, electronic equipment and storage medium
CN113676730A
Methods and systems for improved drilling operations using real-time and historical drilling data
WO2014066981A1
Video transmission method, apparatus and device, and storage medium
WO2024120134A1