Code rate self-adaption method and device, computer equipment and storage medium
By introducing a buffer threshold gating mechanism, the problem of switching in neural network models that violate physical principles during bitrate adaptation is solved, thereby achieving stability and smoothness in video playback and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING QIYI CENTURY SCI & TECH CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-19
AI Technical Summary
In existing methods for adaptive bitrate determination, neural network models sometimes make bitrate switching decisions that violate physical principles, leading to the risk of video playback stuttering.
A buffer threshold-based gating mechanism is introduced. By obtaining the current suggested bitrate and buffer length output by the bitrate prediction model and comparing them with the buffer threshold, a target bitrate that conforms to physical common sense is determined, thus avoiding unreasonable bitrate switching.
It effectively avoids the risk of stuttering caused by unreasonable bitrate switching, ensuring the smoothness and stability of video playback and improving the user experience.
Smart Images

Figure CN122069408A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of adaptive bitrate, and more particularly to an adaptive bitrate method, apparatus, computer device, and storage medium. Background Technology
[0002] With the explosive growth of internet video traffic, HTTP adaptive streaming media has become the mainstream video transmission technology. Client players need to dynamically select the most suitable video bitrate based on the current fluctuating network bandwidth in order to maximize video clarity while ensuring smooth playback.
[0003] However, the existing method of adaptive bitrate determination uses a reinforcement learning model to directly output a suggested bitrate based on the network state of the neural network. However, the existing model occasionally makes bitrate switching decisions that violate physical common sense, resulting in a serious risk of stuttering. Summary of the Invention
[0004] This application provides a bitrate adaptive method, apparatus, computer device, and storage medium to address the problem of how to avoid the risk of stuttering when the model makes bitrate switching decisions that violate physical common sense.
[0005] Firstly, this application provides a bitrate adaptive method, the method comprising: Get the current suggested bitrate output by the bitrate prediction model; The target bitrate is determined based on the bitrate comparison results between the current suggested bitrate and the current application bitrate, and the buffer comparison results between the current buffer length and the buffer threshold. Bitrate adaptation is performed according to the target bitrate.
[0006] Secondly, this application provides a bitrate adaptive device, the device comprising: The acquisition module is used to obtain the current suggested bitrate output by the bitrate prediction model; The processing module is used to determine the target bitrate based on the bitrate comparison result between the current suggested bitrate and the current application bitrate, and the buffer comparison result between the current buffer length and the buffer threshold; An execution module is used to perform bitrate adaptation according to the target bitrate.
[0007] Thirdly, this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described bitrate adaptive method.
[0008] Fourthly, this application also provides a computer storage medium storing computer-executable instructions for executing the above-described bitrate adaptive method.
[0009] Compared with the prior art, the above-mentioned technical solution provided in this application embodiment has the following advantages: The method provided in this application embodiment obtains the current suggested bitrate output by the bitrate prediction model; determines the target bitrate based on the bitrate comparison result between the current suggested bitrate and the current application bitrate, and the buffer comparison result between the current buffer length and the buffer threshold; and performs bitrate adaptation according to the target bitrate.
[0010] Based on the above method, a gating mechanism based on buffer threshold is introduced for the current suggested bitrate output by the bitrate prediction model. This mechanism intercepts unreasonable current suggested bitrates, thereby determining the target bitrate that conforms to physical common sense. The bitrate is then adaptively adjusted according to the target bitrate, thus avoiding the risk of stuttering caused by directly using the current suggested bitrate output by the model for bitrate switching. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0014] Figure 1 A flowchart illustrating a bitrate adaptive method provided in an embodiment of this application; Figure 2 A structural block diagram of a bitrate adaptive device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0017] Figure 1 This is a diagram illustrating the application environment of the bitrate adaptive method in one embodiment. (Refer to...) Figure 1 This bitrate adaptation method is applied to a bitrate adaptation device, which can be deployed in a terminal and / or a server. If deployed in a terminal, the terminal implements its own bitrate decision algorithm to calculate the bitrate matching the current playback environment locally. If deployed in a server, the server implements the bitrate decision algorithm, calculating the bitrate suitable for the terminal's current playback environment before sending that bitrate to the terminal, thus saving local computing resources on the terminal. The terminal 110 can be a desktop terminal or a mobile terminal; a mobile terminal can be at least one of a mobile phone, tablet, or laptop. The server 120 can be a standalone server or a server cluster consisting of multiple servers.
[0018] In one embodiment, Figure 2 This is a flowchart illustrating a bitrate adaptive method in one embodiment, referencing... Figure 2 This paper provides a bitrate adaptive method. This embodiment primarily applies this method to a bitrate adaptive device. The bitrate adaptive method specifically includes the following steps: Step S210: Obtain the current suggested bitrate output by the bitrate prediction model.
[0019] Specifically, the bitrate prediction model predicts an appropriate bitrate based on the network parameters of the device running the video player. These network parameters indicate the device's network status and include network latency, packet loss rate, buffer length, and network bandwidth. A suitable video playback bitrate is predicted based on these network parameters and used as the current suggested bitrate. When network conditions are good, the current suggested bitrate is higher than the current application bitrate, used to request a switch to a higher bitrate, higher resolution segment to improve image quality. When the network is congested or bandwidth is low, the current suggested bitrate is lower than the current suggested bitrate, used to request a seamless switch to a lower bitrate segment, prioritizing smooth playback.
[0020] Step S220: Determine the target bitrate based on the bitrate comparison result between the current suggested bitrate and the current application bitrate, and the buffer comparison result between the current buffer length and the buffer threshold.
[0021] Specifically, the current application bitrate refers to the video playback bitrate currently being used by the video player, while the current application bitrate is the bitrate that was finally determined during the last bitrate decision. Based on the bitrate comparison between the current suggested bitrate and the current application bitrate, it can be determined whether the current bitrate switching request is an up-cut request or a down-cut request. An up-cut request is used to request switching to a segment with a higher bitrate and higher resolution, while a down-cut request is used to request seamless switching to a segment with a lower bitrate.
[0022] The current buffer length indicates the duration of the video to be played, which is pre-stored in the temporary buffer space. For example, if the current buffer length is 8 seconds, 8 seconds of video to be played can be pre-stored to buffer network latency / fluctuations. When the current network bandwidth fluctuates, the video content in the temporary buffer space can continue to play, avoiding immediate stuttering. Based on the current bitrate switching request, and combined with the buffer comparison result between the current buffer length and the buffer threshold, it is possible to accurately determine whether the current buffer length meets the current bitrate switching request, thereby verifying the rationality of the current suggested bitrate and determining a target bitrate that conforms to normal physical common sense. This avoids the current suggested bitrate output by the bitrate prediction model not conforming to normal physical common sense, which could lead to severe stuttering.
[0023] Step S230: Perform bitrate adaptation according to the target bitrate.
[0024] Specifically, the video playback bitrate is set according to the target bitrate. The target bitrate may be the current suggested bitrate or the current applied bitrate. That is, if the current suggested bitrate successfully passes the validity check, the current suggested bitrate will be used as the target bitrate to switch the bitrate; if the current suggested bitrate fails the validity check, the current applied bitrate will be used as the target bitrate, and the original bitrate will be maintained without switching the bitrate.
[0025] For the current suggested bitrate output by the bitrate prediction model, a gating mechanism based on a buffer threshold is introduced to intercept unreasonable current suggested bitrates, thereby determining the target bitrate that conforms to physical common sense. The bitrate is then adaptively adjusted according to the target bitrate, thus avoiding the risk of stuttering caused by directly using the current suggested bitrate output by the model for bitrate switching.
[0026] In one embodiment, before obtaining the current suggested bitrate output by the bitrate prediction model, the method further includes: Acquire multiple video sample data; Based on multiple video sample data, multi-level parallel training data corresponding to each video content is constructed. Each column of the multi-level parallel training data indicates a video sequence of the same video content at different resolutions. Each row of the multi-level parallel training data contains video segments with the same timestamp at different resolutions. Each time segment also carries the corresponding actual application bitrate. The initial network model is iteratively trained across videos using multi-level parallel training data corresponding to different video content to obtain the bitrate preset model.
[0027] Specifically, the video sample data refers to video streams with different content and bitrates. A multi-level parallel training dataset is constructed for video streams with the same content but different bitrates. A horizontal expansion method is used to display video sequences corresponding to different resolutions in different columns, such as 4K, 1080P, and 720P. That is, video data of different resolutions, such as 4K, 1080P, and 720P, are placed side-by-side in the same row. The video sequence includes multiple video segments with consecutive timestamps, and a vertical expansion method is used to display these segments in each row, ensuring vertical temporal alignment. Video segments of different resolutions correspond to the same timestamp within the same row. This structure guarantees strict synchronization of different bitrate levels on the timeline, eliminating the risk of time deviation caused by reading multiple files.
[0028] Each video slice also carries fields for the slice size in bytes and the actual application bitrate. During model training, if you want to look up the actual data of any selectable level (such as the size of the video segment in that level), you can find it instantly (O(1) complexity) without having to search across files / tables, which is extremely efficient. In traditional multi-file storage, there may be differences in reading latency between time slices of different levels. For example, reading the third video slice (Chunk) of 4K is half a second slower than reading the third video slice of 720P. Here, the structure of one row corresponding to one time slice directly eliminates this risk.
[0029] The training environment directly reads these values to simulate download time, rather than using theoretical averages. This forces the model to learn to handle variable bitrate (VBR) fluctuations in video coding, such as data surges in complex scenarios, thus adapting to the characteristics of real-world video streams in industrial settings. The initial network model is trained using multi-level parallel training data corresponding to different video content. During training, when the multi-level parallel training data for one video content finishes learning, the model parameters are not reset. Instead, the next multi-level parallel training data for the next video content is loaded, representing a different video data source. This allows for cross-video iterative learning, resulting in a bitrate prediction model capable of recognizing the appropriate bitrate for videos with different characteristics in different network environments. This mechanism prevents the neural network from cheating by memorizing the bitrate of a specific video; it must learn the true bandwidth estimation and bitrate matching logic to adapt to various types of video scenarios in industrial settings.
[0030] During the learning process, the bitrate prediction model also maintains a multi-dimensional state vector, which indicates multiple state parameters, including the bitrate selected in the previous time step, the current buffer length, the estimated network throughput, the download time of the previous segment, the look-ahead size prefetch of the subsequent segment, the remaining video duration, and a stuttering history flag. The stuttering history is represented by a boolean or floating-point flag used to record whether a stutter has occurred recently (e.g., within the last N seconds), serving as short-term memory input. This feature helps the model automatically suppress aggressive strategies during the recovery period after a stutter occurs, preventing continuous stuttering.
[0031] In one embodiment, determining the target bitrate based on the bitrate comparison result between the current suggested bitrate and the current application bitrate, and the buffer comparison result between the current buffer length and the buffer threshold, includes: When the current suggested bitrate is greater than the current application bitrate, a corresponding dynamic security threshold is determined based on the current suggested bitrate, and the dynamic security threshold is used as the buffer threshold; or, When the current suggested bitrate is less than the current application bitrate, the security high-bit threshold is used as the buffer threshold. The target bitrate is determined based on the buffer comparison result between the current buffer length and the buffer threshold.
[0032] Specifically, when the current suggested bitrate is greater than the current application bitrate, it indicates that the current bitrate switching request is an upward cutoff request. In this case, a dynamic safety threshold needs to be calculated based on the current suggested bitrate as the buffer threshold. When the current suggested bitrate is less than the current application bitrate, the current bitrate switching request is a downward cutoff request. In this case, the high-order safety threshold is used as the buffer threshold. Based on the buffer comparison result between the current buffer length and the buffer threshold, it is determined whether to adopt the current suggested bitrate output by the bitrate prediction model as the target bitrate.
[0033] When a dynamic safety threshold is calculated based on the current recommended bitrate for upslicing requests, it can accurately adapt to different upslicing bitrate situations. If the current network conditions are good, calculating an appropriate dynamic safety threshold allows video playback to switch to a higher bitrate in a timely manner, improving video clarity and image quality, providing users with a better visual experience, and reducing problems such as blurry images and loss of detail caused by excessively low bitrates. At the same time, the calculation of the dynamic safety threshold takes into account the current recommended bitrate, which can, to some extent, avoid excessive consumption of system resources by frequent bitrate upslicing, ensuring the stability of system operation.
[0034] Using a high-level safety threshold as the buffer threshold during the cut-off request can effectively prevent stuttering caused by a sudden and significant drop in bitrate. When network conditions deteriorate and the bitrate is reduced, it is recommended to use a high-level safety threshold for buffer comparison to ensure that the buffer has enough data to smoothly transition to low bitrate playback, maintain the smoothness of video playback, and avoid problems such as video interruption and slow loading.
[0035] The decision to adopt the current suggested bitrate as the target bitrate based on buffer comparison results further enhances the rationality and stability of bitrate switching. This dynamic bitrate switching decision mechanism can adjust in real time according to network conditions and buffer status, ensuring that video playback always finds the optimal balance between clarity and smoothness, providing users with high-quality and stable video services. It is especially suitable for complex and variable network environments, such as mobile network scenarios where signal strength and bandwidth fluctuate significantly, and can significantly improve user satisfaction with video playback.
[0036] In one embodiment, determining the corresponding dynamic security threshold based on the current suggested bitrate includes: The first value is determined by multiplying the current suggested bitrate by the smoothed bitrate threshold. The second value is determined based on the difference between the number of bitrate levels and the preset coefficient; The dynamic security threshold corresponding to the current suggested bitrate is determined based on the sum of the ratio of the first value to the second value and the security buffer threshold.
[0037] Specifically, the current recommended bitrate is denoted as TargetBitrate, the smoothing bitrate threshold is denoted as Cushion, and the number of bitrate levels is denoted as TotalLevels. The number of bitrate levels is the total number of levels after linearly normalizing the bitrate adjustment action, such as 5 levels, 10 levels, etc. Subsequent calculations are based on this total number of levels. The preset coefficient can be any positive integer; in this embodiment, the preset coefficient is set to 1. The safety buffer threshold is denoted as Reservoir, which indicates the minimum safe playback duration.
[0038] The formula for calculating the dynamic security threshold is: .
[0039] The more TotalLevels a device has, the lower the Required level, giving it greater flexibility in bitrate adjustment. In video streaming scenarios, this allows for more precise bitrate adjustments based on network conditions and data buffering. For example, in environments with fluctuating network bandwidth, a wider range of bitrate levels allows the system to respond more quickly to bandwidth changes, rapidly increasing the bitrate when bandwidth is sufficient to provide higher-definition video, and quickly decreasing the bitrate when bandwidth decreases to ensure smooth playback and prevent stuttering. This flexible adjustment capability effectively improves the user's viewing experience, reduces video loading time, and enhances video playback stability.
[0040] For the smoothing bitrate threshold (Cushion), a larger Cushion indicates a more conservative system. This is significant in applications with extremely high stability requirements. For example, in real-time video conferencing, a larger Cushion allows the system to be more cautious when adjusting the bitrate to ensure smooth conferencing and stable video quality. The system will not easily make drastic adjustments to the bitrate, but will instead make fine adjustments within a relatively stable range. This avoids problems such as screen tearing and stuttering caused by frequent and large fluctuations in the bitrate, ensuring the smooth running of the meeting and providing users with high-quality and stable video communication services.
[0041] Setting the safety buffer threshold (Reservoir) is also crucial. It indicates the minimum safe playback duration, providing a buffer guarantee for video playback. When there are brief network fluctuations or data transmission delays, Reservoir ensures that the video player has enough data to play, preventing video interruptions. In live streaming scenarios, Reservoir effectively handles sudden network issues, ensuring viewers don't miss exciting content due to momentary network problems, thus improving the reliability of live streaming and user satisfaction.
[0042] By using a dynamic security threshold calculation formula that comprehensively considers factors such as TargetBitrate, Cushion, TotalLevels, and Reservoir, the system can flexibly and reasonably adjust the bitrate according to different application scenarios and network environments. This ensures smooth video playback, high-definition display, and stable transmission, providing users with a superior video experience. Simultaneously, this dynamic adjustment mechanism can effectively reduce bandwidth consumption and improve the utilization efficiency of network resources.
[0043] In one embodiment, determining the target bitrate based on the buffer comparison result between the current buffer length and the buffer threshold includes: When using the dynamic security threshold as the buffer threshold, determine the buffer comparison result between the current buffer length and the buffer threshold; When the current buffer length is less than the buffer threshold, the current application bitrate or the downgraded bitrate is used as the target bitrate, and an up-cut violation signal is output, wherein the downgraded bitrate is the difference between the current application bitrate and the preset bitrate change amount; When the current buffer length is greater than or equal to the buffer threshold, the current suggested bitrate is used as the target bitrate.
[0044] Specifically, based on the up-cut request, the dynamic security threshold is used as the buffer threshold. The buffer comparison result between the dynamic security threshold and the current buffer length is then determined. If the comparison result indicates that the current buffer length is less than the buffer threshold, it means that the current buffer length cannot meet the length requirement corresponding to the up-cut request, and the bitrate upgrade cannot be successfully performed according to the current suggested bitrate. In this case, an up-cut violation signal is output, and the current application bitrate is used as the target bitrate to maintain the original bitrate, or bitrate downgrading is performed, i.e., reducing the preset bitrate change based on the current application bitrate. When the current buffer length is less than the buffer threshold, using the current application bitrate as the target bitrate to maintain the original bitrate or performing bitrate downgrading effectively avoids problems such as stuttering and slow loading that may occur due to insufficient buffer length causing bitrate upgrade failure, ensuring the smoothness and stability of video playback. By reducing the preset bitrate change, the system can adaptively adjust under resource constraints, reducing playback interruptions caused by untimely data transmission and improving the user's viewing experience.
[0045] If the current buffer length is greater than or equal to the dynamic safety threshold, it means that the current buffer length meets the length requirement corresponding to the up-cutting request. Therefore, the current suggested bitrate is used as the target bitrate to achieve bitrate up-progression, which can make full use of the ample space in the buffer and improve the clarity and quality of the video. A higher bitrate means more data and better picture performance, making the video details richer and the colors more vibrant, bringing users a better visual experience. At the same time, this mechanism of dynamically adjusting the bitrate based on the buffer state achieves reasonable allocation of resources, improves the overall performance and efficiency of the system, and maximizes the satisfaction of users' video quality needs without wasting excessive resources.
[0046] In one embodiment, determining the target bitrate based on the buffer comparison result between the current buffer length and the buffer threshold includes: When using the security high-order threshold as the buffer threshold, determine the buffer comparison result between the current buffer length and the buffer threshold; When the current buffer length is greater than the buffer threshold, the current suggested bitrate or the current application bitrate is used as the target bitrate, and a cut-off violation signal is output. When the current buffer length is less than or equal to the buffer threshold, the current suggested bitrate is used as the target bitrate.
[0047] Specifically, based on the cut-down request, the safety high-order threshold is used as the buffer threshold. Then, it's determined whether the current buffer length is greater than the safety high-order threshold. If the current buffer length is greater than the safety high-order threshold, it means there is a surplus relative to the safety high-order threshold, and bitrate downgrading is unnecessary. However, if the current suggested bitrate is used to request downgrading, the cut-down request corresponding to the current suggested bitrate is determined to be unnecessary downgrading, belonging to the panic-level downgrading. A cut-down violation signal is output, and downgrading is performed according to the current suggested bitrate as the target bitrate. Alternatively, the current application bitrate is maintained as the target bitrate to reject downgrading. When a cut-down violation signal is output and downgrading is performed according to the current suggested bitrate or the current application bitrate is maintained, a higher bitrate can be maintained as much as possible when there is a surplus in the buffer, thereby improving video clarity and smoothness and providing a better viewing experience for users. At the same time, maintaining the current application bitrate and rejecting downgrading can also avoid the extra consumption of system resources caused by frequent downgrading, improving system operating efficiency.
[0048] If the current buffer length is less than or equal to the safety high-order threshold, it indicates that the downslicing request corresponding to the current suggested bitrate is necessary. In this case, the current suggested bitrate is used as the target bitrate for normal downslicing. This ensures timely bitrate adjustment when the buffer length is insufficient, avoiding stuttering, buffering issues, and guaranteeing the continuity and stability of video playback. This processing mechanism, based on comparing the buffer length with the safety high-order threshold, can flexibly adjust the bitrate according to the actual situation, achieving a good balance between ensuring video quality and playback stability, and optimizing the technical performance of the entire video transmission and playback process.
[0049] In one embodiment, after determining the target bitrate based on the buffer comparison result between the current buffer length and the buffer threshold, the method further includes: When the above-cut violation signal is detected, the above-cut violation penalty value is determined based on the difference between the dynamic security threshold and the remaining available length of the current buffer length; When the cut-down violation signal is detected, the cut-down violation penalty value is determined based on the difference between the remaining available length of the current buffer and the safety high threshold. Substitute the target violation penalty value, the current application bitrate, the previous application bitrate, and the normalized bitrate, stutter duration, and stutter coefficient corresponding to the current application bitrate into the composite reward function to obtain the composite reward function value, wherein the target violation penalty value is the upper cut violation penalty value or the lower cut violation penalty value. The model parameters of the bitrate prediction model are adjusted based on the value of the composite reward function.
[0050] Specifically, upon detecting an upper-level violation signal, an upper-level violation penalty value is calculated based on the difference between the dynamic security threshold and the remaining available length of the current buffer. The formula for calculating the upper-level violation penalty value is as follows: Penalty_up=k_up×(Required Buffer) / Required.
[0051] Where k_up is the overcut penalty coefficient, used to indicate the severity of the penalty; the larger the value, the stronger the penalty. Required is the dynamic safety threshold, and Buffer is the remaining available length of the current buffer. The overcut violation penalty value is proportional to the buffer gap between the current buffer length and the dynamic safety threshold.
[0052] When a cut-down violation signal is detected, a cut-down violation penalty value is calculated based on the difference between the remaining available length of the current buffer and the safety high-order threshold. The formula for calculating the cut-down violation penalty value is as follows: Penalty_down = k_down × (Buffer) Threshold) / Threshold.
[0053] Where k_down is the downcut penalty coefficient, used to indicate the severity of the penalty; the larger the value, the stronger the penalty. Threshold is the safety high-order threshold, and Buffer is the remaining available length of the current buffer. The downcut violation penalty value is proportional to the buffer surplus between the current buffer length and the dynamic safety threshold.
[0054] Substituting the target violation penalty value, the current application bitrate, the previous application bitrate, and the normalized bitrate, stutter duration, and stutter coefficient corresponding to the current application bitrate into the composite reward function, the calculation formula for the composite reward function is as follows: .
[0055] in, The normalized bitrate corresponding to the current application bitrate is the image quality gain. For the duration of lag, The stuttering coefficient is used to dynamically amplify the stuttering coefficient when a stuttering history flag is detected, indicating that a stutter has occurred (i.e., the number of stutters is not zero) and a stutter occurs again. For example, the coefficient is increased by 3 times to severely punish stuttering situations. This allows the bitrate prediction model to reduce the bitrate more quickly when the network deteriorates, thus avoiding continuous stuttering. The switching coefficient is... For the current application bitrate, For the previous application bitrate, It is used to indicate the degree of difference in bitrate between two consecutive applications. The larger the difference, the worse the bitrate switching smoothness, and the larger the corresponding switching coefficient is, which is used to implement the switching smoothness penalty.
[0056] The composite reward function value calculated based on the above composite reward function is used to update the gradient of the bitrate prediction model, so that the bitrate prediction model finds the best balance between maximizing image quality reward and minimizing BBA violation penalty, thereby learning a high-definition and robust adaptive bitrate strategy.
[0057] Figure 1 This is a flowchart illustrating a bitrate adaptive method in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0058] In one embodiment, such as Figure 2 As shown, a bitrate adaptive device is provided, comprising: The acquisition module 310 is used to acquire the current suggested bitrate output by the bitrate prediction model; The processing module 320 is used to determine the target bitrate based on the bitrate comparison result between the current suggested bitrate and the current application bitrate, and the buffer comparison result between the current buffer length and the buffer threshold. The execution module 330 is used to perform bitrate adaptation according to the target bitrate.
[0059] In one embodiment, the processing module 320 is further configured to: Acquire multiple video sample data; Based on multiple video sample data, multi-level parallel training data corresponding to each video content is constructed. Each column of the multi-level parallel training data indicates a video sequence of the same video content at different resolutions. Each row of the multi-level parallel training data contains video segments with the same timestamp at different resolutions. Each time segment also carries the corresponding actual application bitrate. The initial network model is iteratively trained across videos using multi-level parallel training data corresponding to different video content to obtain the bitrate preset model.
[0060] In one embodiment, the processing module 320 is further configured to: When the current suggested bitrate is greater than the current application bitrate, a corresponding dynamic security threshold is determined based on the current suggested bitrate, and the dynamic security threshold is used as the buffer threshold; or, When the current suggested bitrate is less than the current application bitrate, the security high-bit threshold is used as the buffer threshold. The target bitrate is determined based on the buffer comparison result between the current buffer length and the buffer threshold.
[0061] In one embodiment, the processing module 320 is further configured to: The first value is determined by multiplying the current suggested bitrate by the smoothed bitrate threshold. The second value is determined based on the difference between the number of bitrate levels and the preset coefficient; The dynamic security threshold corresponding to the current suggested bitrate is determined based on the sum of the ratio of the first value to the second value and the security buffer threshold.
[0062] In one embodiment, the processing module 320 is further configured to: When using the dynamic security threshold as the buffer threshold, determine the buffer comparison result between the current buffer length and the buffer threshold; When the current buffer length is less than the buffer threshold, the current application bitrate or the downgraded bitrate is used as the target bitrate, and an up-cut violation signal is output, wherein the downgraded bitrate is the difference between the current application bitrate and the preset bitrate change amount; When the current buffer length is greater than or equal to the buffer threshold, the current suggested bitrate is used as the target bitrate.
[0063] In one embodiment, the processing module 320 is further configured to: When using the security high-order threshold as the buffer threshold, determine the buffer comparison result between the current buffer length and the buffer threshold; When the current buffer length is greater than the buffer threshold, the current suggested bitrate or the current application bitrate is used as the target bitrate, and a cut-off violation signal is output. When the current buffer length is less than or equal to the buffer threshold, the current suggested bitrate is used as the target bitrate.
[0064] In one embodiment, the processing module 320 is further configured to: When the above-cut violation signal is detected, the above-cut violation penalty value is determined based on the difference between the dynamic security threshold and the remaining available length of the current buffer length; When the cut-down violation signal is detected, the cut-down violation penalty value is determined based on the difference between the remaining available length of the current buffer and the safety high threshold. Substitute the target violation penalty value, the current application bitrate, the previous application bitrate, and the normalized bitrate, stutter duration, and stutter coefficient corresponding to the current application bitrate into the composite reward function to obtain the composite reward function value, wherein the target violation penalty value is the upper cut violation penalty value or the lower cut violation penalty value. The model parameters of the bitrate prediction model are adjusted based on the value of the composite reward function.
[0065] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of a device, can operate in environments such as... Figure 1The hardware environment shown can be implemented either through software or through hardware.
[0066] like Figure 3 As shown, this application provides a computer device including a processor 711, a communication interface 712, a memory 713, and a communication bus 714. The processor 711, the communication interface 712, and the memory 713 communicate with each other through the communication bus 714. The memory 713 is used to store computer programs. When the processor 711 executes the program stored in the memory 713, it implements the bit rate adaptive method provided in any of the aforementioned method embodiments.
[0067] The memory and processor in the aforementioned electronic devices communicate with each other via a communication bus and a communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0068] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0069] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0070] Those skilled in the art will understand that Figure 3The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0071] According to another aspect of the embodiments of this application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of any of the above embodiments.
[0072] In one embodiment, the bit rate adaptive device provided in this application can be implemented as a computer program, which can be implemented as follows: Figure 3 It runs on the computer device shown. The computer device's memory can store the various program modules that make up the bitrate adaptive device, for example, Figure 2 The acquisition module 310, processing module 320, and execution module 330 are shown. The computer program composed of these various program modules causes the processor to execute the bit rate adaptive methods of the various embodiments of this application described in this specification.
[0073] Figure 3 The computer device shown can be used as follows Figure 2 The acquisition module 310 in the illustrated rate adaptation device acquires the current suggested bitrate output by the bitrate prediction model. The computer device, through the processing module 320, determines the target bitrate based on a bitrate comparison between the current suggested bitrate and the current applied bitrate, and a buffer comparison between the current buffer length and the buffer threshold. The computer device, through the execution module 330, performs rate adaptation according to the target bitrate.
[0074] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the bitrate adaptive method as provided in any of the foregoing method embodiments.
[0075] Optionally, in embodiments of this application, the computer-readable medium is configured to store program code for the processor to perform the following steps: Get the current suggested bitrate output by the bitrate prediction model; The target bitrate is determined based on the bitrate comparison results between the current suggested bitrate and the current application bitrate, and the buffer comparison results between the current buffer length and the buffer threshold. Bitrate adaptation is performed according to the target bitrate.
[0076] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.
[0077] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0078] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0079] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0080] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0081] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0082] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0083] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0084] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a USB flash drive, external hard drive, ROM, RAM, magnetic disk, or optical disk, or other media capable of storing program code, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0085] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also mean including the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that alternatives or substitutions may be used.
[0086] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A bitrate adaptive method, characterized in that, The method includes: Get the current suggested bitrate output by the bitrate prediction model; The target bitrate is determined based on the bitrate comparison results between the current suggested bitrate and the current application bitrate, and the buffer comparison results between the current buffer length and the buffer threshold. Bitrate adaptation is performed according to the target bitrate.
2. The method according to claim 1, characterized in that, Before obtaining the current suggested bitrate output by the bitrate prediction model, the method further includes: Acquire multiple video sample data; Based on multiple video sample data, multi-level parallel training data corresponding to each video content is constructed. Each column of the multi-level parallel training data indicates a video sequence of the same video content at different resolutions. Each row of the multi-level parallel training data contains video segments with the same timestamp at different resolutions. Each time segment also carries the corresponding actual application bitrate. The initial network model is iteratively trained across videos using multi-level parallel training data corresponding to different video content to obtain the bitrate preset model.
3. The method according to claim 1, characterized in that, The step of determining the target bitrate based on the bitrate comparison result between the current suggested bitrate and the current application bitrate, and the buffer comparison result between the current buffer length and the buffer threshold, includes: When the current suggested bitrate is greater than the current application bitrate, a corresponding dynamic security threshold is determined based on the current suggested bitrate, and the dynamic security threshold is used as the buffer threshold; or, When the current suggested bitrate is less than the current application bitrate, the security high-bit threshold is used as the buffer threshold. The target bitrate is determined based on the buffer comparison result between the current buffer length and the buffer threshold.
4. The method according to claim 3, characterized in that, Determine the corresponding dynamic security threshold based on the current suggested bitrate, including: The first value is determined by multiplying the current suggested bitrate by the smoothed bitrate threshold. The second value is determined based on the difference between the number of bitrate levels and the preset coefficient; The dynamic security threshold corresponding to the current suggested bitrate is determined based on the sum of the ratio of the first value to the second value and the security buffer threshold.
5. The method according to claim 3, characterized in that, The step of determining the target bitrate based on the buffer comparison result between the current buffer length and the buffer threshold includes: When using the dynamic security threshold as the buffer threshold, determine the buffer comparison result between the current buffer length and the buffer threshold; When the current buffer length is less than the buffer threshold, the current application bitrate or the downgraded bitrate is used as the target bitrate, and an up-cut violation signal is output, wherein the downgraded bitrate is the difference between the current application bitrate and the preset bitrate change amount; When the current buffer length is greater than or equal to the buffer threshold, the current suggested bitrate is used as the target bitrate.
6. The method according to claim 5, characterized in that, The step of determining the target bitrate based on the buffer comparison result between the current buffer length and the buffer threshold includes: When using the security high-order threshold as the buffer threshold, determine the buffer comparison result between the current buffer length and the buffer threshold; When the current buffer length is greater than the buffer threshold, the current suggested bitrate or the current application bitrate is used as the target bitrate, and a cut-off violation signal is output. When the current buffer length is less than or equal to the buffer threshold, the current suggested bitrate is used as the target bitrate.
7. The method according to claim 6, characterized in that, After determining the target bitrate based on the buffer comparison result between the current buffer length and the buffer threshold, the method further includes: When the above-cut violation signal is detected, the above-cut violation penalty value is determined based on the difference between the dynamic security threshold and the remaining available length of the current buffer length; When the cut-down violation signal is detected, the cut-down violation penalty value is determined based on the difference between the remaining available length of the current buffer and the safety high threshold. Substitute the target violation penalty value, the current application bitrate, the previous application bitrate, and the normalized bitrate, stutter duration, and stutter coefficient corresponding to the current application bitrate into the composite reward function to obtain the composite reward function value, wherein the target violation penalty value is the upper cut violation penalty value or the lower cut violation penalty value. The model parameters of the bitrate prediction model are adjusted based on the value of the composite reward function.
8. A bit rate adaptive device, characterized in that, The device includes: The acquisition module is used to obtain the current suggested bitrate output by the bitrate prediction model; The processing module is used to determine the target bitrate based on the bitrate comparison result between the current suggested bitrate and the current application bitrate, and the buffer comparison result between the current buffer length and the buffer threshold; An execution module is used to perform bitrate adaptation according to the target bitrate.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.