A code rate control method, a code rate control device and an electronic device

CN114422790BActive Publication Date: 2026-08-21SHENZHEN MEIKEXING COMM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210224459.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-07
Publication Date
2026-08-21
Estimated Expiration
2042-03-07

AI Technical Summary

Technical Problem

目前,虽然视频流的分辨率在技术升级的影响下有所提升,但其制式仍受限于LTE CAT1的传输速率的上限

Benefits of technology

[0017]本申请与现有技术相比存在的有益效果是:在视频流的传输过程中,先确定当前控制周期的第一传输速率及第二传输速率,其中,第一传输速率基于网络的性能参数及传输参数计算得到,第二传输速率通过统计得到,然后电子设备会在第一传输速率及第二传输速率中,确定出适合的目标传输速率,并将视频流的传输码率与该目标传输速率进行比对,最后根据比对结果对传输码率进行控制。本申请方案考虑到了复杂网络环境下的不同情况,以两种不同的方式确定传输速率所可能的上限,一种是基于网络的性能参数及传输参数计算得到,另一种是通过统计得到。在这两种所可能的上限中,电子设备会分析确定出目标传输速率,使得该目标传输速率能够更接近真实及准确的传输速率的实际上限。该目标传输速率会作为对传输码率的控制基础,实现对传输码率的动态控制,由此避免视频卡顿的情况发生。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114422790B_ABST
    Figure CN114422790B_ABST
Patent Text Reader

Abstract

The application discloses a code rate control method, a code rate control device, electronic equipment and a computer readable storage medium. The method comprises the following steps: determining a first transmission rate and a second transmission rate of a current control period in a video stream transmission process, wherein the first transmission rate is calculated based on performance parameters and transmission parameters of a network, and the second transmission rate is obtained by statistics; determining a target transmission rate from the first transmission rate and the second transmission rate; comparing a transmission code rate of the video stream with the target transmission rate; and controlling the transmission code rate according to a comparison result. According to the application, the code rate can be dynamically adjusted according to the actual network transmission condition in the video stream transmission process, so that the video freezing condition can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of video processing technology, and in particular relates to a bitrate control method, bitrate control device, electronic device and computer-readable storage medium. Background Technology

[0002] Due to cost considerations, some surveillance cameras use Long Term Evolution user equipment-Category 1 (LTE CAT1) technology to transmit video streams. Currently, although video stream resolution has improved due to technological upgrades, its standard is still limited by the upper limit of LTE CAT1 transmission rates. Furthermore, for surveillance cameras installed in remote locations, network conditions often fluctuate. All of these factors can lead to transmission rates being lower than the video bitrate, resulting in video stuttering. Summary of the Invention

[0003] This application provides a bitrate control method, bitrate control device, electronic device, and computer-readable storage medium, which can dynamically adjust the bitrate according to the actual network transmission conditions during video stream transmission to avoid video stuttering.

[0004] Firstly, this application provides a bitrate control method, including:

[0005] During the transmission of the video stream, a first transmission rate and a second transmission rate are determined for the current control cycle. The first transmission rate is calculated based on the network performance parameters and transmission parameters, and the second transmission rate is obtained through statistics.

[0006] Among the first transmission rate and the second transmission rate mentioned above, the target transmission rate is determined;

[0007] Compare the transmission bitrate of the above video stream with the target transmission rate mentioned above;

[0008] The transmission rate is controlled based on the comparison results.

[0009] Secondly, this application provides a bitrate control device, comprising:

[0010] The first determining module is used to determine the first transmission rate and the second transmission rate of the current control cycle during the transmission of the video stream. The first transmission rate is calculated based on the network performance parameters and transmission parameters, and the second transmission rate is obtained through statistics.

[0011] The second determining module is used to determine the target transmission rate among the first transmission rate and the second transmission rate.

[0012] The comparison module is used to compare the transmission bitrate of the above video stream with the target transmission rate.

[0013] The control module is used to control the transmission rate based on the comparison results.

[0014] Thirdly, this application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in the first aspect.

[0015] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.

[0016] Fifthly, this application provides a computer program product comprising a computer program that, when executed by one or more processors, implements the steps of the method described in the first aspect.

[0017] The advantages of this application compared to existing technologies are as follows: During video stream transmission, a first transmission rate and a second transmission rate for the current control cycle are first determined. The first transmission rate is calculated based on network performance parameters and transmission parameters, while the second transmission rate is obtained statistically. Then, the electronic device determines a suitable target transmission rate from the first and second transmission rates and compares the video stream's transmission bitrate with this target transmission rate. Finally, the transmission bitrate is controlled based on the comparison result. This application's solution considers different situations in complex network environments, determining the possible upper limit of the transmission rate in two different ways: one is calculated based on network performance parameters and transmission parameters, and the other is obtained statistically. Among these two possible upper limits, the electronic device analyzes and determines the target transmission rate, making it closer to the actual and accurate upper limit of the transmission rate. This target transmission rate serves as the basis for controlling the transmission bitrate, achieving dynamic control of the transmission bitrate and thus avoiding video stuttering.

[0018] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram illustrating the implementation process of the bitrate control method provided in the embodiments of this application;

[0021] Figure 2 This is a schematic diagram of the bit rate control device provided in the embodiments of this application;

[0022] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0023] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0024] To illustrate the technical solution proposed in this application, specific embodiments are described below.

[0025] The bitrate control method proposed in the embodiments of this application is described below. Please refer to... Figure 1 The implementation process of this bitrate control method is detailed below:

[0026] Step 101: During the transmission of the video stream, determine the first transmission rate and the second transmission rate of the current control cycle.

[0027] During the transmission of video streams, electronic devices can divide the data into multiple control cycles based on preset control durations and interval durations. Each control cycle can then be further divided into multiple transmission cycles based on a preset transmission duration. For example, the transmission duration could be 5 seconds or 10 seconds, the control duration could be 60 seconds or 90 seconds, and the interval duration could be 0 seconds, 5 seconds, or 10 seconds. No specific values ​​for the transmission duration, control duration, and interval duration are specified here.

[0028] Taking a transmission duration of 5 seconds, a control duration of 60 seconds, and an interval duration of 5 seconds as an example:

[0029] Assuming the electronic device starts transmitting the video stream at time T0, there are 12 transmission cycles during the first control period from T0 to T0+60s: T0 to T0+5s, T0+5s to T0+10s, ..., T0+55s to T0+60s. Similarly, there are also 12 transmission cycles during the second control period from T0+65s to T0+125s: T0+65s to T0+70s, T0+70s to T0+75s, ..., T0+120s to T0+125s, and so on. Further details are omitted here.

[0030] The first transmission rate and the second transmission rate are obtained through different methods. Specifically, the first transmission rate is calculated based on network performance parameters and transmission parameters, while the second transmission rate is obtained through statistics.

[0031] The process of obtaining this first transmission rate is explained below:

[0032] The electronic device can acquire the uplink block error rate of the network in real time within the current control cycle, and simultaneously calculate the theoretical maximum uplink transmission rate of the network. Specifically, the uplink block error rate acquired by the electronic device in real time within the current control cycle refers to the average uplink block error rate of each transmission cycle within the current control cycle. That is, if the number of transmission cycles in the current control cycle is n, then for each transmission cycle within the current control cycle, the electronic device can acquire an uplink block error rate (representing the average uplink block error rate within that transmission cycle), and finally obtain n uplink block error rates at the end of the current control cycle. Similarly, each time the uplink block error rate corresponding to a certain transmission cycle is acquired, the electronic device can also simultaneously calculate the theoretical maximum uplink transmission rate corresponding to that transmission cycle. After the current control cycle ends, the first transmission rate can be calculated based on all the uplink block error rates (i.e., n uplink block error rates) and all the theoretical maximum uplink transmission rates (i.e., n theoretical maximum uplink transmission rates) acquired within the current control cycle, and a preset transmission rate calculation formula.

[0033] It is understandable that the uplink block error rate is a network performance parameter, while the theoretical maximum uplink transmission rate is calculated using the network's transmission parameters. The first transmission rate can only be calculated by combining the uplink block error rate and the theoretical maximum uplink transmission rate. In some examples, the formula for calculating this first transmission rate is as follows:

[0034]

[0035] Where A is the first transmission rate; n is the number of uplink block error rates acquired in the current control cycle, which is equivalent to the number of transmission cycles in the current control cycle (and also the number of theoretical maximum uplink transmission rates acquired in the current control cycle); M i BER is the uplink block error rate obtained within the current control cycle. i The theoretical maximum uplink transmission rate obtained within the current control cycle is α; α is a constant greater than 0 and less than 1.

[0036] The derivation of this formula is explained below: Since BER represents the uplink block error rate, 1-BER can represent the proportion of data that is correctly transmitted, and M(1-BER) can represent the theoretical maximum transmission rate of correctly transmitted uplink data. Furthermore, since the number of uplink block error rates and the number of theoretical maximum transmission rates obtained within the current control cycle are both n, averaging them yields the result. Furthermore, since the transmitted data contains some redundant information such as checksums, based on experience, the actual amount of useful data that can be transmitted is about 60% to 70%. Therefore, the constant α is set. As an example, the value of α is the lower limit of the empirical value of 60%. Thus, the calculation formula for the first transmission rate as described above is obtained.

[0037] The theoretical maximum uplink transmission rate M of the network can be calculated as follows: First, determine the transmission standard of the video stream; then, select network parameters based on the transmission standard; finally, calculate the theoretical maximum uplink transmission rate in real time based on the selected network parameter values. It can be understood that both the video stream transmission standard and network parameters are transmission parameters. In some examples, the transmission standards of interest in this application are mainly the following two: Frequency-Division Duplex Long Term Evolution (FDD-LTE) and Time-Division Duplex Long Term Evolution (TDD-LTE).

[0038] In one application scenario, if the transmission standard is FDD-LTE, the network parameters selected based on this standard include the following: communication frequency band, transmission bandwidth, uplink modulation scheme, number of uplink resource blocks (RBs), and uplink transport block size index (TBSI) for each subframe. In another application scenario, if the transmission standard is TDD-LTE, the network parameters selected based on this standard include the following: communication frequency band, transmission bandwidth, uplink modulation scheme, number of uplink RBs, uplink TBSI for each subframe, and the ratio of upper and lower subframes. That is, the TDD-LTE case requires consideration of the upper and lower subframe ratio as an additional transmission parameter (network parameter) compared to the FDD-LTE case. Using the real-time values ​​of these network parameters, the theoretical maximum uplink transmission rate M in the current network environment can be calculated according to the 3rd Generation Partnership Project (3GPP) protocols TS 36.211 and TS 36.213. Due to space limitations, the relevant content of this 3GPP protocol will not be elaborated here.

[0039] The process of obtaining the second transmission rate is explained below: The amount of data transmitted via uplink during the current control cycle is counted; based on the amount of data and the duration of the current control cycle (i.e., the control duration), the second transmission rate can be obtained through a simple division operation.

[0040] Step 102: Determine the target transmission rate from the first transmission rate and the second transmission rate.

[0041] Both the first and second transmission rates represent, to some extent, the upper limit of the transmission rate that can be provided in the current control cycle. The electronic device can select the most appropriate transmission rate as the target transmission rate by analyzing the first and second transmission rates. This target transmission rate can be understood as the actual highest transmission rate under the current network environment.

[0042] In some examples, the analysis process is as follows: A first transmission rate is compared with a second transmission rate, and the difference between the first and second transmission rates is compared with a preset difference threshold. For ease of description, let the second transmission rate be denoted as B, the first transmission rate as A, the preset difference threshold as X, and the target transmission rate as C. The comparison result can be one of the following two cases:

[0043] In the first case, B < A, and AB > X. In this case, B is assigned to C, that is, C = B (the second transmission rate is determined as the target transmission rate).

[0044] In the second case, B ≥ A, and / or AB ≤ X (that is, all other cases besides the first case are the second case). In this case, A is assigned to C, that is, C = A (the first transmission rate is determined as the target transmission rate).

[0045] It is understandable that the transmission bitrate of electronic devices may fluctuate during video streaming. Therefore, when analyzing the first and second transmission rates, a margin needs to be considered, i.e., a preset difference threshold X. The value of X can be determined based on the bitrate fluctuation of the electronic device. As an example, X could be 10% of A; of course, other values ​​are also possible and are not limited here.

[0046] Step 103: Compare the transmission bitrate of the video stream with the target transmission rate.

[0047] Since video stuttering typically occurs when the transmission bitrate exceeds the transmission rate, electronic devices can compare the current transmission bitrate of the video stream with the target transmission rate to determine if there is a high probability of video stuttering. In other words, the comparison result can be considered to reflect, to some extent, the probability of video stuttering occurring.

[0048] Step 104: Control the transmission rate based on the comparison results.

[0049] Let the current transmission bitrate of the video stream be D. The comparison results can be roughly divided into the following two cases:

[0050] In the first scenario, D ≤ C. That is, the transmission rate does not exceed the actual maximum transmission rate (i.e., the target transmission rate) under the current network environment. In this case, the electronic device can consider maintaining the transmission rate unchanged. Alternatively, the electronic device can consider appropriately increasing the transmission rate, but it should be noted that the increased transmission rate still needs to remain less than or equal to the target transmission rate. In other words, D can be appropriately increased while maintaining D ≤ C.

[0051] In the second scenario, D > C. That is, the transmission bitrate has exceeded the actual maximum transmission rate (i.e., the target transmission rate) under the current network environment, at which point there is a high probability of video stuttering. Based on this, electronic devices can reduce their transmission bitrate until the reduced bitrate is less than or equal to the target transmission rate. In other words, with the goal of achieving D ≤ C, D is actively adjusted and reduced until this goal is achieved.

[0052] In some embodiments, a reduction in the transmission bitrate may lead to a decrease in the quality of the video stream. If the decrease in video stream quality remains within a controllable (tolerable) range, no special processing is required. Conversely, if the video quality deteriorates excessively and exceeds the controllable range, appropriate processing of each frame of the video stream to be transmitted is necessary to salvage its quality. Therefore, after reducing the transmission bitrate to less than or equal to the target transmission rate, the electronic device also needs to detect whether the quality of the current video stream meets preset quality conditions. When the quality of the video stream does not meet these conditions, the image parameters of the video stream need to be adjusted to restore its quality.

[0053] Specifically, this quality condition can be defined as: no breathing effect occurring. Methods for adjusting the image parameters of the video stream can include: reducing image resolution, decreasing I-frame size, and / or enhancing 3D denoising (3DNR), etc., without limitation. In other words, the electronic device will detect whether breathing effect occurs in the video stream after reducing the transmission bitrate to less than or equal to the target transmission rate. If breathing effect occurs, it will eliminate the breathing effect by reducing image resolution, decreasing I-frame size, and / or enhancing 3DNR, ensuring that the quality of the video stream remains within a controllable range.

[0054] It is understood that for each control cycle, the electronic device can execute the bitrate control method proposed in the embodiments of this application, thereby realizing the periodic dynamic adjustment of the transmission bitrate of the video stream.

[0055] In some embodiments, for an IP camera (IPC), initialization of the transmission bitrate is involved upon power-on. The process is as follows: After the network camera registers and dials in, the network quality parameters are first obtained, including but not limited to reference signal received power, signal-to-noise ratio, and reference signal received quality. Then, the transmission bitrate of the network camera is initialized according to the quality parameters. That is, the initial transmission bitrate of the network camera is limited by the quality parameters. Specifically, the electronic device may have pre-divided the network quality into multiple quality levels (e.g., m levels) and pre-tested the ideal transmission bitrate corresponding to each quality level during the product design phase based on the network camera's RF performance. In practical applications, the electronic device can obtain the initial network quality level based on the network quality parameters obtained after registration and dialing, and then obtain the transmission bitrate corresponding to that initial quality level by consulting the quality-bitrate lookup table, thereby achieving the initialization of the transmission bitrate.

[0056] As an example only, the quality-bitrate conversion table can be shown in Table 1 below:

[0057] 1 <![CDATA[D 01 ]]> 2 <![CDATA[D 02 ]]> …… …… m <![CDATA[D 0m ]]>

[0058] As can be seen from the above, through the embodiments of this application, during the transmission of the video stream, a first transmission rate and a second transmission rate for the current control cycle are first determined. The first transmission rate is calculated based on network performance parameters and transmission parameters, while the second transmission rate is obtained statistically. Then, the electronic device determines a suitable target transmission rate from the first and second transmission rates, compares the transmission bitrate of the video stream with this target transmission rate, and finally controls the transmission bitrate based on the comparison result. This application's solution considers different situations in complex network environments, determining the possible upper limit of the transmission rate in two different ways: one is calculated based on network performance parameters and transmission parameters, and the other is obtained statistically. Among these two possible upper limits, the electronic device analyzes and determines the target transmission rate, making it closer to the actual and accurate upper limit of the transmission rate. This target transmission rate serves as the basis for controlling the transmission bitrate, achieving dynamic control of the transmission bitrate, thereby avoiding video stuttering.

[0059] Corresponding to the bitrate control method provided above, this application also provides a bitrate control device. This bitrate control device is integrated into an electronic device. For example... Figure 2 As shown, the bit rate control device 200 includes:

[0060] The first determining module 201 is used to determine the first transmission rate and the second transmission rate of the current control cycle during the transmission of the video stream. The first transmission rate is calculated based on the network performance parameters and transmission parameters, and the second transmission rate is obtained through statistics.

[0061] The second determining module 202 is used to determine the target transmission rate among the first transmission rate and the second transmission rate.

[0062] The comparison module 203 is used to compare the transmission bit rate of the video stream with the target transmission rate.

[0063] The control module 204 is used to control the transmission rate based on the comparison results.

[0064] Optionally, the control module 204 includes:

[0065] The first control unit is configured to maintain the transmission code rate unchanged or increase the transmission code rate if the comparison result indicates that the transmission code rate is less than or equal to the target transmission rate, wherein the increased transmission code rate remains less than or equal to the target transmission rate.

[0066] The second control unit is configured to reduce the transmission rate if the comparison result indicates that the transmission rate is greater than the target transmission rate, until the reduced transmission rate is less than or equal to the target transmission rate.

[0067] Optionally, the control module 204 further includes:

[0068] The detection unit is used to detect whether the quality of the video stream meets the preset quality conditions after the second control unit reduces the transmission bit rate until the reduced transmission bit rate is less than or equal to the target transmission rate.

[0069] The third control unit is used to adjust the image parameters of the video stream to repair the quality of the video stream if the quality of the video stream does not meet the quality conditions.

[0070] Optionally, the second determining module 202 is specifically used to determine the second transmission rate as the target transmission rate if the second transmission rate is less than the first transmission rate and the difference between the first transmission rate and the second transmission rate is greater than a preset difference threshold; and to determine the first transmission rate as the target transmission rate if the second transmission rate is not less than the first transmission rate and / or the difference between the first transmission rate and the second transmission rate is not greater than the difference threshold.

[0071] Optionally, the first determining module 201 mentioned above includes:

[0072] The uplink block error rate acquisition unit is used to acquire the uplink block error rate of the network in real time during the current control period.

[0073] Theoretical maximum uplink transmission rate calculation unit is used to calculate the theoretical maximum uplink transmission rate of the network in real time within the aforementioned current control period.

[0074] The first transmission rate calculation unit is used to calculate the first transmission rate based on the uplink block error rate and the theoretical maximum uplink transmission rate.

