CN114422790A - Code rate control method, code rate control device and electronic equipment - Google Patents

Code rate control method, code rate control device and electronic equipment Download PDF

Info

Publication number
CN114422790A
CN114422790A CN202210224459.4A CN202210224459A CN114422790A CN 114422790 A CN114422790 A CN 114422790A CN 202210224459 A CN202210224459 A CN 202210224459A CN 114422790 A CN114422790 A CN 114422790A
Authority
CN
China
Prior art keywords
transmission
rate
transmission rate
code rate
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210224459.4A
Other languages
Chinese (zh)
Inventor
潘灏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Mercury Communication Technology Co ltd
Original Assignee
Shenzhen Mercury Communication Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Mercury Communication Technology Co ltd filed Critical Shenzhen Mercury Communication Technology Co ltd
Priority to CN202210224459.4A priority Critical patent/CN114422790A/en
Publication of CN114422790A publication Critical patent/CN114422790A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Quality & Reliability (AREA)
  • Multimedia (AREA)
  • Environmental & Geological Engineering (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a code rate control method, a code rate control device, an electronic device and a computer readable storage medium. Wherein, the method comprises the following steps: in the transmission process of a video stream, determining a first transmission rate and a second transmission rate of a current control period, wherein the first transmission rate is obtained by calculation 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 the transmission code rate of the video stream with the target transmission rate; and controlling the transmission code rate according to the comparison result. By the scheme, the code rate can be dynamically adjusted according to the actual network transmission condition in the video stream transmission process, and the video blockage is avoided.

Description

Code rate control method, code rate control device and electronic equipment
Technical Field
The present application belongs to the field of video processing technologies, and in particular, to a code rate control method, a code rate control apparatus, an electronic device, and a computer-readable storage medium.
Background
For cost reasons, some surveillance cameras use Long Term Evolution user equipment-Category1 (LTE CAT1) technology to transmit video streams. At present, although the resolution of video streams is improved under the influence of technology upgrade, the format of the video streams is still limited by the upper limit of the transmission rate of LTE CAT 1. Also, for surveillance cameras installed in remote locations, there are often fluctuations in the network conditions. The above factors may cause the transmission rate to be smaller than the video rate, thereby causing video jamming to occur.
Disclosure of Invention
The application provides a code rate control method, a code rate control device, an electronic device and a computer readable storage medium, which can dynamically adjust the code rate according to the actual network transmission condition in the video stream transmission process, and avoid the video jam condition.
In a first aspect, the present application provides a method for controlling a code rate, including:
in the transmission process of video stream, determining a first transmission rate and a second transmission rate of a current control period, wherein the first transmission rate is obtained by calculation 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 the transmission code rate of the video stream with the target transmission rate;
and controlling the transmission code rate according to the comparison result.
In a second aspect, the present application provides a rate control apparatus, including:
the device comprises a first determining module, a second determining module and a control module, wherein the first determining module is used for determining a first transmission rate and a second transmission rate of a current control period in the transmission process of a video stream, the first transmission rate is obtained by calculation based on performance parameters and transmission parameters of a network, and the second transmission rate is obtained by statistics;
a second determining module, configured to determine a target transmission rate from the first transmission rate and the second transmission rate;
a comparison module, configured to compare the transmission code rate of the video stream with the target transmission rate;
and the control module is used for controlling the transmission code rate according to the comparison result.
In a third aspect, the present application provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method of the first aspect as described above.
Compared with the prior art, the application has the beneficial effects that: in the transmission process of the video stream, a first transmission rate and a second transmission rate of a current control period are determined, wherein the first transmission rate is obtained by calculation based on performance parameters and transmission parameters of a network, the second transmission rate is obtained by statistics, then the electronic equipment determines a proper target transmission rate from the first transmission rate and the second transmission rate, compares the transmission rate of the video stream with the target transmission rate, and finally controls the transmission rate according to a comparison result. The scheme of the application considers different situations under a complex network environment, and determines the possible upper limit of the transmission rate in two different modes, one mode is obtained by calculation based on the performance parameters and the transmission parameters of the network, and the other mode is obtained by statistics. Of the two possible upper limits, the electronic device analyzes and determines the target transmission rate, so that the target transmission rate can be closer to the actual upper limit of the real and accurate transmission rate. The target transmission rate can be used as a control basis for the transmission code rate, and the dynamic control of the transmission code rate is realized, so that the video blocking condition is avoided.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic diagram illustrating an implementation flow of a code rate control method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a code rate control apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution proposed in the present application, the following description will be given by way of specific examples.
The following explains the code rate control method proposed in the embodiment of the present application. Referring to fig. 1, the flow of implementing the rate control method is detailed as follows:
step 101, in the transmission process of the video stream, determining a first transmission rate and a second transmission rate of a current control period.
In the process of transmitting the video stream, the electronic device can divide a plurality of control periods based on preset control duration and interval duration. Each control period may be equally divided into a plurality of transmission periods based on a preset transmission duration. For example only, the transmission duration may be 5 seconds or 10 seconds, the control duration may be 60 seconds or 90 seconds, and the interval duration may be 0 seconds, 5 seconds or 10 seconds, where specific values of the transmission duration, the control duration and the interval duration are not limited.
Take the transmission duration as 5 seconds, the control duration as 60 seconds, and the interval duration as 5 seconds as an example:
assuming that the electronic device starts to transmit the video stream at time T0, during the period from T0 to T0+60s, there are 12 transmission cycles, i.e., T0 to T0+5s, T0+5s to T0+10s, … …, T0+55s to T0+60 s; similarly, in the period from the second control period T0+65s to T0+125s, there are 12 transmission periods, i.e., T0+65s to T0+70s, T0+70s to T0+75s, … …, T0+120s to T0+125s, and so on, which will not be described herein again.
The first transmission rate and the second transmission rate are obtained in different manners. Specifically, the first transmission rate is calculated based on the performance parameter and the transmission parameter of the network, and the second transmission rate is obtained through statistics.
The following describes the process of acquiring the first transmission rate:
the electronic equipment can acquire the uplink block error rate of the network in real time in the current control period, and simultaneously calculate the theoretical uplink maximum transmission rate of the network in real time. Here, the uplink block error rate of the network, which is obtained by the electronic device in real time in the current control period, specifically means: average value of uplink block error rate of each transmission period in the current control period. That is, if the number of transmission cycles in the current control cycle is n, the electronic device may obtain an uplink block error rate (an average value used for representing the uplink block error rate in the transmission cycle) for each transmission cycle in the current control cycle, and finally obtain n uplink block error rates at the end of the current control cycle. Similarly, when the uplink block error rate corresponding to a certain transmission period is obtained each time, the electronic device may also synchronously calculate and obtain the theoretical uplink maximum transmission rate corresponding to the transmission period. After the current control period is finished, the first transmission rate can be calculated based on all uplink block error rates (i.e. n uplink block error rates) obtained in the current control period, all theoretical uplink maximum transmission rates (i.e. n theoretical uplink maximum transmission rates) and a preset transmission rate calculation formula.
It can be understood that the uplink block error rate belongs to a performance parameter of the network, the theoretical uplink maximum transmission rate is calculated through a transmission parameter of the network, and the first transmission rate can be calculated only after the uplink block error rate and the theoretical uplink maximum transmission rate are combined. In some examples, the first transmission rate is calculated as follows:
Figure BDA0003535184700000051
wherein A is a first transmission rate; n is the number of uplink block error rates obtained in the current control period, which is equivalent to the number of transmission periods in the current control period (which is also the number of theoretical uplink maximum transmission rates obtained in the current control period); miThe uplink block error rate is the ith uplink block error rate acquired in the current control period; BERiThe ith theoretical uplink maximum transmission rate acquired in the current control period; α is a constant greater than 0 and less than 1.
The derivation of this formula is described below: since the BER represents the uplink block error rate, the 1-BER can represent the proportion of correctly transmitted data, and the M (1-BER) can represent the maximum transmission rate of theoretically correct uplink data. Then, since the number of the uplink block error rate and the theoretical uplink maximum transmission rate obtained in the current control period is n, the average value is obtained
Figure BDA0003535184700000052
Since there is some redundant information such as check code in the transmitted data, the useful data that can be actually transmitted in uplink is about 60% to 70% according to experience, so the constant α is set, and the value of α is, as an example only, 60% of the lower limit of the experience value. To this end, the calculation formula of the first transmission rate as described above is obtained.
The theoretical uplink maximum transmission rate M of the network can be calculated as follows: firstly, determining the transmission mode of the video stream, then selecting the network parameters according to the transmission mode, and then calculating the theoretical maximum uplink transmission rate in real time based on the parameter values of the selected network parameters. It can be understood that the transmission system and the network parameters of the video stream belong to the transmission parameters. In some examples, the transmission systems concerned by the embodiments of the present application are mainly the following two types: Frequency-Division Duplex Long Term Evolution (FDD-LTE) and Time-Division Duplex Long Term Evolution (TDD-LTE).
In an application scenario, if the transmission system is FDD-LTE, the network parameters selected based on the transmission system include the following items: a communication frequency band, a transmission bandwidth, an uplink modulation mode, the number of uplink Resource Blocks (RBs), and an uplink Transport Block Size Index (TBSI) of each subframe. In another application scenario, if the transmission format is TDD-LTE, the network parameters selected based on the transmission format include the following items: communication frequency band, transmission bandwidth, uplink modulation mode, uplink RB quantity, uplink TBSI of each subframe and the ratio of upper and lower subframes. That is, the transmission parameter (network parameter) of the upper and lower subframe allocation is considered more in the case of TDD-LTE than in the case of FDD-LTE. The theoretical uplink maximum transmission rate M in the current network environment can be calculated according to the contents in the protocols TS 36.211 and TS 36.213 of the third Generation Partnership Project (3 GPP) by using the real-time parameter values of the network parameters. For the sake of brevity, no details are given here about the 3GPP protocol.
The following describes the process of acquiring the second transmission rate: counting the data volume of data transmitted through uplink in the current control period; according to the data volume and the time length of the current control period (namely, the control time length), the second transmission rate can be obtained through simple division operation.
Step 102, determining a target transmission rate from the first transmission rate and the second transmission rate.
The first transmission rate and the second transmission rate both indicate the upper limit of the transmission rate that can be provided by the current control period to some extent. The electronic device can select the most appropriate transmission rate as the target transmission rate by analyzing the first transmission rate and the second transmission rate. The target transmission rate may be understood as: the actual highest transmission rate in the current network environment.
In some examples, the analysis process is as follows: and comparing the first transmission rate with the second transmission rate, and comparing the difference value of the first transmission rate and the second transmission rate with a preset difference threshold value. For convenience of description, the second transmission rate is denoted as B, the first transmission rate is denoted as a, the preset difference threshold is denoted as X, and the target transmission rate is denoted as C, and the comparison result has the following two cases:
in the first case, B < A, and A-B > X. In this case, B is assigned to C, that is, C ═ B (the second transmission rate is determined as the target transmission rate).
In the second case, B is greater than or equal to A, and/or A-B is less than or equal to X (i.e., all cases except the first case are the second case). In this case, a is assigned to C, i.e., C ═ a (the first transmission rate is determined as the target transmission rate).
It can be understood that, when the electronic device transmits the video stream, the transmission code rate may fluctuate during the transmission process, and therefore, when analyzing the first transmission rate and the second transmission rate, a margin, that is, the preset difference threshold X, needs to be considered. The value of X can be determined according to the fluctuation of the code rate of the electronic device. For example only, the value of X may be 10% of a, and of course, the value of X may also be other values, which is not limited herein.
Step 103, comparing the transmission code rate of the video stream with the target transmission rate.
Since the video jam condition usually occurs when the transmission code rate is greater than the transmission rate, the electronic device may compare the current transmission code rate of the video stream with the target transmission rate to determine whether the video jam condition is likely to occur. That is, the comparison result between the two may be considered to express the occurrence probability of the video stuck situation to some extent.
And 104, controlling the transmission code rate according to the comparison result.
If the current transmission code rate of the video stream is D, the comparison result can be roughly divided into the following two cases:
in the first case, D is less than or equal to C. That is, the transmission code rate does not exceed the actual highest transmission rate (i.e., the target transmission rate) in the current network environment. At this time, the electronic device may consider maintaining the transmission code rate unchanged. Alternatively, the electronic device may also consider to increase the transmission code rate appropriately, but it should be noted that the increased transmission code rate still needs to be kept less than or equal to the target transmission rate. That is, D can be increased as appropriate while maintaining D.ltoreq.C.
In the second case, D > C. That is, the transmission rate exceeds the actual highest transmission rate (i.e., the target transmission rate) in the current network environment, and at this time, there is a high probability that the video is jammed. Based on this, the electronic device may reduce the transmission code rate until the reduced transmission code rate can be less than or equal to the target transmission rate. That is, with the goal of achieving D ≦ C, the active adjustment decreases D until the goal is achieved.
In some embodiments, a reduction in the transmission rate may result in a degradation in the quality of the video stream. If the degradation of the quality of the video stream remains within a controllable range (tolerable range), no special processing is necessary. On the contrary, if the quality of the video is degraded too much and exceeds the controllable range, the images of each frame to be transmitted in the video stream need to be processed correspondingly to remedy the quality of the images. After the transmission code rate is reduced to be less than or equal to the target transmission rate, the electronic device further needs to detect whether the quality of the current video stream meets a preset quality condition, and when the quality of the video stream does not meet the quality condition, image parameters of the video stream need to be adjusted to repair the quality of the video stream.
Wherein the quality condition may specifically be: no respiration occurred. The means for adjusting the image parameters of the video stream may specifically be: reducing image resolution, reducing I-frame (I-frame) size, and/or enhancing three-dimensional noise reduction (3-dimensional Denoising, 3DNR), and the like, without limitation. That is, the electronic device may detect whether the video stream has a respiration effect after reducing the transmission rate to be less than or equal to the target transmission rate, and when the respiration effect occurs, eliminate the respiration effect by reducing the image resolution, reducing the I frame, and/or enhancing the 3DNR, thereby ensuring that the quality of the video stream is still within a controllable range.
It can be understood that, for each control period, the electronic device may execute the rate control method provided in the embodiments of the present application, thereby implementing periodic dynamic adjustment of the transmission rate of the video stream.
In some embodiments, for a network CAMERA (IP CAMERA, IPC), it also involves initialization of transmission code rate when it is just turned on, as follows: after the network camera is in network connection and dials, the quality parameters of the network are firstly obtained, including but not limited to reference signal receiving power, signal-to-noise ratio, reference signal receiving quality and the like. Then, initializing the transmission code rate of the network camera according to the quality parameter, that is, the initial transmission code rate of the network camera is defined by the quality parameter, and the specific process may be as follows: the electronic device divides the quality of the network into a plurality of quality grades (for example, m quality grades) in advance, and tests in advance to obtain an ideal transmission code rate corresponding to each quality grade in a product design stage according to the radio frequency performance of the network camera. Therefore, in practical application, the electronic device can obtain the quality grade of the network in the initial state according to the quality parameters of the network obtained after network injection and dialing, and obtain the transmission code rate corresponding to the quality grade of the network in the initial state by referring to the quality-code rate comparison table, thereby realizing the initialization of the transmission code rate.
For example only, the quality-code rate comparison table may be as shown in table 1 below:
quality grade Transmission code rate
1 D01
2 D02
…… ……
m D0m
As can be seen from the above, according to the embodiment of the present application, in the transmission process of a video stream, a first transmission rate and a second transmission rate of a current control period are determined, where the first transmission rate is calculated based on a performance parameter and a transmission parameter of a network, and the second transmission rate is obtained through statistics, and then the electronic device determines a suitable target transmission rate from the first transmission rate and the second transmission rate, compares a transmission rate of the video stream with the target transmission rate, and controls the transmission rate according to a comparison result. The scheme of the application considers different situations under a complex network environment, and determines the possible upper limit of the transmission rate in two different modes, one mode is obtained by calculation based on the performance parameters and the transmission parameters of the network, and the other mode is obtained by statistics. Of the two possible upper limits, the electronic device analyzes and determines the target transmission rate, so that the target transmission rate can be closer to the actual upper limit of the real and accurate transmission rate. The target transmission rate can be used as a control basis for the transmission code rate, and the dynamic control of the transmission code rate is realized, so that the video blocking condition is avoided.
Corresponding to the code rate control method provided above, the embodiment of the present application further provides a code rate control device. The code rate control device is integrated in the electronic equipment. As shown in fig. 2, the code rate control apparatus 200 includes:
a first determining module 201, configured to determine a first transmission rate and a second transmission rate of a current control period in a transmission process of a video stream, where the first transmission rate is obtained by calculation based on a performance parameter and a transmission parameter of a network, and the second transmission rate is obtained by statistics;
a second determining module 202, configured to determine a target transmission rate in the first transmission rate and the second transmission rate;
a comparison module 203, configured to compare the transmission code rate of the video stream with the target transmission rate;
and a control module 204, configured to control the transmission code rate according to the comparison result.
Optionally, the control module 204 includes:
a first control unit, 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, where the increased transmission code rate is kept less than or equal to the target transmission rate;
a second control unit, configured to reduce the transmission code rate if the comparison result indicates that the transmission code rate is greater than the target transmission rate, until the reduced transmission code rate is less than or equal to the target transmission rate.
Optionally, the control module 204 further includes:
a detecting unit, configured to detect whether the quality of the video stream meets a preset quality condition after the second control unit reduces the transmission code rate until the reduced transmission code rate is less than or equal to the target transmission rate;
a third control unit, configured to adjust the image parameter of the video stream to repair the quality of the video stream if the quality of the video stream does not satisfy the quality condition.
Optionally, the second determining module 202 is specifically configured to determine the second transmission rate as a target transmission rate if the second transmission rate is smaller than the first transmission rate and a difference between the first transmission rate and the second transmission rate is greater than a preset difference threshold, and determine the first transmission rate as the target transmission rate if the second transmission rate is not smaller than the first transmission rate and/or a difference between the first transmission rate and the second transmission rate is not greater than the difference threshold.
Optionally, the first determining module 201 includes:
an uplink block error rate obtaining unit, configured to obtain an uplink block error rate of the network in real time in the current control period;
a theoretical uplink maximum transmission rate calculation unit, configured to calculate a theoretical uplink maximum transmission rate of the network in real time in the current control period;
and a first transmission rate calculation unit, configured to calculate the first transmission rate based on the uplink block error rate and the theoretical uplink maximum transmission rate.
Optionally, the unit for calculating the theoretical uplink maximum transmission rate includes:
a transmission system determining subunit, configured to determine a transmission system of the video stream;
a network parameter selection subunit, configured to select a network parameter according to the transmission system;
and the theoretical uplink maximum transmission rate calculation subunit is used for calculating the theoretical uplink maximum transmission rate in real time based on the parameter value of the selected network parameter.
Optionally, the electronic device integrated with the rate control apparatus 200 may be a network camera, and then the rate control apparatus 200 further includes:
the quality parameter acquisition module is used for acquiring the quality parameters of the network after the network camera is used for network injection and dialing;
and the transmission code rate initialization module is used for initializing the transmission code rate of the network camera according to the quality parameters.
As can be seen from the above, according to the embodiment of the present application, in the transmission process of a video stream, a first transmission rate and a second transmission rate of a current control period are determined, where the first transmission rate is calculated based on a performance parameter and a transmission parameter of a network, and the second transmission rate is obtained through statistics, and then the electronic device determines a suitable target transmission rate from the first transmission rate and the second transmission rate, compares a transmission rate of the video stream with the target transmission rate, and controls the transmission rate according to a comparison result. The scheme of the application considers different situations under a complex network environment, and determines the possible upper limit of the transmission rate in two different modes, one mode is obtained by calculation based on the performance parameters and the transmission parameters of the network, and the other mode is obtained by statistics. Of the two possible upper limits, the electronic device analyzes and determines the target transmission rate, so that the target transmission rate can be closer to the actual upper limit of the real and accurate transmission rate. The target transmission rate can be used as a control basis for the transmission code rate, and the dynamic control of the transmission code rate is realized, so that the video blocking condition is avoided.
Corresponding to the code rate control method provided above, an embodiment of the present application further provides an electronic device. Referring to fig. 3, an electronic device 3 in the embodiment of the present application includes: a memory 301, one or more processors 302 (only one shown in fig. 3), and a computer program stored on the memory 301 and executable on the processors. Wherein: the memory 301 is used for storing software programs and units, and the processor 302 executes various functional applications and diagnoses by running the software programs and units stored in the memory 301, so as to obtain resources corresponding to the preset events. Specifically, the processor 302 realizes the following steps by running the above-mentioned computer program stored in the memory 301:
in the transmission process of video stream, determining a first transmission rate and a second transmission rate of a current control period, wherein the first transmission rate is obtained by calculation 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 the transmission code rate of the video stream with the target transmission rate;
and controlling the transmission code rate according to the comparison result.
Assuming that the above is the first possible embodiment, in a second possible embodiment provided based on the first possible embodiment, the controlling the transmission code rate according to the comparison result includes:
if the comparison result indicates that the transmission code rate is less than or equal to the target transmission rate, maintaining the transmission code rate unchanged, or increasing the transmission code rate, wherein the increased transmission code rate is kept less than or equal to the target transmission rate;
if the comparison result indicates that the transmission code rate is greater than the target transmission rate, the transmission code rate is reduced until the reduced transmission code rate is less than or equal to the target transmission rate.
In a third possible implementation manner provided on the basis of the second possible implementation manner, after the reducing the transmission code rate until the reduced transmission code rate is smaller than or equal to the target transmission rate, the processor 302 further implements the following steps when executing the computer program stored in the memory 301:
detecting whether the quality of the video stream meets a preset quality condition;
and if the quality of the video stream does not meet the quality condition, adjusting the image parameters of the video stream to repair the quality of the video stream.
In a fourth possible implementation manner provided on the basis of the first possible implementation manner, the determining a target transmission rate from among the first transmission rate and the second transmission rate includes:
if the second transmission rate is smaller than the first transmission rate and the difference between the first transmission rate and the second transmission rate is larger than a preset difference threshold, determining the second transmission rate as a target transmission rate;
and 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, determining the first transmission rate as a target transmission rate.
In a fifth possible implementation manner provided on the basis of the first possible implementation manner, the second possible implementation manner, the third possible implementation manner, or the fourth possible implementation manner, the determining of the first transmission rate includes:
acquiring the uplink block error rate of the network in real time in the current control period;
in the current control period, calculating the theoretical uplink maximum transmission rate of the network in real time;
and calculating the first transmission rate based on the uplink block error rate and the theoretical uplink maximum transmission rate.
In a sixth possible implementation manner provided on the basis of the fifth possible implementation manner, the calculating a theoretical uplink maximum transmission rate of the network in real time includes:
determining the transmission system of the video stream;
selecting network parameters according to the transmission system;
and calculating the theoretical uplink maximum transmission rate in real time based on the parameter value of the selected network parameter.
In a seventh possible implementation based on the first possible implementation, the second possible implementation, the third possible implementation, or the fourth possible implementation, the electronic device 3 may be a webcam; before the network camera starts to transmit the video stream, the processor 302 further implements the following steps by running the computer program stored in the memory 301:
after the network camera is used for network injection and dialing, acquiring the quality parameters of the network;
and initializing the transmission code rate of the network camera according to the quality parameters.
It should be understood that in the embodiments of the present Application, the Processor 302 may be a Central Processing Unit (CPU), and the Processor may 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. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Memory 301 may include both 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, the memory 301 may also store device class information.
As can be seen from the above, according to the embodiment of the present application, in the transmission process of a video stream, a first transmission rate and a second transmission rate of a current control period are determined, where the first transmission rate is calculated based on a performance parameter and a transmission parameter of a network, and the second transmission rate is obtained through statistics, and then the electronic device determines a suitable target transmission rate from the first transmission rate and the second transmission rate, compares a transmission rate of the video stream with the target transmission rate, and controls the transmission rate according to a comparison result. The scheme of the application considers different situations under a complex network environment, and determines the possible upper limit of the transmission rate in two different modes, one mode is obtained by calculation based on the performance parameters and the transmission parameters of the network, and the other mode is obtained by statistics. Of the two possible upper limits, the electronic device analyzes and determines the target transmission rate, so that the target transmission rate can be closer to the actual upper limit of the real and accurate transmission rate. The target transmission rate can be used as a control basis for the transmission code rate, and the dynamic control of the transmission code rate is realized, so that the video blocking condition is avoided.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of external device software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer readable Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable storage medium may contain other contents which can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable storage medium does not include an electrical carrier signal and a telecommunication signal according to the legislation and the patent practice.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for rate control, comprising:
in the transmission process of a video stream, determining a first transmission rate and a second transmission rate of a current control period, wherein the first transmission rate is obtained by calculation 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 the transmission code rate of the video stream with the target transmission rate;
and controlling the transmission code rate according to the comparison result.
2. The method for controlling the code rate according to claim 1, wherein the controlling the transmission code rate according to the comparison result comprises:
if the comparison result indicates that the transmission code rate is less than or equal to the target transmission rate, maintaining the transmission code rate unchanged, or increasing the transmission code rate, wherein the increased transmission code rate is kept less than or equal to the target transmission rate;
and if the comparison result indicates that the transmission code rate is greater than the target transmission rate, reducing the transmission code rate until the reduced transmission code rate is less than or equal to the target transmission rate.
3. The code rate control method of claim 2, wherein after the reducing the transmission code rate until the reduced transmission code rate is less than or equal to the target transmission rate, the code rate control method further comprises:
detecting whether the quality of the video stream meets a preset quality condition;
and if the quality of the video stream does not meet the quality condition, adjusting the image parameters of the video stream to repair the quality of the video stream.
4. The rate control method of claim 1, wherein the determining a target transmission rate among the first transmission rate and the second transmission rate comprises:
if the second transmission rate is smaller than the first transmission rate and the difference value between the first transmission rate and the second transmission rate is larger than a preset difference threshold value, determining the second transmission rate as a target transmission rate;
and if the second transmission rate is not less than the first transmission rate and/or the difference value between the first transmission rate and the second transmission rate is not greater than the difference threshold, determining the first transmission rate as a target transmission rate.
5. The rate control method of any of claims 1 to 4, wherein the determining of the first transmission rate comprises:
acquiring the uplink block error rate of the network in real time in the current control period;
in the current control period, calculating the theoretical uplink maximum transmission rate of the network in real time;
and calculating the first transmission rate based on the uplink block error rate and the theoretical uplink maximum transmission rate.
6. The code rate control method of claim 5, wherein the calculating the theoretical uplink maximum transmission rate of the network in real time comprises:
determining a transmission system of the video stream;
selecting network parameters according to the transmission system;
and calculating the theoretical uplink maximum transmission rate in real time based on the parameter value of the selected network parameter.
7. The rate control method according to any of claims 1 to 4, wherein the rate control method is applied to a web camera; before the webcam starts to transmit the video stream, the rate control method further includes:
after the network camera is used for network injection and dialing, acquiring the quality parameters of the network;
and initializing the transmission code rate of the network camera according to the quality parameter.
8. An apparatus for controlling a code rate, comprising:
the device comprises a first determining module, a second determining module and a control module, wherein the first determining module is used for determining a first transmission rate and a second transmission rate of a current control period in the transmission process of a video stream, the first transmission rate is obtained by calculation based on performance parameters and transmission parameters of a network, and the second transmission rate is obtained by statistics;
a second determining module, configured to determine a target transmission rate in the first transmission rate and the second transmission rate;
a comparison module, configured to compare the transmission code rate of the video stream with the target transmission rate;
and the control module is used for controlling the transmission code rate according to the comparison result.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202210224459.4A 2022-03-07 2022-03-07 Code rate control method, code rate control device and electronic equipment Pending CN114422790A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210224459.4A CN114422790A (en) 2022-03-07 2022-03-07 Code rate control method, code rate control device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210224459.4A CN114422790A (en) 2022-03-07 2022-03-07 Code rate control method, code rate control device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114422790A true CN114422790A (en) 2022-04-29

Family

ID=81264333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210224459.4A Pending CN114422790A (en) 2022-03-07 2022-03-07 Code rate control method, code rate control device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114422790A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115914682A (en) * 2022-11-24 2023-04-04 合肥移瑞通信技术有限公司 Video code rate adjusting method, system, server and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115914682A (en) * 2022-11-24 2023-04-04 合肥移瑞通信技术有限公司 Video code rate adjusting method, system, server and storage medium

Similar Documents

Publication Publication Date Title
CN105430532B (en) A kind of control method and its system that video data transmission adaptively adjusts
CN107623851B (en) Video code stream transmission control device and control method
CN108769450B (en) Data transmission control method, information sending end, receiving end and aircraft graph transmission system
US9872021B2 (en) Video conversion method and apparatus
CN1168234C (en) Method and system for controlling transmission power
RU2656363C2 (en) Frequency spectral management apparatus and method, geographical location database and secondary system apparatus
CN112491658B (en) Bandwidth estimation method and device, electronic equipment and computer-readable storage medium
CN111225209B (en) Video data plug flow method, device, terminal and storage medium
CN110012324B (en) Code rate self-adaption method, WIFI camera, control device and code rate self-adaption system for embedded wireless video transmission
CN113992967B (en) Screen projection data transmission method and device, electronic equipment and storage medium
US20160006805A1 (en) Transport accelerator systems and methods
CN114422790A (en) Code rate control method, code rate control device and electronic equipment
CN111263153A (en) Video encoding method, device, equipment and storage medium
US10568108B2 (en) Channel access period allocation method, apparatus, and system
CN110620939B (en) Network state determination method and device, electronic equipment and storage medium
CN108600794B (en) Frame loss rate correction method, device and terminal
CN104333763A (en) Video control method
CN112511702B (en) Media frame pushing method, server, electronic equipment and storage medium
US8234683B2 (en) Method and apparatus for controlling channel for providing internet protocol television service
CN114338401A (en) Resource allocation method, device, electronic equipment and readable medium
US8791981B2 (en) Bit rate control apparatus and method thereof
CN109510694B (en) Configuration method of control channel unit resource and network side equipment
US11936698B2 (en) Systems and methods for adaptive video conferencing
US20230116526A1 (en) Target wake-up time adjusting method, equipment, communication device, wireless access point, target wake-up time adjusting device, and storage medium
CN115002513B (en) Audio and video scheduling method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination