CN117714757A - Code rate adjusting method and device, electronic equipment and storage medium - Google Patents
Code rate adjusting method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117714757A CN117714757A CN202410160084.9A CN202410160084A CN117714757A CN 117714757 A CN117714757 A CN 117714757A CN 202410160084 A CN202410160084 A CN 202410160084A CN 117714757 A CN117714757 A CN 117714757A
- Authority
- CN
- China
- Prior art keywords
- data
- transmission state
- transmission
- state
- code rate
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 75
- 230000005540 biological transmission Effects 0.000 claims abstract description 343
- 239000000872 buffer Substances 0.000 claims description 53
- 230000000903 blocking effect Effects 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 10
- 230000000630 rising effect Effects 0.000 claims description 8
- 230000000694 effects Effects 0.000 abstract description 10
- 238000005070 sampling Methods 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 7
- 238000009499 grossing Methods 0.000 description 6
- 230000002159 abnormal effect Effects 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 4
- 230000003044 adaptive effect Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 230000001174 ascending effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000003828 downregulation Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003827 upregulation Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/266—Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
- H04N21/2662—Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
- H04N21/234381—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
- H04N21/440281—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Communication Control (AREA)
Abstract
The disclosure provides a code rate adjusting method, a device, an electronic device and a storage medium, relates to the field of live broadcast, and is applied to live broadcast push stream transmission, wherein the method mainly comprises the following steps: acquiring transmission state data in preset time, wherein the transmission state data comprises first transmission state data and second transmission state data; determining a current transmission state according to the first transmission state data and the second transmission state data; judging whether the current transmission state meets a preset condition or not to determine an expected transmission state; and adjusting the code rate of the transmission according to the expected transmission state. The method and the device determine the network transmission state by sampling the propagation state data, so that the code rate of the live broadcast plug flow can be dynamically adjusted according to the network transmission state. The method and the device realize code rate self-adaption during live broadcast pushing, thereby ensuring fluency of live broadcast effect.
Description
Technical Field
The disclosure relates to the field of live broadcasting, and in particular relates to a code rate adjusting method, a device, electronic equipment and a storage medium.
Background
When live pushing, the live network often sets a fixed transmission code rate. However, when the live broadcast network is not good, the current transmission data is always discarded to receive the transmission data at the latest moment in real time, so that the fixed transmission code rate will cause a large number of frame loss problems, and the user end is seriously blocked. Therefore, how to utilize a reasonable method to adjust the code rate during live broadcast pushing, thereby ensuring the live broadcast effect is the problem to be solved at present.
Disclosure of Invention
The disclosure provides a code rate adjusting method, a code rate adjusting device, electronic equipment and a storage medium, so as to solve the problems in the related art and improve the live broadcast plug flow effect.
An embodiment of a first aspect of the present disclosure provides a code rate adjustment method applied to live push transmission, where the method includes: acquiring transmission state data in a preset time, wherein the transmission state data comprises first transmission state data and second transmission state data; determining a current transmission state according to the first transmission state data and the second transmission state data; judging whether the current transmission state meets a preset condition or not so as to determine an expected transmission state; and adjusting the code rate of the transmission according to the expected transmission state.
In some embodiments of the present disclosure, acquiring transmission status data within a preset time includes: the method comprises the steps of obtaining the size of a abandoned data frame during transmission, and accumulating the size of the abandoned data frame meeting the preset time as first data; acquiring the size of a successfully transmitted data frame during transmission, and accumulating the size of the successfully transmitted data frame within a preset time as second data; accumulating the first data and the second data, and calculating the ratio of the accumulated value to the preset time to be used as first transmission state data; and calculating the ratio of the second data to the preset time to be used as second transmission state data.
In some embodiments of the present disclosure, obtaining the size of the data frame discarded at the time of transmission includes: receiving a data frame and judging whether the value of the buffer status in the buffer queue exceeds a first threshold value; if the buffer status value does not exceed the first threshold value, receiving the data frame at the current moment to a buffer queue and accumulating the duration of the data frame to the buffer status value; and if the buffer status value exceeds the first threshold value, discarding the data frame at the current moment and recording the size of the discarded data frame.
In some embodiments of the present disclosure, obtaining a data frame size successfully transmitted at the time of transmission, and accumulating the data frame size successfully transmitted within a preset time as second data includes: extracting and transmitting the data frames in the buffer queue; if the transmission is successful, recording the size of the successfully transmitted data frame in transmission, and accumulating the size of the successfully transmitted data frame meeting the preset time as second data.
In some embodiments of the present disclosure, determining the current transmission state from the first transmission state data and the second transmission state data comprises: calculating to obtain a first abandoned data rate according to the first transmission state data and the second transmission state data; the first abandoned data rate is subjected to preset processing to obtain a second abandoned data rate; and determining the current transmission state according to the second abandoned data rate.
In some embodiments of the present disclosure, determining the current transmission state from the second discard data rate comprises: if the second abandoned data rate meets the first preset condition, the current transmission state is a blocking state; if the second abandoned data rate meets a second preset condition, the current transmission state is an idle state.
In some embodiments of the present disclosure, the current transmission state includes a blocked state and an idle state, and determining whether the current transmission state satisfies a preset condition to determine the expected transmission state includes: recording the occurrence times of the current transmission state; if the number of times of continuously generating the blocking state meets a second threshold value, the expected transmission state is a descending state; if the number of consecutive idle states meets the third threshold, the expected transmission state is a rising state.
In some embodiments of the present disclosure, the second threshold is less than the third threshold.
In some embodiments of the present disclosure, adjusting the code rate of the transmission according to the expected transmission state includes: if the expected transmission state is a descending state, the code rate of transmission is adjusted downwards; if the expected transmission state is a rising state, the code rate of the transmission is adjusted upwards.
An embodiment of a second aspect of the present disclosure provides a code rate adjustment device applied to live push transmission, where the device includes: the transmission state data acquisition unit acquires transmission state data in a preset time, wherein the transmission state data comprise first transmission state data and second transmission state data; a first determining unit configured to determine a current transmission state according to the first transmission state data and the second transmission state data; a second determining unit, configured to determine whether the current transmission state meets a preset condition, so as to determine an expected transmission state; and the adjusting unit is used for adjusting the code rate of the transmission according to the expected transmission state.
An embodiment of a third aspect of the present disclosure proposes an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method described in the embodiments of the first aspect of the present disclosure.
An embodiment of a fourth aspect of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the embodiment of the first aspect of the present disclosure.
The code rate adjustment method, the device, the electronic equipment and the storage medium provided by the disclosure are applied to live broadcast push stream transmission and comprise the following steps: acquiring transmission state data in preset time, wherein the transmission state data comprises first transmission state data and second transmission state data; determining a current transmission state according to the first transmission state data and the second transmission state data; judging whether the current transmission state meets a preset condition or not to determine an expected transmission state; and adjusting the code rate of the transmission according to the expected transmission state. The method and the device determine the network transmission state by sampling the propagation state data, so that the transmission code rate of the live push stream can be dynamically adjusted according to the network transmission state. The method and the device realize code rate self-adaption during live broadcast pushing, thereby ensuring fluency of live broadcast effect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation of the disclosure.
Fig. 1 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure;
fig. 6 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure;
fig. 7 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure;
fig. 8 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure;
fig. 9 is a schematic diagram illustrating code rate adjustment according to an embodiment of the present disclosure;
fig. 10 is a block diagram of a code rate adjustment device according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure; the terms "comprising" and "having" and any variations thereof in the description and claims of the present disclosure and in the description of the figures above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present disclosure. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to better understand the present disclosure, a technical solution in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
In the live broadcast field, live broadcast and push flow refers to a process of transmitting data such as picture and sound acquired by a mobile phone or a computer at a host end to a viewer end through the internet after compression and coding. However, when the network environment is poor, the problem of slow data transmission may occur in live push, and the current picture of the anchor may take a long time before appearing on the audience.
And when live broadcast pushing flows, the live broadcast network often sets a fixed transmission code rate. When the network environment is poor, the existing solution is to discard the current push data, and push the current push data from the latest coded data so as to realize the transmission of the latest time data, thereby ensuring the instantaneity of push. However, the method does not consider the situation that the network is continuously deteriorated, and when the network is worse, the fixed transmission code rate aggravates the network blockage, so that the current push data is continuously discarded, the picture delay of the audience end and the anchor end is larger and larger, and various abnormal problems such as sound and picture asynchronization and the like occur.
Therefore, how to utilize a reasonable method to adjust the code rate of live broadcast push stream according to the network state, thereby ensuring the live broadcast effect to be the problem to be solved at present.
In order to solve the problems in the related art, the method and the device determine the network transmission state by sampling the propagation state data, so that the code rate of live broadcast push stream can be dynamically adjusted according to the network transmission state. The method and the device realize code rate self-adaption during live broadcast pushing, thereby ensuring fluency of live broadcast effect.
Fig. 1 is a flowchart of a code rate adjustment method according to an embodiment of the present disclosure. As shown in fig. 1, steps 101-104 are included.
Step 101, acquiring transmission state data in a preset time.
It should be noted here that, in the embodiment of the present disclosure, the acquiring may calculate the acquiring transmission status data according to, but not limited to, real-time data during push stream transmission sampled in a preset time, and the specific acquiring mode is not limited in the present disclosure. The preset time may be 10s, 20 s, or other time, and the preset time may be defined by itself, which is not limited in this disclosure. The transmission status data may include first transmission status data (e.g., a coding rate) and second transmission status data (e.g., a push rate), or may include other data that may be used to determine a push status, and the specific amount and type of transmission status data is not limited in this disclosure.
Step 102, determining the current transmission state according to the first transmission state data and the second transmission state data.
The embodiment of the present disclosure should be described herein, where the current transmission state may include a blocking state when the network is not good and an idle state when the network is stable, and may also include other transmission states, and the specific number and types of the current transmission states may be defined by themselves, which is not limited in the present disclosure.
In addition, when determining the current transmission state, the first transmission state data and the second transmission state data may be used to obtain the abandoning rate of the data during push stream transmission, and the current transmission state is calculated according to the abandoning rate of the data, where the specific determination mode is not limited in the disclosure.
Step 103, judging whether the current transmission state meets the preset condition to determine the expected transmission state.
The embodiment of the present disclosure should be described herein, whether the current transmission state meets the preset condition may be determined whether the number of occurrences of each state in the current transmission state meets the preset number, for example, whether the blocking state in the current transmission state meets 3 times, or whether the idle state in the current transmission state meets 9 times, which is not limited by the specific determination manner and the preset condition. The expected transmission state may be a decreasing state of the coding rate of the expected downlink push stream transmission and an increasing state of the coding rate of the expected uplink push stream transmission, or may be other states, and the specific expected transmission state is not limited in this disclosure.
And 104, adjusting the code rate of the transmission according to the expected transmission state.
It should be noted here that, in the embodiment of the present disclosure, the adjustment is to adjust the coding rate of the transmission up or down according to the expected transmission state, and the specific adjustment mode is not limited in this embodiment of the present disclosure.
In summary, the code rate adjustment method provided by the present disclosure includes: acquiring transmission state data in a preset time, wherein the transmission state data comprises first transmission state data and second transmission state data; determining a current transmission state according to the first transmission state data and the second transmission state data; judging whether the current transmission state meets a preset condition or not so as to determine an expected transmission state; and adjusting the code rate of the transmission according to the expected transmission state. The method and the device determine the network transmission state by sampling the propagation state data, so that the code rate of the live broadcast plug flow can be dynamically adjusted according to the network transmission state. The method and the device realize code rate self-adaption during live broadcast pushing, thereby ensuring fluency of live broadcast effect.
Further, in some embodiments of the present disclosure, when the step 101 is performed to obtain the transmission status data within the preset time, the method may be implemented by, but is not limited to, the following method, specifically as shown in fig. 2, including the following steps:
Step 201, obtaining the size of the abandoned data frame during transmission, and accumulating the size of the abandoned data frame meeting the preset time as the first data.
The embodiment of the disclosure should be described herein that the first data, that is, the sum of the abandoned data frames, shows the situation of the amount of push data abandoned in the preset time. The discarding, i.e. discarding part of the data frame due to network stuck or other reasons during live push, will be chosen. When the size of the abandoned data frame is obtained, the size of the data frame can be recorded according to the frame loss notification returned when the data frame is abandoned, and the specific data frame size obtaining mode is not limited in the disclosure.
For example, if the predetermined time is 10s, and 3 data frames are discarded within 10s, the data frame sizes are 150B, 180B and 230B, respectively, and the first data is 560B.
Step 202, obtaining the size of the successfully transmitted data frame during transmission, and accumulating the size of the successfully transmitted data frame within a preset time as second data.
The embodiment of the present disclosure should be described herein that the second data, that is, the sum of the successfully transmitted data frames, shows the situation of the successfully transmitted push stream data amount within the preset time. The successful transmission may be determined by using a TCP protocol return value during transmission, or may be determined by using other related transmission information, and the specific determination method is not limited in this disclosure. When the size of the successfully transmitted data frame is obtained, the size of the data frame can be recorded according to a success notification returned when the data frame is successfully transmitted, and the specific data frame size obtaining mode is not limited in the disclosure.
For example, if the predetermined time is 10s and 4 data frames are successfully received within 10s, the data frame sizes are 190B, 150B, 280B and 330B, respectively, the second data is 950B.
Step 203, accumulating the first data and the second data, and calculating the ratio of the accumulated value to the preset time as the first transmission status data.
The embodiment of the present disclosure should be described herein that the first transmission state, that is, the encoding rate, shows all data conditions of the push stream after encoding is completed in a unit time, that is, total push stream data total amount conditions in a unit time. The accumulation and the ratio calculation mode may be defined by itself, and the disclosure is not limited.
For example, if the predetermined time is 10s, and the first data calculated as described above is 560B, the second data is 950B, the first transmission status data is 151B/s.
In step 204, a ratio of the second data to the preset time is calculated as the second transmission status data.
The embodiment of the present disclosure should be described herein that the second transmission state is a push rate, which shows the amount of push data successfully transmitted in a unit time. The ratio calculation mode can be defined by itself, and the disclosure is not limited.
For example, if the predetermined time is 10s and the second data calculated as described above is 950B, the second output status data is 95B/s.
According to the embodiment of the disclosure, the first data and the second data are obtained through calculation by obtaining the abandoned data frame size and the successful data frame size, so that the first transmission state and the second transmission state are further obtained through calculation, and the reliability of code rate adjustment is ensured.
Further, in some embodiments of the present disclosure, when step 201 is performed to obtain the size of the data frame that is discarded during transmission, the method may be implemented, but is not limited to, as shown in fig. 3, and includes the following steps:
step 301, receiving a data frame and determining whether a buffer status value in a buffer queue exceeds a first threshold.
The embodiment of the disclosure should be described herein, where the buffer queue is a temporary storage location of push data when the push data is live broadcast, and the buffer status value may be an attribute identifier of the buffer queue, such as a buffer duration. That is, in the judging process, whether the buffer time length exceeds a preset first threshold value can be judged, wherein the first threshold value can be 1s or can be defined by oneself. Specific ways of determining and the first threshold value, embodiments of the present disclosure are not limited in this regard.
Step 302, if the buffer status value does not exceed the first threshold, receiving the data frame at the current time to the buffer queue and accumulating the duration of the data frame to the buffer status value.
The embodiment of the present disclosure should be described herein as indicating that the current network push progress is normal if the buffer status value does not exceed the first threshold, so that the data frame may be continuously received. The duration of the data frame may be obtained according to the encoding process in the push stream process, and the specific obtaining mode is not limited in the disclosure.
Step 303, discarding the data frame at the current time and recording the size of the discarded data frame if the buffer status value exceeds the first threshold.
The embodiment of the disclosure should be described herein, if the value of the buffer status exceeds the first threshold, it is indicated that the current network push progress is slow, so that the new data frame cannot be continuously received, and therefore, the current data frame needs to be abandoned and the size of the data frame needs to be recorded, and the specific manner of recording the size of the data frame is not limited by the disclosure.
According to the embodiment of the disclosure, whether the value of the buffer state in the buffer queue exceeds the first threshold value is judged, so that the size of the abandoned data frame during transmission is obtained, and the accuracy of code rate adjustment is ensured.
Further, in some embodiments of the present disclosure, when step 202 is performed to obtain the size of the successfully transmitted data frame during transmission, and accumulate the size of the successfully transmitted data frame satisfying the preset time period as the second data, the method may be implemented, but is not limited to, the following method, specifically as shown in fig. 4, including the following steps:
step 401, extracting the data frame in the buffer queue and transmitting.
The embodiment of the present disclosure should be described herein, where the extracting, that is, obtaining the data frame buffered by the buffer queue and performing push stream transmission to the network, so as to send the data of the anchor end to the user end, the specific extracting mode is not limited in the present disclosure.
Step 402, if the transmission is successful, recording the size of the successfully transmitted data frame during the transmission, and accumulating the size of the successfully transmitted data frame within a preset time as the second data.
The steps described above for the disclosure are described herein, and are not repeated here. The specific manner in which the size of the successfully transmitted data frame is recorded is not a limitation of the present disclosure.
According to the embodiment of the disclosure, the size of the successfully transmitted data frame is acquired and recorded, the second data is obtained through calculation, and the accuracy of code rate adjustment is ensured.
Further, in some embodiments of the present disclosure, when performing step 102 to determine the current transmission status according to the first transmission status data and the second transmission status data, the method may be implemented, but is not limited to, as shown in fig. 5, and includes the following steps:
step 501, calculating to obtain a first abandoned data rate according to the first transmission state data and the second transmission state data.
The embodiment of the present disclosure should be described herein that the first discarded data rate is a data frame rate of a push failure, that is, a ratio of discarded data frames in push transmission to total transmitted data frames. The first reject rate is calculated from the first transmission state data and the second transmission state data by, but not limited to, passing through the following equation:
wherein,drop_pfor the first rate of loss to be the first,encode_bitratefor the first transmission status data,send_bitrateis the second transmission status data.
Step 502, performing a preset process on the first abandoned data rate to obtain a second abandoned data rate.
The embodiment of the disclosure should be described herein that the preset processing of the second reject rate is to perform smoothing processing on the first reject, so that the obtained smoothing processing method may be a sliding window algorithm, an average value calculation, or other smoothing algorithms, and the disclosure is not limited to specific smoothing algorithms.
Step 503, determining the current transmission state according to the second abandoned data rate.
The embodiment of the present disclosure should be described herein, when determining the current transmission state according to the second abandoned data rate, the current transmission state may be determined by determining whether the second abandoned data rate meets a preset condition, or the current state may be determined by calculating using the second abandoned data rate, where the specific determination mode is not limited in the embodiment of the present disclosure.
According to the embodiment of the disclosure, the first abandoned data rate is calculated through the first state data and the second state data, and the second abandoned data rate is obtained through smoothing processing on the first abandoned data rate, so that the current transmission state is determined by using the second abandoned data rate which is more accurate, and the reliability of code rate adjustment is ensured.
Further, in some embodiments of the present disclosure, when step 503 is performed to determine the current transmission status according to the second abandoned data rate, the method may be implemented, but is not limited to, as shown in fig. 6, and includes the following steps:
in step 601, if the second abandoned data rate satisfies the first preset condition, the current transmission state is the blocking state.
The embodiment of the disclosure should be noted here that the first preset condition may be that the second reject rate is greater than a preset threshold, where the threshold may be 10%, or may be other preset conditions, and the specific preset condition is not limited by the disclosure.
In step 602, if the second abandoned data rate satisfies the second preset condition, the current transmission state is the idle state.
The embodiment of the disclosure should be described herein that the second preset condition may be that the second reject rate is smaller than a preset threshold, where the threshold may be 2%, or may be other preset conditions, and the specific preset condition is not limited by the disclosure.
According to the embodiment of the disclosure, the current speaking state is obtained by judging whether the abandoned rate meets the preset condition, so that the accuracy of code rate adjustment is ensured.
Further, in some embodiments of the present disclosure, when the current transmission state includes a blocking state and an idle state and step 103 is performed to determine whether the current transmission state meets a preset condition to determine an expected transmission state, the method may be implemented, as shown in fig. 7, and includes the following steps:
step 701, recording the number of occurrences of the current transmission state.
The embodiment of the present disclosure should be described herein, where the recording of the number of occurrences of the current transmission state is recording the number of occurrences of the blocking state and the idle state in the current transmission state obtained in the past time period.
For example, if the current transmission state obtained by determining the transmission state data in the past time is [ blocking state, idle state, blocking state, idle state … … ], the occurrence times of the current transmission state and the current transmission state are sequentially recorded [ blocking state 2 times, idle state 1 times, blocking state 1 times, idle state 1 times … … ], the recording mode and the recording format can be defined by themselves, and the recording mode and the recording format can be used, or the recording of the state variable can be used, which is not limited in the embodiments of the present disclosure.
In step 702, if the number of times of continuously occurring blocking states satisfies the second threshold, the expected transmission state is a down state.
It should be noted here that, in the embodiment of the present disclosure, the second threshold may be 3 times, that is, if the number of times of continuously occurring blocking states satisfies 3 times, the expected transmission state is a down state, and the specific second threshold number may be defined by itself, which is not limited by the embodiment of the present disclosure.
In step 703, if the number of times of continuously occurring idle states satisfies the third threshold, the expected transmission state is a rising state.
It should be noted here that, in the embodiment of the present disclosure, the third threshold may be 9 times, that is, if the number of times of continuously occurring idle states satisfies 9 times, the expected transmission state is a rising state, and the specific third threshold number may be defined by itself, which is not limited in the embodiment of the present disclosure.
In addition, when the expected transmission state is judged, the second threshold value is smaller than the third threshold value, namely, when the number of times of continuously generating the blocking state is smaller than the number of times of continuously generating the idle state, the expected transmission state is set to be in a descending state, so that the coding rate of transmission is changed. That is, when abnormal network transmission in a blocking state occurs, the coding rate of transmission is adjusted down more quickly, and when normal network transmission in an idle state occurs, the coding rate of transmission is adjusted up more slowly.
According to the embodiment of the disclosure, the reliability of code rate adjustment is ensured by judging the occurrence times of the past current transmission state.
Further, in some embodiments of the present disclosure, after the expected transmission state is obtained according to the current transmission state, when performing step 104 to adjust the code rate of the transmission according to the expected transmission state, the method may be implemented, but is not limited to, as shown in fig. 8, and includes the following steps:
in step 801, if the expected transmission state is a down state, the code rate of the transmission is adjusted down.
The embodiment of the present disclosure should be described herein, if the expected transmission state is a down state, the code rate of the direct broadcast push stream is adjusted downward, that is, the current code rate of the direct broadcast push stream is adjusted downward, and the embodiment of the present disclosure is not limited by the specific down adjustment mode.
Step 802, if the expected transmission status is a rising status, the code rate of the transmission is adjusted upwards.
The embodiment of the present disclosure should be described herein, if the expected transmission state is an ascending state, the code rate of the direct broadcast push stream is adjusted upwards, that is, the current code rate of the direct broadcast push stream is adjusted upwards, and the embodiment of the present disclosure is not limited in a specific up-adjustment manner.
According to the embodiment of the disclosure, the code rate of transmission is adjusted according to the expected transmission state, so that the reliability of code rate adjustment is ensured.
In summary, the present disclosure determines a network transmission state by sampling propagation state data, so that the code rate of live push stream can be dynamically adjusted according to the network transmission state. The method and the device realize code rate self-adaption during live broadcast pushing, thereby ensuring fluency of live broadcast effect.
The method described in the above figures 1-8 is exemplified below by means of the specific embodiment shown in figure 9.
It should be noted that, the live broadcast plug-flow method often uses a development kit #Software Development Kit, SDK). Plug flowSDKThe development kit is a development kit which encapsulates the live broadcast plug-flow function and mainly comprises an encoding module and a plug-flow module.
In this example, the coding module is responsible for encoding the acquired pictures into a data stream. The pushing module is responsible for receiving and temporarily storing the data encoded by the encoding module and pushing the data to the network. Wherein, the plug flow module mainly comprises a buffer queue module, a circulation thread module and a real-time message transmission protocol # Real Time Messaging Protocol,RTMP) The plug flow module and the code rate self-adapting module are arranged for executing the method. The code rate adjustment method of the present disclosure may be implemented by, but not limited to, the following method, including the steps of:
1) The original data is encoded.
In this embodiment, when live broadcast pushing is performed, the encoding module encodes the collected original data (such as a video picture) according to a preset code rate value, so as to obtain encoded data, and transmits the encoded data to the pushing module.
2) Encode data and buffer and record abandoned data frames.
In this embodiment, after receiving the encoded data, the push module will be passed to its sub-module cache queue module for processing.
Specifically, the buffer queue module stores the encoded data into a buffer queue, and each time the buffer queue buffers a frame of data, the buffer status value of the buffer queue is added with the duration of the data frame at the current time, wherein the duration of the data frame at the current time is obtained by the encoding step. And when the buffer queue module buffers the encoded data, it is determined whether the buffer status value of the current buffer queue is greater than a first threshold (e.g. 1 second). If the value of the caching status is smaller than the first threshold value, caching is normally executed; if the value of the buffer status is greater than the first threshold, the network speed is abnormal, the data frame at the current moment is required to be discarded, and the buffer queue module records the discarded data information and informs the code rate self-adaptive module that the data is discarded. The specific cache processing manner, embodiments of the present disclosure are not limited.
3) And pushing the cached encoded data and recording the successfully transmitted data frames.
In this embodiment, as shown in fig. 9, the loop thread module of the push module takes the encoded data out of the cache queue in the cache queue module in a loop, and delivers the encoded data to the push moduleRTMPThe module performs push flow to the network.
In particular, the method comprises the steps of,RTMPthe module encapsulates the encoded data asRTMPFormat by socket%socket) The coded data is transmitted to the network, and when a frame of data is successfully transmitted, the frame of data information is successfully transmitted data and is informed to the code rate self-adapting module. The specific data push manner, embodiments of the present disclosure are not limited.
4) And acquiring transmission state data according to the data frame record.
In this embodiment, in the adaptive code rate module, when receiving the discard notification from the buffer queue module in step 2, the adaptive code rate module performs cumulative recording on the discarded data frames to obtain first data @, where @ is the first data @drop_size) Receiving step 3RTMPWhen the successful transmission of the module is notified, the data frames successfully transmitted are accumulated and recorded to obtain second data [ ]send_size). The adaptive code rate module performs the above recording within a preset sampling time (e.g., 10 seconds), and the preset sampling time is finished to clear the first data and the second data and re-accumulate at the next preset sampling time.
Specifically, when the transmission state data is acquired, accumulating the first datadrop_size) And second datasend_ size) Calculating the ratio of the accumulated value to the preset time to obtain the rate of the coded data in the time periodencode_ bitrate) As first transmission status data. Calculating the second datasend_size) The ratio of the time to the preset time is used for obtaining the speed of the push flow data in the time periodsend_bitrate) As second transmission status data. The specific transmission status data acquisition mode is not limited by the disclosure.
5) And acquiring the current transmission state and the expected transmission state according to the transmission state data, and adjusting the coding rate of the transmission according to the expected transmission state.
In this embodiment, the abandoned data rate is calculated according to the first transmission state data and the second transmission state data, so as to determine and acquire the current transmission state, and acquire the expected transmission state according to the past current transmission state, so as to adjust the code rate of the live push stream according to the expected transmission state.
Specifically, the first abandon rate is calculated and obtained according to the first transmission state data and the second transmission state datadrop_ p) The following formula can be used, but is not limited to:
wherein,drop_pfor the first rate of loss to be the first,encode_bitratefor the first transmission status data, send_bitrateIs the second transmission status data.
Specifically, the first reject rate is also calculateddrop_p) Smoothing, such as processing according to sliding window algorithm, to obtain a first reject rate based on pastdrop_p) The smoother second reject ratedrop_p_f) Thus preventing the occurrence of abrupt calculation.
Specifically, when judging the current transmission state, when the second reject rate is [ ]drop_p_f) When a preset condition is met, for example, the code rate of the current network which can be pushed is smaller than the code rate of the codes when the preset condition is larger than a preset threshold (for example, 10%), namely, the code rate is required to be reduced when the network is in an abnormal state, and therefore the current transmission state is in a blocking state. When the second reject rate is%drop_p_f) Meeting preset conditions, e.g. less than presetThe threshold (e.g., 2%) indicates that the network is better in normal transmission state, and thus the current transmission state is idle. The present disclosure is not limited to a specific manner of determining the current transmission status.
Specifically, when the expected transmission state is determined, if the current transmission state is the blocking state and a preset frequency threshold (for example, 3 times) appears continuously, the expected transmission state is set to be a descending state, that is, the transmitted coding rate needs to be subjected to down-regulation. If the current transmission state is the idle state, a preset number of times threshold (for example, 9 times) continuously occurs, the expected transmission state is set to the above state, that is, the up-regulation processing (for example, 30% code rate is regulated) is needed to be performed on the transmitted coding rate. The specific expected transmission state determination method is not limited in this disclosure.
Meanwhile, because the slow-start and fast-decline strategies are adopted for code rate adjustment of push stream, when the number of times of continuous occurrence of the blocking state is small, the expected transmission state is set to be the decline state, and when the number of times of continuous occurrence of the normal state is large, the expected transmission state is set to be the rise state, so that timeliness and reliability of code rate adjustment are ensured.
Therefore, the scheme has the following beneficial effects: the scheme obtains the current transmission state based on the sampled transmission state data, so that the expected transmission state is judged according to the current transmission state, and the code rate of live broadcast push stream can be adjusted according to the expected transmission state. The code rate can be adjusted based on the current network live condition, so that the former fixed code rate can be adjusted on one hand, and the live plug flow can be matched with the network real-time state on the other hand, so that the live plug flow has higher correspondence, and the fluency of the live effect is ensured.
Fig. 10 is a block diagram illustrating a code rate adjustment apparatus 1000 according to an embodiment of the present disclosure. As shown in fig. 10, the code rate adjusting apparatus includes:
an acquisition unit 1001 configured to: and acquiring transmission state data in a preset time, wherein the transmission state data comprises first transmission state data and second transmission state data.
The first determining unit 1002 is configured to: and determining the current transmission state according to the first transmission state data and the second transmission state data.
The second determining unit 1003 is configured to: and judging whether the current transmission state meets the preset condition or not so as to determine the expected transmission state.
An adjustment unit 1004 configured to: and adjusting the code rate of the transmission according to the expected transmission state.
In some embodiments of the present disclosure, the acquisition unit 1001 includes:
a first acquisition module configured to: the method comprises the steps of obtaining the size of a abandoned data frame during transmission, and accumulating the size of the abandoned data frame meeting the preset time as first data; and acquiring the size of the successfully transmitted data frame in transmission, and accumulating the size of the successfully transmitted data frame meeting the preset time as second data.
A first computing module configured to: accumulating the first data and the second data, and calculating the ratio of the accumulated value to the preset time to be used as first transmission state data; and calculating the ratio of the second data to the preset time to be used as second transmission state data.
In some embodiments of the present disclosure, the first acquisition module is further configured to:
receiving a data frame and judging whether the value of the buffer status in the buffer queue exceeds a first threshold value; if the buffer status value does not exceed the first threshold value, receiving the data frame at the current moment to a buffer queue and accumulating the duration of the data frame to the buffer status value; and if the buffer status value exceeds the first threshold value, discarding the data frame at the current moment and recording the size of the discarded data frame.
In some embodiments of the present disclosure, the first acquisition module is further configured to:
extracting and transmitting the data frames in the buffer queue; if the transmission is successful, recording the size of the successfully transmitted data frame in transmission, and accumulating the size of the successfully transmitted data frame meeting the preset time as second data.
In some embodiments of the present disclosure, the first determining unit 1002 includes:
a second computing module configured to: and calculating to obtain a first abandoned data rate according to the first transmission state data and the second transmission state data.
A processing module configured to: and carrying out preset processing on the first abandoned data rate to obtain a second abandoned data rate.
A determination module configured to: and determining the current transmission state according to the second abandoned data rate.
In some embodiments of the present disclosure, the determination module is further configured to:
if the second abandoned data rate meets the first preset condition, the current transmission state is a blocking state; if the second abandoned data rate meets a second preset condition, the current transmission state is an idle state.
In some embodiments of the present disclosure, the second determining unit 1003 includes:
a recording module configured to: the number of occurrences of the current transmission state is recorded.
A judgment module configured to: if the number of times of continuously generating the blocking state meets a second threshold value, the expected transmission state is a descending state; if the number of consecutive idle states meets the third threshold, the expected transmission state is a rising state.
In some embodiments of the present disclosure, the second threshold is less than the third threshold.
In some embodiments of the present disclosure, the adjusting unit 1004 includes:
an adjustment module configured to: if the expected transmission state is a descending state, the code rate of transmission is adjusted downwards; if the expected transmission state is a rising state, the code rate of the transmission is adjusted upwards.
In the embodiment of the disclosure, when the code rate is adjusted, transmission state data in a preset time is obtained, wherein the transmission state data comprises first transmission state data and second transmission state data; determining a current transmission state according to the first transmission state data and the second transmission state data; judging whether the current transmission state meets a preset condition or not so as to determine an expected transmission state; and adjusting the code rate of the transmission according to the expected transmission state. The method and the device determine the network transmission state by sampling the propagation state data, so that the code rate of the live broadcast plug flow can be dynamically adjusted according to the network transmission state. The method and the device realize code rate self-adaption during live broadcast pushing, thereby ensuring fluency of live broadcast effect.
In the embodiments provided in the present application, the method and the apparatus provided in the embodiments of the present application are described. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure, a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Some of the functions described above may be implemented in a hardware structure, a software module, or a combination of a hardware structure and a software module.
[ computer Equipment ]
Referring now to FIG. 11, there is illustrated a schematic diagram of a computer device suitable for use in implementing embodiments of the present disclosure. The computer device in the embodiments of the present disclosure is only one example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 11, the electronic device 1100 may include a processing means (e.g., a central processor, a graphics processor, etc.) 1101 for controlling the overall operation of the electronic device. The processing means may comprise one or more processors to execute instructions to perform all or part of the steps of the methods described above. The processing device 1101 may also include one or more modules for processing interactions with other devices.
The storage 1102 is used to store various types of data, and the storage 1102 may be a system, apparatus, or device that includes various types of computer readable storage media, or a combination thereof, such as electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Sensor means 1103 for sensing prescribed measured information and converting it into usable output signals according to a certain law may comprise one or more sensors. For example, it may include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, a temperature sensor, or the like for detecting changes in the on/off state, relative positioning, acceleration/deceleration, temperature, humidity, light, or the like of the electronic apparatus.
The processing means 1101, the storage means 1102 and the sensor means 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
The multimedia device 1106 may include an input device such as a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, etc. for receiving input signals from a user, where various input devices may cooperate with various sensors of the sensor device 1103 to perform gesture operation input, image recognition input, distance detection input, etc.; the multimedia device 1106 may also include output devices, for example, a Liquid Crystal Display (LCD), speakers, vibrators, etc.
The power supply device 1107, which is used to provide power to various devices in the electronic apparatus, may include a power management system, one or more power supplies, and components that distribute power to other devices.
Communication means 1108 may allow electronic device 1100 to communicate wirelessly or by wire with other devices to exchange data.
Each of the above-described devices may also be connected to the I/O interface 1105 to enable application of the electronic apparatus 1100.
While an electronic device having various means is shown in the figures, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via a communications device, or from a storage device. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by a processing device.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
It is noted that the computer readable medium described above in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, python, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of remote computers, the remote computer may be connected to the user computer through any kind of network or may be connected to an external computer (e.g., connected through the internet using an internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
Claims (10)
1. The code rate adjusting method is applied to live broadcast push stream transmission and is characterized by comprising the following steps:
acquiring transmission state data in preset time, wherein the transmission state data comprises first transmission state data and second transmission state data;
determining a current transmission state according to the first transmission state data and the second transmission state data;
judging whether the current transmission state meets a preset condition or not to determine an expected transmission state;
and adjusting the code rate of the transmission according to the expected transmission state.
2. The method of claim 1, wherein the acquiring transmission status data for a preset time comprises:
acquiring the size of a abandoned data frame during transmission, and accumulating the size of the abandoned data frame meeting the preset time as first data;
acquiring the size of a successfully transmitted data frame during transmission, and accumulating the size of the successfully transmitted data frame within the preset time as second data;
accumulating the first data and the second data, and calculating the ratio of the accumulated value to the preset time as the first transmission state data;
and calculating the ratio of the second data to the preset time to be used as the second transmission state data.
3. The method of claim 2, wherein the obtaining the size of the data frame discarded at the time of transmission comprises:
receiving a data frame and judging whether the value of the buffer status in the buffer queue exceeds a first threshold value;
if the buffer status value does not exceed the first threshold value, receiving the data frame at the current moment to the buffer queue and accumulating the duration of the data frame to the buffer status value;
and if the buffer status value exceeds the first threshold value, discarding the data frame at the current moment and recording the size of the discarded data frame.
4. The method of claim 2, wherein the obtaining the data frame size successfully transmitted at the time of transmission and accumulating the data frame size satisfying the successful transmission within the preset time as the second data comprises:
extracting and transmitting the data frames in the buffer queue;
if the transmission is successful, recording the size of the successfully transmitted data frame in the transmission process, and accumulating the size of the successfully transmitted data frame in the preset time as the second data.
5. The method of claim 1, wherein said determining a current transmission state from said first transmission state data and said second transmission state data comprises:
calculating to obtain a first abandoned data rate according to the first transmission state data and the second transmission state data;
performing preset processing on the first abandoned data rate to obtain a second abandoned data rate;
and determining the current transmission state according to the second abandoned data rate.
6. The method of claim 5, wherein said determining a current transmission state from said second discard data rate comprises:
if the second abandoned data rate meets a first preset condition, the current transmission state is a blocking state;
And if the second abandoned data rate meets a second preset condition, the current transmission state is an idle state.
7. The method of claim 1, wherein the current transmission state comprises a blocked state and an idle state, wherein the determining whether the current transmission state meets a preset condition to determine an expected transmission state comprises:
recording the occurrence times of the current transmission state;
if the number of times of continuously appearing the blocking state meets a second threshold value, the expected transmission state is a descending state;
if the number of times of continuously occurring idle states meets a third threshold, the expected transmission state is a rising state, and
wherein the second threshold is less than a third threshold.
8. A code rate adjusting device applied to live push stream transmission, comprising:
the device comprises an acquisition unit, a transmission control unit and a control unit, wherein the acquisition unit is used for acquiring transmission state data in preset time, and the transmission state data comprises first transmission state data and second transmission state data;
a first determining unit, configured to determine a current transmission state according to the first transmission state data and the second transmission state data;
a second determining unit, configured to determine whether the current transmission state meets a preset condition, so as to determine an expected transmission state;
And the adjusting unit is used for adjusting the code rate of the transmission according to the expected transmission state.
9. A computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the method of any of claims 1-7 when the computer program is executed.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the method according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410160084.9A CN117714757A (en) | 2024-02-04 | 2024-02-04 | Code rate adjusting method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410160084.9A CN117714757A (en) | 2024-02-04 | 2024-02-04 | Code rate adjusting method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117714757A true CN117714757A (en) | 2024-03-15 |
Family
ID=90151932
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410160084.9A Pending CN117714757A (en) | 2024-02-04 | 2024-02-04 | Code rate adjusting method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117714757A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101938400A (en) * | 2009-06-30 | 2011-01-05 | 华为技术有限公司 | Network congestion control method and device |
CN104349219A (en) * | 2013-07-29 | 2015-02-11 | 中国科学院大学 | Strict increase loose decrease equal step congestion control algorithm based on mobile communication network |
US20180060650A1 (en) * | 2016-08-26 | 2018-03-01 | International Business Machines Corporation | Adapting physical activities and exercises based on facial analysis by image processing |
CN111400206A (en) * | 2020-03-13 | 2020-07-10 | 西安电子科技大学 | Cache management method based on dynamic virtual threshold |
CN113099310A (en) * | 2021-04-08 | 2021-07-09 | 李蕊男 | Real-time media internal video and audio coordination method based on android platform |
-
2024
- 2024-02-04 CN CN202410160084.9A patent/CN117714757A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101938400A (en) * | 2009-06-30 | 2011-01-05 | 华为技术有限公司 | Network congestion control method and device |
CN104349219A (en) * | 2013-07-29 | 2015-02-11 | 中国科学院大学 | Strict increase loose decrease equal step congestion control algorithm based on mobile communication network |
US20180060650A1 (en) * | 2016-08-26 | 2018-03-01 | International Business Machines Corporation | Adapting physical activities and exercises based on facial analysis by image processing |
CN111400206A (en) * | 2020-03-13 | 2020-07-10 | 西安电子科技大学 | Cache management method based on dynamic virtual threshold |
CN113099310A (en) * | 2021-04-08 | 2021-07-09 | 李蕊男 | Real-time media internal video and audio coordination method based on android platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3840390A1 (en) | Method and device for controlling video transcoding code rate | |
CN111225209B (en) | Video data plug flow method, device, terminal and storage medium | |
CN113497792B (en) | Audio and video communication method, terminal, server, computer equipment and storage medium | |
CN113115067A (en) | Live broadcast system, video processing method and related device | |
CN107295395A (en) | Code check adaptive regulation method, device and electronic equipment | |
CN109819322A (en) | Video transmission method, device, computer readable storage medium and electronic equipment | |
CN113170214A (en) | Method for automatically adjusting live video code rate, video transmission device and server | |
CN111768790B (en) | Method and device for transmitting voice data | |
CN111385576B (en) | Video coding method and device, mobile terminal and storage medium | |
CN114222194A (en) | Video code stream adjusting method, device and system | |
CN113992967A (en) | Screen projection data transmission method and device, electronic equipment and storage medium | |
CN115834918B (en) | Video live broadcast method and device, electronic equipment and readable storage medium | |
CN112954354B (en) | Video transcoding method, device, equipment and medium | |
CN112995776B (en) | Method, device, equipment and storage medium for determining screen capture frame rate of shared screen content | |
CN111385574B (en) | Code rate control method and device in video coding, mobile terminal and storage medium | |
CN112860513A (en) | Application non-response monitoring method, device, equipment and storage medium | |
CN114679607A (en) | Video frame rate control method and device, electronic equipment and storage medium | |
CN115103210A (en) | Information processing method, device, terminal and storage medium | |
CN118138776A (en) | Video coding method, device, equipment and storage medium | |
CN114786055A (en) | Preloading method, preloading device, electronic equipment and medium | |
CN118118628A (en) | Monitoring video adjustment method, device, electronic equipment and computer readable medium | |
CN114257870A (en) | Short video playing method, device, equipment and storage medium | |
CN109618198A (en) | Live content reports method and device, storage medium, electronic equipment | |
CN117714757A (en) | Code rate adjusting method and device, electronic equipment and storage medium | |
US9350796B2 (en) | Method and device for receiving multimedia data |
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 |