[0075] Optionally, the above-mentioned theoretical maximum uplink transmission rate calculation unit includes:

[0076] The transmission standard determination subunit is used to determine the transmission standard of the aforementioned video stream;

[0077] The network parameter selection subunit is used to select network parameters according to the above transmission standard.

[0078] Theoretically maximum uplink transmission rate calculation subunit is used to calculate the theoretically maximum uplink transmission rate in real time based on the parameter values ​​of the selected network parameters.

[0079] Optionally, the electronic device integrating the bitrate control device 200 can be a network camera, in which case the bitrate control device 200 further includes:

[0080] The quality parameter acquisition module is used to acquire network quality parameters after the network camera is registered and dialed.

[0081] The transmission bitrate initialization module is used to initialize the transmission bitrate of the network camera according to the aforementioned quality parameters.

[0082] As can be seen from the above, through the embodiments of this application, during the transmission of the video stream, a first transmission rate and a second transmission rate for the current control cycle are first determined. The first transmission rate is calculated based on network performance parameters and transmission parameters, while the second transmission rate is obtained statistically. Then, the electronic device determines a suitable target transmission rate from the first and second transmission rates, compares the transmission bitrate of the video stream with this target transmission rate, and finally controls the transmission bitrate based on the comparison result. This application's solution considers different situations in complex network environments, determining the possible upper limit of the transmission rate in two different ways: one is calculated based on network performance parameters and transmission parameters, and the other is obtained statistically. Among these two possible upper limits, the electronic device analyzes and determines the target transmission rate, making it closer to the actual and accurate upper limit of the transmission rate. This target transmission rate serves as the basis for controlling the transmission bitrate, achieving dynamic control of the transmission bitrate, thereby avoiding video stuttering.

[0083] Corresponding to the bitrate control method provided above, this application also provides an electronic device. Please refer to... Figure 3 The electronic device 3 in this application embodiment includes: a memory 301, and one or more processors 302. Figure 3 (Only one is shown) and a computer program stored in memory 301 and executable on the processor. Memory 301 stores software programs and units. The processor 302 executes various functional applications and diagnostics by running the software programs and units stored in memory 301 to obtain resources corresponding to the aforementioned preset events. Specifically, the processor 302 performs the following steps when running the aforementioned computer program stored in memory 301:

[0084] During the transmission of the video stream, a first transmission rate and a second transmission rate are determined for the current control cycle. The first transmission rate is calculated based on the network performance parameters and transmission parameters, and the second transmission rate is obtained through statistics.

[0085] Among the first transmission rate and the second transmission rate mentioned above, the target transmission rate is determined;

[0086] Compare the transmission bitrate of the above video stream with the target transmission rate mentioned above;

[0087] The transmission rate is controlled based on the comparison results.

[0088] Assuming the above is the first possible implementation, in the second possible implementation provided based on the first possible implementation, the control of the transmission rate based on the comparison result includes:

[0089] If the comparison result indicates that the transmission code rate is less than or equal to the target transmission rate, then the transmission code rate is kept unchanged, or the transmission code rate is increased, wherein the increased transmission code rate remains less than or equal to the target transmission rate.

[0090] If the comparison result indicates that the transmission bit rate is greater than the target transmission rate, then the transmission bit rate is reduced until the reduced transmission bit rate is less than or equal to the target transmission rate.

[0091] In a third possible implementation based on the second possible implementation described above, after reducing the transmission code rate until the reduced transmission code rate is less than or equal to the target transmission rate, the processor 302 further performs the following steps when running the computer program stored in the memory 301:

[0092] Check whether the quality of the above video stream meets the preset quality conditions;

[0093] If the quality of the video stream does not meet the above quality conditions, the image parameters of the video stream will be adjusted to restore the quality of the video stream.

[0094] In the fourth possible implementation provided based on the first possible implementation described above, determining the target transmission rate among the first transmission rate and the second transmission rate includes:

[0095] If the second transmission rate is less than the first transmission rate, and the difference between the first transmission rate and the second transmission rate is greater than a preset difference threshold, then the second transmission rate is determined as the target transmission rate.

