Coding rate control method and device, equipment and medium
By evaluating and updating the target bandwidth and handling bandwidth fluctuations according to preset conditions, the user experience problems caused by coding rate fluctuations are solved, and the stability of audio and video quality is achieved.
Patent Information
- Application Number
- CN202411405984.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2024-12-31
AI Technical Summary
The encoding rate changes frequently during fluctuations in network environments or equipment performance, resulting in unstable video and audio quality and poor user experience.
By obtaining the evaluation bandwidth and target bandwidth of the target network link, it is determined whether the bandwidth fluctuation amplitude meets the preset conditions. If the duration does not exceed the preset time, it remains unchanged. If it exceeds the encoding code rate, it is updated to smooth the bandwidth fluctuation.
It effectively avoids frequent fluctuations in encoding coding rate, improves user experience, and ensures the stability of audio and video quality.
Smart Images

Figure CN119232326A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of coding rate control, and in particular to a coding rate control method, device, equipment and medium. Background Art
[0002] The encoding bitrate is also known as the bit rate, which refers to the number of bits used to represent the encoded media data per unit time. The encoding bitrate is usually guided by the estimated bandwidth value. Due to fluctuations in the network environment or device performance, the estimated bandwidth may fluctuate frequently, which in turn causes frequent fluctuations in the encoding bitrate. Fluctuations in the video encoding bitrate will cause problems such as unstable picture quality, freezes, and unsmoothness. Fluctuations in the audio encoding bitrate will cause problems such as fluctuating sound quality, resulting in a poor user experience. Summary of the invention
[0003] In view of this, the purpose of this application is to provide a coding rate control method, device, equipment and medium, which can avoid coding rate frequency fluctuations, thereby improving user experience. The specific scheme is as follows:
[0004] In a first aspect, the present application discloses a coding rate control method, comprising:
[0005] Obtaining an estimated bandwidth and a target bandwidth of a target network link, wherein the target bandwidth is a bandwidth for controlling a current encoding bit rate;
[0006] Determining whether the bandwidth fluctuation amplitude meets a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth;
[0007] When the first preset bandwidth fluctuation condition is met, determining whether the duration of the target bandwidth exceeds a preset duration;
[0008] If the duration does not exceed the preset duration, keeping the target bandwidth unchanged;
[0009] If the duration exceeds the preset duration, the target bandwidth is updated based on the evaluated bandwidth, and the encoding bit rate is updated according to the updated target bandwidth.
[0010] Optionally, judging whether the bandwidth fluctuation amplitude satisfies a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth includes:
[0011] Determining whether the evaluation bandwidth exceeds a first bandwidth threshold, and if the evaluation bandwidth exceeds the first bandwidth threshold, determining that the bandwidth fluctuation amplitude satisfies a first preset bandwidth fluctuation condition;
[0012] The first bandwidth threshold is a threshold determined based on the target bandwidth.
[0013] Optionally, the first bandwidth threshold includes a first threshold and a second threshold, the first threshold is greater than the second threshold, and the determining whether the evaluation bandwidth exceeds the first bandwidth threshold includes:
[0014] If the evaluation bandwidth is higher than the first threshold, or lower than the second threshold, it is determined that the evaluation bandwidth exceeds the first bandwidth threshold.
[0015] Optionally, the preset duration includes a first preset duration and a second preset duration;
[0016] When the evaluation bandwidth is higher than the first threshold, determining whether the duration exceeds the first preset duration; if the duration does not exceed the first preset duration, maintaining the target bandwidth unchanged; if the duration exceeds the first preset duration, smoothing the target bandwidth, and determining the smoothed evaluation bandwidth as a new target bandwidth;
[0017] When the evaluation bandwidth is lower than the second threshold, it is determined whether the duration exceeds the second preset duration; if the duration does not exceed the second preset duration, the target bandwidth is kept unchanged; if the duration exceeds the second preset duration, the target bandwidth is smoothed, and the smoothed evaluation bandwidth is determined as the new target bandwidth.
[0018] Optionally, updating the target bandwidth based on the evaluated bandwidth includes:
[0019] When the evaluation bandwidth is higher than the first threshold, increasing the target bandwidth based on a first preset coefficient;
[0020] When the evaluation bandwidth is lower than the second threshold, the target bandwidth is reduced based on a second preset coefficient.
[0021] Optionally, also include:
[0022] If the evaluated bandwidth does not exceed the first bandwidth threshold, it is determined that the bandwidth fluctuation amplitude does not meet the first preset bandwidth fluctuation condition, and the target bandwidth is kept unchanged.
[0023] Optionally, also include:
[0024] determining whether the bandwidth fluctuation amplitude satisfies a second preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth, wherein the bandwidth fluctuation amplitude satisfying the second preset bandwidth fluctuation condition is higher than the bandwidth fluctuation amplitude satisfying the first preset bandwidth fluctuation condition;
[0025] If the second preset bandwidth fluctuation condition is met, the target bandwidth is updated to the evaluation bandwidth.
[0026] In a second aspect, the present application discloses a coding rate control device, comprising:
[0027] A bandwidth acquisition module, used to acquire an evaluation bandwidth and a target bandwidth of a target network link, wherein the target bandwidth is a bandwidth for controlling a current encoding bit rate;
[0028] A condition judgment module, used to judge whether the bandwidth fluctuation amplitude meets a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth;
[0029] a duration determination module, configured to determine whether the duration of the target bandwidth exceeds a preset duration when the condition determination module determines that the first preset bandwidth fluctuation condition is met;
[0030] The bandwidth updating module is used to keep the target bandwidth unchanged if the duration judgment module determines that the duration does not exceed the preset duration; if the duration exceeds the preset duration, update the target bandwidth based on the evaluated bandwidth, and update the encoding bit rate according to the updated target bandwidth.
[0031] In a third aspect, the present application discloses an electronic device, including a memory and a processor, wherein:
[0032] The memory is used to store the computer program;
[0033] The processor is used to execute the computer program to implement the aforementioned encoding rate control method.
[0034] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned encoding bit rate control method when executed by a processor.
[0035] It can be seen from the above scheme that the present application provides a coding rate control method, including: obtaining an evaluation bandwidth and a target bandwidth of a target network link, wherein the target bandwidth is a bandwidth for controlling a current coding rate; judging whether a bandwidth fluctuation amplitude satisfies a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth; when the first preset bandwidth fluctuation condition is met, judging whether a duration of the target bandwidth exceeds a preset duration; if the duration does not exceed the preset duration, keeping the target bandwidth unchanged; if the duration exceeds the preset duration, updating the target bandwidth based on the evaluation bandwidth, and updating the coding rate according to the updated target bandwidth.
[0036] It can be seen that the beneficial effects of the present application are: obtaining the evaluation bandwidth of the target network link and the target bandwidth for controlling the current encoding bit rate, when the bandwidth fluctuation amplitude meets the first preset bandwidth fluctuation condition, if the duration of the target bandwidth does not exceed the preset duration, the target bandwidth is kept unchanged, if it exceeds the preset duration, the target bandwidth is updated based on the evaluation bandwidth, and then the encoding bit rate is updated. In this way, according to the bandwidth fluctuation situation, by setting the bandwidth fluctuation condition, when the bandwidth fluctuates to a certain extent, the target bandwidth is updated at intervals of a corresponding duration, and then the encoding bit rate is updated, which can avoid the frequency fluctuation of the encoding bit rate, thereby improving the user experience.
[0037] Correspondingly, a coding rate control device, equipment and readable storage medium provided by the present invention also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0039] Figure 1 A flow chart of a coding rate control method provided in an embodiment of the present application;
[0040] Figure 2 A target bandwidth determination flow chart provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of the structure of a coding rate control device provided in an embodiment of the present application;
[0042] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] See also Figure 1 As shown, the embodiment of the present application discloses a coding rate control method, including:
[0045] Step S11: obtaining the evaluation bandwidth and target bandwidth of the target network link, wherein the target bandwidth is the bandwidth for controlling the current encoding bit rate.
[0046] The target network link can be understood as a network link for transmitting media data, and the media data can be audio and / or video data. For example, the audio and video data of a cloud game based on WebRTC (Web Real-Time Communication, a technology that allows web browsers to communicate in real time). The evaluation bandwidth can be the real-time bandwidth obtained by evaluating the target network link based on a preset bandwidth evaluation algorithm, and the preset bandwidth evaluation algorithm can be a congestion control algorithm. The target bandwidth is the bandwidth that controls the current encoding bit rate, that is, the bandwidth used when the encoding bit rate was last updated.
[0047] Step S12: judging whether the bandwidth fluctuation amplitude satisfies a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth.
[0048] The first preset bandwidth fluctuation condition can be understood as a fluctuation condition set for bandwidth fluctuation. If the first preset bandwidth fluctuation condition is met, the step of determining whether the duration of the target bandwidth exceeds the preset duration is triggered.
[0049] In an optional implementation, it can be determined whether the evaluation bandwidth exceeds a first bandwidth threshold. If the evaluation bandwidth exceeds the first bandwidth threshold, it is determined that the bandwidth fluctuation amplitude satisfies a first preset bandwidth fluctuation condition; wherein the first bandwidth threshold is a threshold determined based on the target bandwidth. The first bandwidth threshold can be determined based on the target bandwidth and a preset coefficient, that is, the target bandwidth is multiplied by the preset coefficient to obtain the first bandwidth threshold. The first bandwidth threshold can also be determined based on the target bandwidth and a preset fluctuation amplitude, that is, the target bandwidth is added or subtracted from the preset bandwidth fluctuation amplitude to obtain the first bandwidth threshold.
[0050] Furthermore, the first bandwidth threshold may include a first threshold and a second threshold, the first threshold is greater than the second threshold, and the determination that the evaluation bandwidth exceeds the first bandwidth threshold includes: if the evaluation bandwidth is higher than the first threshold, or lower than the second threshold, then determining that the evaluation bandwidth exceeds the first bandwidth threshold. The first threshold may be a threshold obtained by multiplying the target bandwidth by a preset coefficient greater than 1, or a threshold obtained by adding the target bandwidth to the preset bandwidth fluctuation amplitude. The second threshold may be a threshold obtained by multiplying the target bandwidth by a preset coefficient less than 1, or a threshold obtained by subtracting the preset bandwidth fluctuation amplitude from the target bandwidth, and the preset bandwidth fluctuation amplitudes added or subtracted may be the same or different. The first bandwidth threshold may also be set to the first threshold or the second threshold according to actual needs.
[0051] In another optional implementation, the difference between the evaluation bandwidth and the target bandwidth may be determined, based on which it is determined whether the bandwidth fluctuation amplitude satisfies the first preset bandwidth fluctuation condition. For example, when the difference is greater than the first preset difference, it is determined that the first preset bandwidth fluctuation condition is satisfied. When the evaluation bandwidth is less than the target bandwidth and when the evaluation bandwidth is greater than the target bandwidth, the first preset difference may be different, and of course the same difference may also be set.
[0052] Step S13: When the first preset bandwidth fluctuation condition is met, it is determined whether the duration of the target bandwidth exceeds a preset duration.
[0053] The duration of the target bandwidth can be understood as the duration from the time point when the target bandwidth was last updated to the current time point. The preset duration may include a first preset duration and a second preset duration, and the first preset duration may be the same as or different from the second preset duration.
[0054] Step S14: If the duration does not exceed the preset duration, the target bandwidth is kept unchanged.
[0055] Step S15: if the duration exceeds the preset duration, the target bandwidth is updated based on the evaluated bandwidth, and the encoding bit rate is updated according to the updated target bandwidth.
[0056] In an optional implementation, when the evaluation bandwidth is higher than the first threshold, it is determined whether the duration exceeds the first preset duration; if the duration does not exceed the first preset duration, the target bandwidth is kept unchanged; if the duration exceeds the first preset duration, the target bandwidth is smoothed, and the smoothed evaluation bandwidth is determined as the new target bandwidth; when the evaluation bandwidth is lower than the second threshold, it is determined whether the duration exceeds the second preset duration; if the duration does not exceed the second preset duration, the target bandwidth is kept unchanged; if the duration exceeds the second preset duration, the target bandwidth is smoothed, and the smoothed evaluation bandwidth is determined as the new target bandwidth.
[0057] Further, when the evaluation bandwidth is higher than the first threshold, the target bandwidth may be increased based on a first preset coefficient. When the evaluation bandwidth is lower than the second threshold, the target bandwidth may be decreased based on a second preset coefficient. That is, the first preset coefficient is a coefficient greater than 1, and the second preset coefficient is a coefficient less than 1.
[0058] Further, if the evaluation bandwidth does not exceed the first bandwidth threshold, it is determined that the bandwidth fluctuation amplitude does not meet the first preset bandwidth fluctuation condition, and the target bandwidth remains unchanged. That is, if the first preset bandwidth fluctuation condition is not met, the target bandwidth remains unchanged.
[0059] It is understandable that the evaluation bandwidth does not exceed the first bandwidth threshold, indicating that the bandwidth fluctuation is small and the current network situation is relatively stable. The target bandwidth may not be updated to avoid frequent updates of the target bandwidth during small fluctuations.
[0060] Furthermore, it can be determined whether the bandwidth fluctuation amplitude satisfies a second preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth, wherein the bandwidth fluctuation amplitude that satisfies the second preset bandwidth fluctuation condition is higher than the bandwidth fluctuation amplitude that satisfies the first preset bandwidth fluctuation condition; if the second preset bandwidth fluctuation condition is met, the target bandwidth is updated to the evaluation bandwidth.
[0061] It should be noted that satisfying the second preset bandwidth fluctuation condition indicates that the bandwidth fluctuation range is large, and it is necessary to update the target bandwidth and then update the encoding bit rate, so that the encoding bit rate is more suitable for the current network situation.
[0062] In an optional implementation, if the evaluation bandwidth exceeds the second bandwidth threshold, it is determined that the bandwidth fluctuation amplitude satisfies the second preset bandwidth fluctuation condition. The second bandwidth threshold is a threshold determined based on the target bandwidth. The second bandwidth threshold can be determined based on the target bandwidth and a preset coefficient (different from the preset coefficient for determining the first bandwidth threshold), that is, the target bandwidth is multiplied by the preset coefficient to obtain the second bandwidth threshold. The second bandwidth threshold can also be determined based on the target bandwidth and a preset fluctuation amplitude (different from the preset fluctuation amplitude number for determining the first bandwidth threshold), that is, the target bandwidth is added or subtracted from the preset bandwidth fluctuation amplitude to obtain the second bandwidth threshold. The second bandwidth threshold includes a third threshold and a fourth threshold, the third threshold is greater than the first threshold, and the fourth threshold is less than the second threshold. If the evaluation bandwidth is higher than the third threshold, or lower than the fourth threshold, it is determined that the evaluation bandwidth exceeds the second bandwidth threshold.
[0063] In another optional implementation, the difference between the evaluation bandwidth and the target bandwidth may be determined, based on which it is determined whether the bandwidth fluctuation amplitude satisfies the second preset bandwidth fluctuation condition. When the difference is greater than the second preset difference, it is determined that the second preset bandwidth fluctuation condition is satisfied. When the evaluation bandwidth is less than the target bandwidth and when the evaluation bandwidth is greater than the target bandwidth, the second preset difference may be different, or the same difference may be set.
[0064] Further, when the evaluation bandwidth is higher than the third threshold, the target bandwidth may be increased based on a third preset coefficient. When the evaluation bandwidth is lower than the fourth threshold, the target bandwidth may be reduced based on a fourth preset coefficient. That is, the third preset coefficient is a coefficient greater than 1, and the fourth preset coefficient is a coefficient less than 1. The third preset coefficient may be consistent with or inconsistent with the first preset coefficient, and the fourth preset coefficient may be consistent with or inconsistent with the second preset coefficient.
[0065] In an optional implementation, after determining that the first preset bandwidth fluctuation condition is met, it can be determined based on the evaluation bandwidth and the target bandwidth whether the bandwidth fluctuation amplitude meets the second preset bandwidth fluctuation condition; if the second preset bandwidth fluctuation condition is not met, the step of determining whether the duration of the target bandwidth exceeds the preset duration is triggered; if the second preset bandwidth fluctuation condition is met, the target bandwidth is updated to the evaluation bandwidth.
[0066] In another optional implementation, whether the bandwidth fluctuation amplitude satisfies a second preset bandwidth fluctuation condition can be determined based on the evaluation bandwidth and the target bandwidth. If the second preset bandwidth fluctuation condition is not met, the step of determining whether the bandwidth fluctuation amplitude satisfies a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth is triggered.
[0067] It can be seen that the embodiment of the present application obtains the evaluation bandwidth of the target network link and the target bandwidth for controlling the current encoding bit rate. When the bandwidth fluctuation amplitude meets the first preset bandwidth fluctuation condition, if the duration of the target bandwidth does not exceed the preset duration, the target bandwidth is kept unchanged. If it exceeds the preset duration, the target bandwidth is updated based on the evaluation bandwidth, and then the encoding bit rate is updated. In this way, according to the bandwidth fluctuation situation, by setting the bandwidth fluctuation condition, when the bandwidth fluctuates to a certain extent, the target bandwidth is updated at intervals of a corresponding duration, and then the encoding bit rate is updated, which can avoid the frequency fluctuation of the encoding bit rate, thereby improving the user experience.
[0068] The following takes the encoding bit rate control in the WebRTC cloud gaming scenario as an example to further illustrate the encoding bit rate control solution provided by the embodiment of the present application:
[0069] See also Figure 2 As shown, Figure 2A target bandwidth determination flow chart provided for an embodiment of the present application. According to the congestion control algorithm of WebRTC, the bandwidth is evaluated in real time. When the real-time evaluation bandwidth exceeds high_threshold times of the current target bandwidth or is lower than low_threshold times, the target bandwidth is updated to the real-time evaluation bandwidth; when the real-time evaluation bandwidth is greater than up_threshold times of the smooth evaluation bandwidth and less than high_threshold times, first determine whether the time since the last bandwidth update exceeds up_time_period, if it exceeds, the target bandwidth is updated to up_rate_ratio times of the current target bandwidth, otherwise it remains unchanged; when the real-time evaluation bandwidth is less than down_threshold times of the target bandwidth and greater than low_threshold times, first determine whether the time since the last target bandwidth update exceeds down_time_period, if it exceeds, the target bandwidth is updated to down_rate_ratio times of the current target bandwidth, otherwise it remains unchanged; when the real-time evaluation bandwidth is greater than down_rate_ratio times of the target bandwidth and less than up_rate_ratio times of the target bandwidth, the target bandwidth remains unchanged.
[0070] Among them, high_threshold: the threshold for large upward fluctuation of the assessed bandwidth, the default value is 1.2; low_threshold: the threshold for large downward fluctuation of the assessed bandwidth, the default value is 0.8; up_threshold: the threshold for small upward fluctuation of the assessed bandwidth, the default value is 1.05; down_threshold: the threshold for small downward fluctuation of the assessed bandwidth, the default value is 0.95; up_time_period: the smoothed assessed bandwidth increase after the small upward fluctuation of the assessed bandwidth exceeds the threshold time, the default value is 200ms (i.e. the aforementioned preset time); down_time_period: the smoothed assessed bandwidth decrease after the small downward fluctuation of the assessed bandwidth exceeds the threshold time, the default value is 200ms; up_rate_ratio (i.e. the aforementioned first preset coefficient): the smoothed assessed bandwidth increase coefficient for small upward fluctuation of the assessed bandwidth, the default value is 1.05; down_rate_ratio (i.e. the aforementioned second preset coefficient): the smoothed assessed bandwidth decrease coefficient for small downward fluctuation of the assessed bandwidth, the default value is 0.95. The above coefficients, thresholds and parameters are all configurable. Based on the multiplication of high_threshold and the target bandwidth, the aforementioned third threshold can be obtained, based on the multiplication of low_threshold and the target bandwidth, the aforementioned fourth threshold can be obtained, based on the multiplication of up_threshold and the target bandwidth, the aforementioned first threshold can be obtained, and based on the multiplication of down_threshold and the target bandwidth, the aforementioned second threshold can be obtained.
[0071] In this way, according to the changes in the evaluation bandwidth given by the WebRTC congestion control algorithm, the bandwidth is smoothed. When the bandwidth fluctuates greatly, it indicates that the network situation has indeed changed, so the target bandwidth is equal to the real-time evaluation bandwidth; when the bandwidth fluctuation is small, it indicates that the network situation is very stable, and the target bandwidth remains unchanged; when the bandwidth fluctuation is moderate, according to the upward or downward fluctuation, the interval is long enough to process the upward or downward fluctuation of the target bandwidth. The smoothed evaluation bandwidth, i.e. the target bandwidth, is obtained based on the real-time evaluation bandwidth, and then the target bandwidth is transmitted to the bitrate allocation module, and the encoding bitrate is updated using the target bandwidth, thereby effectively preventing the jitter of the encoding bitrate, ensuring the stability of the audio and video encoding bitrate, and improving the player experience of cloud games.
[0072] See also Figure 3 As shown, this embodiment discloses a coding rate control device, including:
[0073] The bandwidth acquisition module 11 is used to acquire the estimated bandwidth and target bandwidth of the target network link, wherein the target bandwidth is the bandwidth for controlling the current encoding bit rate;
[0074] A condition judgment module 12 is used to judge whether the bandwidth fluctuation amplitude meets a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth;
[0075] The duration judgment module 13 is used to judge whether the duration of the target bandwidth exceeds the preset duration when the condition judgment module determines that the first preset bandwidth fluctuation condition is met;
[0076] The bandwidth updating module 14 is configured to keep the target bandwidth unchanged if the duration judgment module determines that the duration does not exceed the preset duration, and to update the target bandwidth based on the evaluated bandwidth if the duration exceeds the preset duration, and to update the encoding bit rate according to the updated target bandwidth.
[0077] Among them, the condition judgment module 12 is specifically used to: judge whether the evaluated bandwidth exceeds the first bandwidth threshold, and if the evaluated bandwidth exceeds the first bandwidth threshold, determine that the bandwidth fluctuation amplitude meets the first preset bandwidth fluctuation condition; wherein, the first bandwidth threshold is a threshold determined based on the target bandwidth.
[0078] Optionally, the first bandwidth threshold includes a first threshold and a second threshold, and the condition judgment module 12 is specifically used to: if the evaluation bandwidth is higher than the first threshold, or lower than the second threshold, determine that the evaluation bandwidth exceeds the first bandwidth threshold.
[0079] Optionally, the preset duration includes a first preset duration and a second preset duration, and the duration judgment module 13 is specifically used to: when the evaluation bandwidth is higher than the first threshold, judge whether the duration exceeds the first preset duration. Correspondingly, the bandwidth update module 14 is used to keep the target bandwidth unchanged if the duration judgment module 13 determines that the duration does not exceed the first preset duration, and smooth the target bandwidth if the duration judgment module 13 determines that the duration exceeds the first preset duration, and determine the smoothed evaluation bandwidth as the new target bandwidth.
[0080] The duration judgment module 13 is further used to judge whether the duration exceeds the second preset duration when the evaluation bandwidth is lower than the second threshold value. Correspondingly, the bandwidth updating module 14 is used to keep the target bandwidth unchanged if the duration judgment module 13 determines that the duration does not exceed the second preset duration, and smooth the target bandwidth if the duration judgment module 13 determines that the duration exceeds the second preset duration, and determine the smoothed evaluation bandwidth as the new target bandwidth.
[0081] The bandwidth updating module 14 is specifically configured to increase the target bandwidth based on a first preset coefficient when the evaluation bandwidth is higher than the first threshold, and to decrease the target bandwidth based on a second preset coefficient when the evaluation bandwidth is lower than the second threshold.
[0082] In an optional implementation, the condition judgment module 12 is configured to determine that the bandwidth fluctuation amplitude does not satisfy a first preset bandwidth fluctuation condition if the evaluation bandwidth does not exceed the first bandwidth threshold, and keep the target bandwidth unchanged.
[0083] Furthermore, the condition judgment module 12 is also used to judge whether the bandwidth fluctuation amplitude satisfies a second preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth, wherein the bandwidth fluctuation amplitude that satisfies the second preset bandwidth fluctuation condition is higher than the bandwidth fluctuation amplitude that satisfies the first preset bandwidth fluctuation condition; correspondingly, the bandwidth update module 14 is also used to update the target bandwidth to the evaluation bandwidth if the second preset bandwidth fluctuation condition is met.
[0084] It can be seen that the embodiment of the present application obtains the evaluation bandwidth of the target network link and the target bandwidth for controlling the current encoding bit rate. When the bandwidth fluctuation amplitude meets the first preset bandwidth fluctuation condition, if the duration of the target bandwidth does not exceed the preset duration, the target bandwidth is kept unchanged. If it exceeds the preset duration, the target bandwidth is updated based on the evaluation bandwidth, and then the encoding bit rate is updated. In this way, according to the bandwidth fluctuation situation, by setting the bandwidth fluctuation condition, when the bandwidth fluctuates to a certain extent, the target bandwidth is updated at intervals of a corresponding duration, and then the encoding bit rate is updated, which can avoid the frequency fluctuation of the encoding bit rate, thereby improving the user experience.
[0085] See also Figure 4 As shown, an embodiment of the present application discloses an electronic device 20, including a processor 21 and a memory 22; wherein the memory 22 is used to store a computer program; the processor 21 is used to execute the computer program, the encoding bit rate control method disclosed in the above embodiment.
[0086] For the specific process of the above-mentioned encoding rate control method, reference may be made to the corresponding contents disclosed in the above-mentioned embodiments, which will not be described in detail here.
[0087] Furthermore, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.
[0088] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26; wherein the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0089] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the encoding bit rate control method disclosed in the aforementioned embodiment.
[0090] For the specific process of the above-mentioned encoding rate control method, reference may be made to the corresponding contents disclosed in the above-mentioned embodiments, which will not be described in detail here.
[0091] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0092] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0093] The above is a detailed introduction to a coding rate control method, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A coding rate control method, characterized in that: include: Obtaining an estimated bandwidth and a target bandwidth of a target network link, wherein the target bandwidth is a bandwidth for controlling a current encoding bit rate; Determining whether the bandwidth fluctuation amplitude meets a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth; When the first preset bandwidth fluctuation condition is met, determining whether the duration of the target bandwidth exceeds a preset duration; If the duration does not exceed the preset duration, keeping the target bandwidth unchanged; If the duration exceeds the preset duration, the target bandwidth is updated based on the evaluated bandwidth, and the encoding bit rate is updated according to the updated target bandwidth.
2. The coding rate control method according to claim 1, characterized in that: The determining whether the bandwidth fluctuation amplitude satisfies a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth includes: Determining whether the evaluation bandwidth exceeds a first bandwidth threshold, and if the evaluation bandwidth exceeds the first bandwidth threshold, determining that the bandwidth fluctuation amplitude satisfies a first preset bandwidth fluctuation condition; The first bandwidth threshold is a threshold determined based on the target bandwidth.
3. The coding rate control method according to claim 2, characterized in that: The first bandwidth threshold includes a first threshold and a second threshold, the first threshold is greater than the second threshold, and the determining whether the evaluation bandwidth exceeds the first bandwidth threshold includes: If the evaluation bandwidth is higher than the first threshold, or lower than the second threshold, it is determined that the evaluation bandwidth exceeds the first bandwidth threshold.
4. The coding rate control method according to claim 3, characterized in that: The preset duration includes a first preset duration and a second preset duration; When the evaluation bandwidth is higher than the first threshold, determining whether the duration exceeds the first preset duration; if the duration does not exceed the first preset duration, maintaining the target bandwidth unchanged; if the duration exceeds the first preset duration, smoothing the target bandwidth, and determining the smoothed evaluation bandwidth as a new target bandwidth; When the evaluation bandwidth is lower than the second threshold, it is determined whether the duration exceeds the second preset duration; if the duration does not exceed the second preset duration, the target bandwidth is kept unchanged; if the duration exceeds the second preset duration, the target bandwidth is smoothed, and the smoothed evaluation bandwidth is determined as the new target bandwidth.
5. The coding rate control method according to claim 3, characterized in that: The updating of the target bandwidth based on the evaluated bandwidth comprises: When the evaluation bandwidth is higher than the first threshold, increasing the target bandwidth based on a first preset coefficient; When the evaluation bandwidth is lower than the second threshold, the target bandwidth is reduced based on a second preset coefficient.
6. The coding rate control method according to claim 2, characterized in that: Also includes: If the evaluated bandwidth does not exceed the first bandwidth threshold, it is determined that the bandwidth fluctuation amplitude does not meet the first preset bandwidth fluctuation condition, and the target bandwidth is kept unchanged.
7. The coding rate control method according to any one of claims 1 to 6, characterized in that: Also includes: determining whether the bandwidth fluctuation amplitude satisfies a second preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth, wherein the bandwidth fluctuation amplitude satisfying the second preset bandwidth fluctuation condition is higher than the bandwidth fluctuation amplitude satisfying the first preset bandwidth fluctuation condition; If the second preset bandwidth fluctuation condition is met, the target bandwidth is updated to the evaluation bandwidth.
8. A coding rate control device, characterized in that: include: A bandwidth acquisition module, used to acquire an evaluation bandwidth and a target bandwidth of a target network link, wherein the target bandwidth is a bandwidth for controlling a current encoding bit rate; A condition judgment module, used to judge whether the bandwidth fluctuation amplitude meets a first preset bandwidth fluctuation condition based on the evaluation bandwidth and the target bandwidth; a duration determination module, configured to determine whether the duration of the target bandwidth exceeds a preset duration when the condition determination module determines that the first preset bandwidth fluctuation condition is met; The bandwidth updating module is used to keep the target bandwidth unchanged if the duration judgment module determines that the duration does not exceed the preset duration; if the duration exceeds the preset duration, update the target bandwidth based on the evaluated bandwidth, and update the encoding bit rate according to the updated target bandwidth.
9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the encoding rate control method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the encoding rate control method according to any one of claims 1 to 7 is implemented.