[0096] If the second transmission rate is not less than the first transmission rate, and / or the difference between the first transmission rate and the second transmission rate is not greater than the difference threshold, then the first transmission rate is determined as the target transmission rate.

[0097] In a fifth possible implementation provided based on the first, second, third, or fourth possible implementations described above, the process of determining the first transmission rate includes:

[0098] Within the aforementioned current control period, the uplink block error rate of the aforementioned network is acquired in real time;

[0099] Within the aforementioned current control period, the theoretical maximum uplink transmission rate of the network is calculated in real time.

[0100] Based on the aforementioned uplink block error rate and the aforementioned theoretical maximum uplink transmission rate, the aforementioned first transmission rate is calculated.

[0101] In the sixth possible implementation provided based on the fifth possible implementation described above, the theoretical maximum uplink transmission rate of the real-time computing network includes:

[0102] Determine the transmission standard of the aforementioned video stream;

[0103] Select network parameters based on the above transmission standard;

[0104] Based on the selected network parameter values, the theoretical maximum uplink transmission rate is calculated in real time.

[0105] In a seventh possible implementation provided based on the first, second, third, or fourth possible implementations described above, the electronic device 3 may be a network camera; before the network camera begins transmitting the video stream, the processor 302 further performs the following steps by running the computer program stored in the memory 301:

[0106] After registering and dialing the network using the aforementioned network camera, obtain the network quality parameters;

[0107] The transmission bitrate of the network camera is initialized based on the aforementioned quality parameters.

[0108] It should be understood that, in the embodiments of this application, the processor 302 may be a central processing unit (CPU), but it may also be other general-purpose processors, 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, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0109] Memory 301 may include read-only memory and random access memory, and provides instructions and data to processor 302. Some or all of memory 301 may also include non-volatile random access memory. For example, memory 301 may also store device category information.

[0110] As can be seen from the above, through the embodiments of this application, during the transmission of the video stream, a first transmission rate and a second transmission rate for the current control cycle are first determined. The first transmission rate is calculated based on network performance parameters and transmission parameters, while the second transmission rate is obtained statistically. Then, the electronic device determines a suitable target transmission rate from the first and second transmission rates, compares the transmission bitrate of the video stream with this target transmission rate, and finally controls the transmission bitrate based on the comparison result. This application's solution considers different situations in complex network environments, determining the possible upper limit of the transmission rate in two different ways: one is calculated based on network performance parameters and transmission parameters, and the other is obtained statistically. Among these two possible upper limits, the electronic device analyzes and determines the target transmission rate, making it closer to the actual and accurate upper limit of the transmission rate. This target transmission rate serves as the basis for controlling the transmission bitrate, achieving dynamic control of the transmission bitrate, thereby avoiding video stuttering.

[0111] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments 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. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0112] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0113] 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 external device 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.

[0114] 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 system embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units 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 between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0115] The units described above 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0116] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing associated hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer-readable storage device, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the contents of the aforementioned computer-readable storage media may be appropriately added to or subtracted from the contents according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media may not include electrical carrier signals and telecommunication signals.

[0117] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A bitrate control method, characterized in that, include: During the transmission of the video stream, a first transmission rate and a second transmission rate are determined for the current control cycle. The transmission process is divided into multiple control cycles based on a preset control duration and interval duration. Each control cycle is further divided into multiple transmission cycles based on a preset transmission duration. The formula for calculating the first transmission rate is: Where A is the first transmission rate; n is the number of transmission cycles within the current control cycle; M i The uplink block error rate (BER) is the uplink block error rate of the i-th transmission cycle obtained within the current control cycle. i The theoretical maximum uplink transmission rate is obtained in the i-th transmission cycle within the current control cycle. The process of determining the theoretical maximum uplink transmission rate is as follows: within the current control cycle, the transmission standard of the video stream is determined; network parameters are selected according to the transmission standard; and the theoretical maximum uplink transmission rate is calculated in real time based on the parameter values ​​of the selected network parameters; α is a constant greater than 0 and less than 1. The process of determining the second transmission rate includes: counting the amount of data transmitted via uplink within the current control cycle; and obtaining the second transmission rate by division based on the amount of data and the duration of the current control cycle. Determining a target transmission rate among the first transmission rate and the second transmission rate includes: if the second transmission rate is less than the first transmission rate, and the difference between the first transmission rate and the second transmission rate is greater than a preset difference threshold, then the second transmission rate is determined as the target transmission rate; if the second transmission rate is not less than the first transmission rate, and / or the difference between the first transmission rate and the second transmission rate is not greater than the difference threshold, then the first transmission rate is determined as the target transmission rate; wherein the target transmission rate is used to reflect the actual highest transmission rate in the current network environment. The transmission bitrate of the video stream is compared with the target transmission rate; The transmission rate is controlled based on the comparison results.

2. The bitrate control method as described in claim 1, characterized in that, The step of controlling the transmission rate based on the comparison results includes: If the comparison result indicates that the transmission code rate is less than or equal to the target transmission rate, then the transmission code rate is kept unchanged, or the transmission code rate is increased, wherein the increased transmission code rate remains less than or equal to the target transmission rate; If the comparison result indicates that the transmission bit rate is greater than the target transmission rate, then the transmission bit rate is reduced until the reduced transmission bit rate is less than or equal to the target transmission rate.

3. The bitrate control method as described in claim 2, characterized in that, After reducing the transmission bit rate until the reduced transmission bit rate is less than or equal to the target transmission rate, the bit rate control method further includes: Detect whether the quality of the video stream meets preset quality conditions; If the quality of the video stream does not meet the quality conditions, the image parameters of the video stream are adjusted to repair the quality of the video stream.

4. The bitrate control method according to any one of claims 1 to 3, characterized in that, The bitrate control method is applied to a network camera; before the network camera begins transmitting the video stream, the bitrate control method further includes: After the network camera registers and dials up, the network quality parameters are obtained. The transmission bitrate of the network camera is initialized according to the quality parameters.

5. A bit rate control device, characterized in that, include: The first determining module is used to determine the first transmission rate and the second transmission rate of the current control cycle during the transmission of the video stream. The transmission process is divided into multiple control cycles based on a preset control duration and interval duration. Each control cycle is further divided into multiple transmission cycles based on a preset transmission duration. The formula for calculating the first transmission rate is: Where A is the first transmission rate; n is the number of transmission cycles within the current control cycle; M i The uplink block error rate (BER) is the uplink block error rate of the i-th transmission cycle obtained within the current control cycle. i The theoretical maximum uplink transmission rate is obtained in the i-th transmission cycle within the current control cycle. The process of determining the theoretical maximum uplink transmission rate is as follows: within the current control cycle, the transmission standard of the video stream is determined; network parameters are selected according to the transmission standard; and the theoretical maximum uplink transmission rate is calculated in real time based on the parameter values ​​of the selected network parameters; α is a constant greater than 0 and less than 1. The process of determining the second transmission rate includes: counting the amount of data transmitted via uplink within the current control cycle; and obtaining the second transmission rate by division based on the amount of data and the duration of the current control cycle. The second determining module is used to determine a target transmission rate among the first transmission rate and the second transmission rate. The target transmission rate is used to reflect the actual highest transmission rate in the current network environment, including: if the second transmission rate is less than the first transmission rate and the difference between the first transmission rate and the second transmission rate is greater than a preset difference threshold, then the second transmission rate is determined as the target transmission rate; if the second transmission rate is not less than the first transmission rate, and / or the difference between the first transmission rate and the second transmission rate is not greater than the difference threshold, then the first transmission rate is determined as the target transmission rate. The comparison module is used to compare the transmission bitrate of the video stream with the target transmission rate; The control module is used to control the transmission rate based on the comparison results.

6. An electronic 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 as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and apparatus for adjusting code rate

    CN106454412A

  • Video frame transmission method, system and server

    CN110312150A