A method and system for adaptive bit rate of SRT streaming

By monitoring the statistical information of the SRT protocol stack, it automatically adjusts the output bit rate of the video encoder, solving the congestion problem of the SRT protocol when the network deteriorates, and ensuring video data integrity and network stability.

CN113965752BActive Publication Date: 2024-09-17MICRO DREAM TECHTRONIC NETWORK TECH CHINACO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111136136.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-27
Publication Date
2024-09-17
Estimated Expiration
2041-09-27

AI Technical Summary

Technical Problem

The SRT protocol lacks congestion control when the network deteriorates, causing packet retransmission to increase network congestion and incomplete video data, causing screen blur.

Method used

By monitoring the statistical information of the SRT protocol stack, it periodically collects and analyzes network status variables, and automatically adjusts the output bit rate of the video encoder to adapt to network changes and avoid network congestion.

Benefits of technology

It is possible to monitor the network status and automatically adjust the bit rate without modifying the SRT protocol stack to avoid network congestion and ensure video data integrity. It is suitable for SRT streaming environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113965752B
    Figure CN113965752B
Patent Text Reader

Abstract

The embodiment of the present invention provides an SRT streaming bitrate adaptive method and system, including: compressing and encoding the original audio and video data and outputting it at a set output bitrate; receiving the compressed and encoded audio and video data through the SRT protocol stack and encapsulating it into an SRT protocol message; periodically collecting the basic state information generated by the SRT protocol stack in the process of streaming the SRT protocol message; according to the basic state information, calculating and analyzing the network state variables of the streaming network where the SRT protocol message of each period is located, and obtaining the network state of each periodic streaming network; and analyzing the network state change trend of the streaming network according to the network state of multiple periodic streaming networks; according to the network state change trend, configuring a new output bitrate for outputting the original audio and video data after compression and encoding. Monitor network state changes based on the statistical information of the SRT protocol stack; automatically adjust the output bitrate of the video encoder to avoid network congestion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of streaming media, and in particular to an SRT streaming bit rate adaptive method and system. Background Art

[0002] When live streaming, SRT is used as the live streaming protocol. However, using SRT as the live streaming protocol has the following disadvantages: there is no congestion control. When the network deteriorates and packets are lost, it is hoped that more packets will be resent to make up for the loss. However, sending more packets will increase the sending rate, which will make the network more congested and cause further deterioration of the network. The SRT protocol allows data to be discarded. When data cannot be sent immediately, the data will be discarded, making the video data incomplete and causing a distorted screen. Summary of the invention

[0003] The embodiment of the present invention provides an SRT streaming bitrate adaptation method and system, which monitors changes in network status based only on statistical information of the SRT protocol stack; automatically adjusts the output bitrate of the video encoder, calculates a suitable bitrate to adapt to network changes, and avoids network congestion.

[0004] To achieve the above-mentioned purpose, on the one hand, an embodiment of the present invention provides an SRT streaming bitrate adaptation method, including:

[0005] After compressing and encoding the original audio and video data, it is output according to the set output bit rate;

[0006] The compressed and encoded audio and video data is received through the SRT protocol stack and encapsulated into an SRT protocol message, and the SRT protocol stack is pushed to the server; wherein the SRT protocol stack complies with the transmission protocol SRT specification;

[0007] Periodically collect basic status information generated by the SRT protocol stack during the process of streaming SRT protocol messages;

[0008] According to the basic status information of the SRT protocol stack in each period during the process of streaming the SRT protocol message, the network status variables of the streaming network where the SRT protocol message of each period is located are calculated; the network status variables of the streaming network where the SRT protocol message of each period is located are analyzed to obtain the network status of the streaming network where the SRT protocol message of each period is located; and according to the network status of the streaming network where the SRT protocol message of multiple periods is located, the network status change trend of the streaming network where the SRT protocol message is located is analyzed;

[0009] Configure a new output bitrate for compressing and encoding original audio and video data for output based on the network status change trend of the streaming network where the SRT protocol packets are located.

[0010] On the other hand, an embodiment of the present invention provides an SRT streaming bitrate adaptive system, including:

[0011] Video encoder, used to compress and encode the original audio and video data and output it according to the set output bit rate;

[0012] A streaming unit, used to receive compressed and encoded audio and video data through an SRT protocol stack, encapsulate the data into an SRT protocol message, and stream the data to a server; wherein the SRT protocol stack complies with the SRT specification of the transmission protocol;

[0013] The SRT state collection unit is used to periodically collect basic state information generated by the SRT protocol stack during the process of streaming SRT protocol messages; based on the basic state information of the SRT protocol stack during the process of streaming SRT protocol messages in each period, calculate the network state variables of the streaming network where the SRT protocol messages of each period are located;

[0014] The bit rate adjustment unit is used to analyze the network state variables of the streaming network where the SRT protocol message of each period is located, and obtain the network state of the streaming network where the SRT protocol message of each period is located; and according to the network state of the streaming network where the SRT protocol message of multiple periods is located, analyze the network state change trend of the streaming network where the SRT protocol message is located; according to the network state change trend of the streaming network where the SRT protocol message is located, configure a new output bit rate for compressing and encoding the original audio and video data for output.

[0015] The above technical solution has the following beneficial effects: it can monitor changes in network status based only on the statistical information of the SRT protocol stack without modifying the SRT protocol stack; it can automatically adjust the output bit rate of the video encoder and calculate the appropriate bit rate to adapt to network changes, thereby avoiding network congestion. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 This is a flow chart of an SRT streaming bitrate adaptation method according to an embodiment of the present invention;

[0018] Figure 2 This is a result diagram of an SRT streaming bitrate adaptive system according to an embodiment of the present invention;

[0019] Figure 3It is a schematic diagram of an SRT streaming bitrate adaptive streaming system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] like Figure 1 As shown, the present invention provides an SRT streaming bit rate adaptive method, comprising:

[0022] S101: compressing and encoding the original audio and video data and outputting them at a set output bit rate;

[0023] S102: receiving compressed and encoded audio and video data through the SRT protocol stack, encapsulating the data into an SRT protocol message, and streaming the data to the server; wherein the SRT protocol stack complies with the transmission protocol SRT specification;

[0024] S103: periodically collect basic status information generated by the SRT protocol stack during the process of streaming SRT protocol messages; calculate the network state variables of the streaming network where the SRT protocol messages of each period are located according to the basic status information of the SRT protocol stack during the process of streaming SRT protocol messages of each period;

[0025] S104: Analyze the network status variables of the streaming network where the SRT protocol message of each period is located to obtain the network status of the streaming network where the SRT protocol message of each period is located; and analyze the network status change trend of the streaming network where the SRT protocol message is located based on the network status of the streaming network where the SRT protocol message of multiple periods is located; and configure a new output bit rate for compressing and encoding the original audio and video data for output based on the network status change trend of the streaming network where the SRT protocol message is located.

[0026] Preferably, the basic status information in the process of streaming SRT protocol messages includes: the number of sent messages, the number of discarded messages, the number of retransmitted messages, and information used to calculate the round-trip time RTT of message sending;

[0027] The network status variables of the streaming network where the SRT protocol message is located include: the proportion of retransmitted messages, the proportion of discarded messages, and the change trend of RTT, where:

[0028] The retransmission message ratio is the ratio of the number of retransmission messages to the number of sent messages in one cycle;

[0029] The discarded message ratio is the ratio of the number of discarded messages to the number of sent messages in a cycle;

[0030] The change trend of the RTT is predicted by the RTT difference between two adjacent cycles, and the RTT difference refers to the change between the RTT of two adjacent cycles; when the RTT difference is greater than 0, it indicates that the change of RTT is on an upward trend; when the RTT difference is less than 0, it indicates that the change of RTT is on a downward trend; when the RTT difference is equal to 0, it indicates that the RTT remains unchanged.

[0031] Preferably, in step 104, the network state variables of the streaming network where each periodic SRT protocol message is located are analyzed to obtain the network state of the streaming network where each periodic SRT protocol message is located, specifically including:

[0032] S1041: for each period, compare each network state variable of the streaming network where the SRT protocol message is located with its corresponding threshold, and determine the network state of the streaming network in the current period according to the comparison result;

[0033] When any network state variable of the streaming network where the SRT protocol message is located is greater than its corresponding upper threshold, it means that the network state of the streaming network where the SRT protocol message is located in this period is poor;

[0034] When all network status variables of the streaming network where the SRT protocol message is located are less than their corresponding lower thresholds, it means that the network status of the streaming network where the SRT protocol message is located in this period is good;

[0035] When all network status variables of the streaming network where the SRT protocol message is located are not greater than their respective upper threshold limits and not less than their respective lower threshold limits, it indicates that the network status of the streaming network where the SRT protocol message is located in this period is stable;

[0036] The analyzing, according to the network status of the streaming network where the SRT protocol packets are located in multiple periods, the change trend of the network status of the streaming network where the SRT protocol packets are located specifically includes:

[0037] S1042: Count the number of various network states of the streaming network where the SRT protocol packets are located in multiple cycles, and determine the network state change trend of the streaming network where the SRT protocol packets are located according to the number of various network states in each cycle, where the number of network states includes: the number of poor network states, the number of stable network states, and the number of good network states;

[0038] When the number of poor network states is greater than the number of stable network states, and the number of good network states is 0, it is determined that the trend of the network state of the streaming network where the SRT protocol message is located is getting worse;

[0039] When the number of good network states is greater than the number of stable network states, and the number of poor network states is 0, it is determined that the trend of the network state of the streaming network where the SRT protocol message is located is improving;

[0040] Otherwise, it is determined that the trend of the network status of the streaming network where the SRT protocol message is located is stable.

[0041] Preferably, in step 104, configuring a new output bit rate for outputting the original audio and video data after compressing and encoding the data according to the network status change trend of the streaming network where the SRT protocol message is located specifically includes:

[0042] S1043: When the network status of the streaming network where the SRT protocol message is located deteriorates, a new output bit rate is obtained by compressing and encoding the original audio and video data and outputting the new output bit rate by reducing the bit rate, wherein the new output bit rate is the product of the current bit rate and the reduction coefficient;

[0043] S1044: When the network status of the streaming network where the SRT protocol message is located becomes better, a new output bit rate is obtained by increasing the bit rate to compress and encode the original audio and video data for output, where the new output bit rate is the product of the current bit rate and the increase coefficient;

[0044] S1045: When the trend of the network status of the streaming network where the SRT protocol message is located is stable, the current bit rate is maintained.

[0045] Preferably, it also includes:

[0046] S105: adjusting the length of the collection cycle of basic status information generated by the SRT protocol stack during the streaming SRT protocol message process, configuring the sensitivity of perceiving changes in the network status of the streaming network, and / or,

[0047] S106: Adjust the corresponding thresholds of each network state variable of the streaming network where the SRT protocol message is located, and configure the sensitivity of sensing the network state change of the streaming network.

[0048] like Figure 2 As shown, in combination with an embodiment of the present invention, a SRT streaming bitrate adaptive system is provided, including:

[0049] The video encoder 21 is used to compress and encode the original audio and video data and output it according to the set output bit rate;

[0050] The streaming unit 22 is used to receive the compressed and encoded audio and video data through the SRT protocol stack, encapsulate it into an SRT protocol message, and stream it to the server; wherein the SRT protocol stack complies with the transmission protocol SRT specification;

[0051] The SRT state collection unit 23 is used to periodically collect the basic state information generated by the SRT protocol stack during the process of streaming SRT protocol messages; according to the basic state information of the SRT protocol stack during the process of streaming SRT protocol messages in each period, calculate the network state variables of the streaming network where the SRT protocol messages of each period are located;

[0052] The bit rate adjustment unit 24 is used to analyze the network state variables of the streaming network where the SRT protocol message of each period is located, and obtain the network state of the streaming network where the SRT protocol message of each period is located; and according to the network state of the streaming network where the SRT protocol message of multiple periods is located, analyze the network state change trend of the streaming network where the SRT protocol message is located; according to the network state change trend of the streaming network where the SRT protocol message is located, configure a new output bit rate for compressing and encoding the original audio and video data for output.

[0053] Preferably, the basic status information in the process of streaming SRT protocol messages includes: the number of sent messages, the number of discarded messages, the number of retransmitted messages, and information used to calculate the round-trip time RTT of message sending;

[0054] The network status variables of the streaming network where the SRT protocol message is located include: the proportion of retransmitted messages, the proportion of discarded messages, and the change trend of RTT, where:

[0055] The retransmission message ratio is the ratio of the number of retransmission messages to the number of sent messages in the period;

[0056] The discarded message ratio is the ratio of the number of discarded messages to the number of sent messages in the period;

[0057] The change trend of the RTT is predicted by the RTT difference between two adjacent cycles, and the RTT difference refers to the change between the RTT of two adjacent cycles; when the RTT difference is greater than 0, it indicates that the change of RTT is on an upward trend; when the RTT difference is less than 0, it indicates that the change of RTT is on a downward trend; when the RTT difference is equal to 0, it indicates that the RTT remains unchanged.

[0058] Preferably, the bit rate adjustment unit 24 includes:

[0059] The current network status judgment subunit 241 is used to compare each network status variable of the streaming network where the SRT protocol message is located in each period with the respective corresponding threshold value, and determine the network status of the streaming network in the current period according to the comparison result;

[0060] When any network state variable of the streaming network where the SRT protocol message is located is greater than its corresponding upper threshold, it means that the network state of the streaming network where the SRT protocol message is located in this period is poor;

[0061] When all network status variables of the streaming network where the SRT protocol message is located are less than their corresponding lower thresholds, it means that the network status of the streaming network where the SRT protocol message is located in this period is good;

[0062] When all network status variables of the streaming network where the SRT protocol message is located are not greater than their respective upper threshold limits and not less than their respective lower threshold limits, it indicates that the network status of the streaming network where the SRT protocol message is located in this period is stable;

[0063] The network status trend judgment subunit 242 is used to count the number of various network statuses of the streaming network where the SRT protocol packets are located in multiple cycles, and judge the network status change trend of the streaming network where the SRT protocol packets are located according to the number of various network statuses in each cycle, wherein the number of network statuses includes: the number of poor network statuses, the number of stable network statuses, and the number of good network statuses;

[0064] When the number of poor network states is greater than the number of stable network states, and the number of good network states is 0, it is determined that the trend of the network state of the streaming network where the SRT protocol message is located is getting worse;

[0065] When the number of good network states is greater than the number of stable network states, and the number of poor network states is 0, it is determined that the trend of the network state of the streaming network where the SRT protocol message is located is improving;

[0066] Otherwise, it is determined that the trend of the network status of the streaming network where the SRT protocol message is located is stable.

[0067] Preferably, the bit rate adjustment unit 24 further includes:

[0068] The bit rate controller 243 is used to obtain a new output bit rate for compressing and encoding the original audio and video data and outputting it by reducing the bit rate when the network status of the streaming network where the SRT protocol message is located deteriorates, wherein the new output bit rate is the product of the current bit rate and the reduction coefficient;

[0069] When the network status of the streaming network where the SRT protocol message is located becomes better, the new output bit rate is obtained by increasing the bit rate to compress and encode the original audio and video data for output, and the new output bit rate is the product of the current bit rate and the increase coefficient;

[0070] When the network status of the streaming network where the SRT protocol message is located is stable, the current bit rate is maintained.

[0071] Preferably, the SRT state acquisition unit 23 includes a period adjustment subunit 231, and / or the current network state determination subunit 241 includes a threshold adjustment module 241-1, wherein:

[0072] The period adjustment subunit 231 is used to adjust the collection period length of the basic status information generated by the SRT protocol stack during the streaming SRT protocol message process, and configure the sensitivity of the perception of the network status change of the streaming network;

[0073] The threshold adjustment module 241 - 1 is used to adjust the corresponding thresholds of each network state variable of the streaming network where the SRT protocol message is located, and configure the sensitivity of sensing the network state change of the streaming network.

[0074] The beneficial effects achieved by the present invention are as follows:

[0075] This technical solution realizes the separation of the streaming process and the bitrate adaptation process. The bitrate adaptation function can be turned on and off at any time as needed. The sensitivity to changes in network status can be configured, and the frequency of automatic bitrate adjustment can be configured. It can track network changes, automatically calculate the appropriate bitrate, and adjust the output bitrate of the video encoder: it can reduce the bitrate when the network deteriorates and increase the bitrate when the network recovers. It is completely suitable for SRT streaming without modifying the implementation of the SRT stack. It solves the problem of more serious network congestion caused by a large number of retransmissions in a weak network environment.

[0076] The above technical solution of the embodiment of the present invention is described in detail below in conjunction with specific application examples. For technical details not introduced during the implementation process, please refer to the relevant description in the previous text.

[0077] The abbreviations and key terms used in the present invention are defined as follows:

[0078] Live video streaming: Using the Internet to transmit real-time audio and video data, people can watch the ongoing live events remotely through the Internet.

[0079] Streaming: The process of sending video data stream from the client (such as a mobile app) to the server.

[0080] Streaming protocol: It is a communication agreement between the client and the server. The server parses the received video data according to the agreed data format.

[0081] SRT: Secure Reliable Transport is an open source video transmission protocol.

[0082] SRT protocol stack: is a specific code implementation that complies with the SRT protocol specification.

[0083] Video encoder: compresses and encodes the original video images to reduce the amount of data for easy storage and transmission.

[0084] Message: A data block encapsulated in the SRT protocol format. A complete frame of video encoding data will be divided into multiple messages for transmission.

[0085] RTT: Round Trip Time, which refers to the time it takes for the sender to send data and receive a response.

[0086] Bit rate: the number of bits transmitted per second. The higher the bit rate, the larger the amount of data.

[0087] Send rate: the number of bits sent per second. The higher the rate, the more network bandwidth is occupied.

[0088] Bitrate Adaptation: A method that can monitor the network status and automatically adjust the output bitrate of the video encoder to adapt to changes in network status. When the network is poor, the bitrate is reduced, and when the network recovers, the bitrate is increased.

[0089] Bit rate adaptation module: is a code module that implements the bit rate adaptation method.

[0090] When live streaming, the queue control method of "judging the network status based on the amount of data accumulated in the sending queue" is not applicable. This method cannot be applied to SRT because SRT allows discarding and there will be no accumulation in the sending queue.

[0091] The adaptive method of sending rate is also applicable to live streaming, because the adaptive method of sending rate is to judge the network status according to the current sending rate. However, SRT does not have congestion control, and a poor network will increase the sending rate. Therefore, this method is not applicable to SRT.

[0092] The present invention is a method for adaptively adjusting the bit rate of SRT streaming based on statistics. The method can monitor changes in network status based on the statistical information of the SRT protocol stack only without modifying the SRT protocol stack. The method can automatically adjust the output bit rate of the video encoder and calculate a suitable bit rate to adapt to network changes, thereby avoiding network congestion and reasonably occupying bandwidth.

[0093] The principle diagram of the technical solution of the present invention is as follows Figure 3 As shown, the streaming system of the present invention specifically includes the following equipment:

[0094] Camera: Video capture device, responsible for passing the captured video images to the video encoder for encoding.

[0095] Video encoder: Receives image data from the camera, compresses and encodes the image according to the set bit rate, and passes it to the SRT protocol stack.

[0096] SRT protocol stack: receives video encoding data from the video encoder, encapsulates the data into SRT protocol packets, and then sends them to the server through the network.

[0097] Server: Receives SRT protocol messages from the network, parses the messages, restores them to video encoding data, and then performs subsequent processing.

[0098] SRT status collection: Regularly (periodically) collect the basic status information of the SRT protocol stack during transmission (such as sending rate (monitoring use), number of sent messages, number of discarded messages, etc.), and then pass the collected basic status information to the statistical filter for analysis.

[0099] Statistical filter: Receives basic status information from SRT statistics, performs analysis and filtering, calculates the statistical information required for network status judgment, that is, the variables for judging the network status of the SRT protocol message, such as: the proportion of retransmitted messages, the proportion of discarded messages, the RTT change trend, etc., and then passes the statistical information required for network status judgment to the network status filter to analyze the current network status. Among them, the round-trip time RTT refers to the time from sending data to receiving a response. The RTT change trend is predicted by the difference in RTT, indicating the change in adjacent RTTs. The difference > 0 indicates an increase in RTT; the difference < 0 indicates a decrease in RTT. The RTT change trend over a period of time is represented by accumulating the RTT difference over a period of time.

[0100] Network status filter: Receives statistical information from the statistical filter for network status judgment and analyzes the current network status. The specific steps for analyzing the current network status are:

[0101] First, the statistical filter has counted the state variables used to determine the current network state (such as the proportion of retransmitted messages, the proportion of discarded messages, and the RTT change trend).

[0102] Then, the variables in the current cycle (network status variables of the streaming network where the SRT protocol message is located) are compared with the corresponding thresholds to determine the current network status:

[0103] (1) When any variable > the maximum threshold (upper threshold), it indicates that the network status is poor.

[0104] For example, if the RTT cumulative difference is greater than the maximum RTT trend threshold, it means that the network delay is large;

[0105] (2) When all variables are less than the minimum threshold (lower threshold), it means that the network status is good.

[0106] For example, if the RTT cumulative difference is less than the minimum RTT trend threshold, it means that the network delay is small.

[0107] (3) Maximum threshold >= all variables <= minimum threshold, indicating that the network status is stable.

[0108] After analyzing the network status of the current cycle, record each network status of the cycle as a sample and accumulate the network status samples for a period of time (multiple cycles, such as 5-10 cycles). Calculate and determine the trend of network status changes during this period: (1) If the number of poor network statuses is greater than the number of stable network statuses, and the number of good network statuses is 0, then the trend of the network status is considered to be getting worse. (2) If the number of good network statuses is greater than the number of stable network statuses, and the number of poor network statuses is 0, then the trend of the network status is considered to be getting better. (3) If the above conditions are not met, the trend of the network is stable.

[0109] After calculating and determining the trend of network status changes, rate adjustment suggestions are given (such as: increase, maintain, reduce, etc.), and then passed to the rate controller. The basis for giving rate adjustment suggestions is: the basis is the trend of network status changes: if the trend gets worse, the rate is reduced; if the trend gets better, the rate is increased; if the trend is stable, the rate is maintained. Rate controller: receives adjustment suggestions from the network status filter, and calculates the appropriate rate based on the suggestions. When the rate is reduced: the new rate = current rate * reduction coefficient; when the rate is increased: the new rate = current rate * increase coefficient; if the recommended rate is maintained, the rate remains unchanged; then the output rate of the video encoder is configured according to the new rate. This achieves the purpose of automatically adapting the rate to network changes. A complete streaming process is as follows:

[0110] The camera continuously captures images frame by frame, then compresses and encodes each frame through a video encoder, encapsulates the video encoding into an SRT message through the SRT protocol stack, and finally sends it to the server through the network.

[0111] During the streaming process, the bitrate adaptation module periodically collects status information transmitted by the SRT protocol stack. The statistical filter filters out statistical information for network status monitoring (statistical information required for network status judgment), and hands it over to the network status filter to analyze the network change trend and give bitrate adjustment suggestions. The bitrate controller calculates the appropriate bitrate based on the suggestions to adjust the output bitrate of the video encoder.

[0112] Finally, without modifying the SRT protocol stack, an SRT streaming was implemented that can automatically adapt to network changes.

[0113] In addition, you can configure the sensitivity of network status changes as follows:

[0114] (1)Configurable network status check interval

[0115] The smaller the time interval, the faster the response to network status changes; the larger the interval, the slower the response to network status changes.

[0116] (2) Configurable thresholds for each state variable

[0117] For example, the maximum RTT trend threshold, the larger the value, the lower the sensitivity to the increase of network delay; the smaller the value, the higher the sensitivity to the increase of network delay.

[0118] Minimum RTT trend threshold. The larger the value, the higher the sensitivity to network delay reduction; the larger the value, the lower the sensitivity to network delay reduction.

[0119] In summary, this technical solution realizes the separation of the push streaming process and the bitrate adaptation process, and the bitrate adaptation function can be turned on and off at any time as needed. It is completely suitable for SRT push streaming, without modifying the implementation of the SRT protocol stack, and based on the statistical information of the SRT protocol stack, it realizes network status monitoring and automatic bitrate adjustment to adapt to network changes.

[0120] The beneficial effects achieved by the present invention are as follows:

[0121] This technical solution realizes the separation of the streaming process and the bitrate adaptation process. The bitrate adaptation function can be turned on and off at any time as needed. The sensitivity to changes in network status can be configured, and the frequency of automatic bitrate adjustment can be configured. It can track network changes, automatically calculate the appropriate bitrate, and adjust the output bitrate of the video encoder: it can reduce the bitrate when the network deteriorates and increase the bitrate when the network recovers. It is completely suitable for SRT streaming without modifying the implementation of the SRT stack. It solves the problem of more serious network congestion caused by a large number of retransmissions in a weak network environment.

[0122] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.

[0123] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

[0124] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.

[0125] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".

[0126] Those skilled in the art may also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units, and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present invention.

[0127] The various illustrative logic blocks or units described in the embodiments of the present invention can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of the above. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0128] The steps of the method or algorithm described in the embodiments of the present invention can be directly embedded in hardware, a software module executed by a processor, or a combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.

[0129] In one or more exemplary designs, the above functions described in the embodiments of the present invention can be implemented in hardware, software, firmware or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium, or transmitted in the form of one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by any general or special computer. For example, such computer-readable media can include but are not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program codes in the form of instructions or data structures and other forms that can be read by general or special computers, or general or special processors. In addition, any connection can be appropriately defined as a computer-readable medium, for example, if the software is transmitted from a website site, server or other remote resource through a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disk and disc include compact disk, laser disk, optical disk, DVD, floppy disk and blue-ray disk. Disks usually copy data magnetically, while discs usually copy data optically with lasers. The above combination can also be included in computer readable media.

[0130] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for adaptive bit rate of SRT streaming, characterized in that: include: After compressing and encoding the original audio and video data, it is output according to the set output bit rate; The compressed and encoded audio and video data is received through the SRT protocol stack and encapsulated into an SRT protocol message, and the SRT protocol stack is pushed to the server; wherein the SRT protocol stack complies with the transmission protocol SRT specification; Periodically collect basic status information generated by the SRT protocol stack during the process of streaming SRT protocol messages; According to the basic status information of the SRT protocol stack in each period during the process of streaming the SRT protocol message, the network status variables of the streaming network where the SRT protocol message of each period is located are calculated; the network status variables of the streaming network where the SRT protocol message of each period is located are analyzed to obtain the network status of the streaming network where the SRT protocol message of each period is located; and according to the network status of the streaming network where the SRT protocol message of multiple periods is located, the network status change trend of the streaming network where the SRT protocol message is located is analyzed; According to the network status change trend of the streaming network where the SRT protocol message is located, configure the new output bit rate for compressing and encoding the original audio and video data for output; The basic status information in the process of streaming SRT protocol messages includes: the number of sent messages, the number of discarded messages, the number of retransmitted messages, and information used to calculate the round-trip time RTT of message sending; The network status variables of the streaming network where the SRT protocol message is located include: the proportion of retransmitted messages, the proportion of discarded messages, and the change trend of RTT, where: The retransmission message ratio is the ratio of the number of retransmission messages to the number of sent messages in one cycle; The discarded message ratio is the ratio of the number of discarded messages to the number of sent messages in a cycle; The change trend of the RTT is predicted by the RTT difference between two adjacent cycles, and the RTT difference refers to the change between the RTTs of two adjacent cycles; when the RTT difference is greater than 0, it indicates that the change of the RTT is on the rise; when the RTT difference is less than 0, it indicates that the change of the RTT is on the decline; when the RTT difference is equal to 0, it indicates that the RTT remains unchanged; The analyzing of the network state variables of the streaming network where each periodic SRT protocol message is located to obtain the network state of the streaming network where each periodic SRT protocol message is located specifically includes: For the network state variables of the streaming network where the SRT protocol message is located in each period, each network state variable is compared with its corresponding threshold value, and the network state of the streaming network in the current period is determined according to the comparison result; When any network state variable of the streaming network where the SRT protocol message is located is greater than its corresponding upper threshold, it means that the network state of the streaming network where the SRT protocol message is located in this period is poor; When all network status variables of the streaming network where the SRT protocol message is located are less than their corresponding lower thresholds, it means that the network status of the streaming network where the SRT protocol message is located in this period is good; When all network status variables of the streaming network where the SRT protocol message is located are not greater than their respective upper threshold limits and not less than their respective lower threshold limits, it indicates that the network status of the streaming network where the SRT protocol message is located in this period is stable; The analyzing, according to the network status of the streaming network where the SRT protocol packets are located in multiple periods, the change trend of the network status of the streaming network where the SRT protocol packets are located specifically includes: Count the number of various network states of the streaming network where the SRT protocol packets are located in multiple cycles, and determine the network state change trend of the streaming network where the SRT protocol packets are located according to the number of various network states in each cycle, where the number of network states includes: the number of poor network states, the number of stable network states, and the number of good network states; When the number of poor network states is greater than the number of stable network states, and the number of good network states is 0, it is determined that the trend of the network state of the streaming network where the SRT protocol message is located is getting worse; When the number of good network states is greater than the number of stable network states, and the number of poor network states is 0, it is determined that the trend of the network state of the streaming network where the SRT protocol message is located is improving; Otherwise, it is determined that the trend of the network status of the streaming network where the SRT protocol message is located is stable.

2. The SRT streaming bitrate adaptive method according to claim 1, characterized in that: The configuration of a new output bit rate for outputting the original audio and video data after compressing and encoding the original audio and video data according to the network status change trend of the streaming network where the SRT protocol message is located specifically includes: When the network status of the streaming network where the SRT protocol message is located deteriorates, the new output bit rate is obtained by reducing the bit rate to compress and encode the original audio and video data for output, and the new output bit rate is the product of the current bit rate and the reduction coefficient; When the network status of the streaming network where the SRT protocol message is located becomes better, the new output bit rate is obtained by increasing the bit rate to compress and encode the original audio and video data for output, and the new output bit rate is the product of the current bit rate and the increase coefficient; When the network status of the streaming network where the SRT protocol message is located is stable, the current bit rate is maintained.

3. The SRT streaming bitrate adaptive method according to claim 1, characterized in that: Also includes: Adjust the length of the collection cycle of basic status information generated by the SRT protocol stack during the streaming of SRT protocol messages, configure the sensitivity of sensing changes in the network status of the streaming network, and / or adjust the corresponding thresholds of each network status variable of the streaming network where the SRT protocol message is located, and configure the sensitivity of sensing changes in the network status of the streaming network.

4. An SRT streaming bitrate adaptive system, characterized in that: include: Video encoder, used to compress and encode the original audio and video data and output it according to the set output bit rate; A streaming unit, used to receive compressed and encoded audio and video data through an SRT protocol stack, encapsulate the data into an SRT protocol message, and stream the data to a server; wherein the SRT protocol stack complies with the SRT specification of the transmission protocol; The SRT state collection unit is used to periodically collect basic state information generated by the SRT protocol stack during the process of streaming SRT protocol messages; based on the basic state information of the SRT protocol stack during the process of streaming SRT protocol messages in each period, calculate the network state variables of the streaming network where the SRT protocol messages of each period are located; The bit rate adjustment unit is used to analyze the network state variables of the streaming network where the SRT protocol message of each period is located, and obtain the network state of the streaming network where the SRT protocol message of each period is located; and analyze the network state change trend of the streaming network where the SRT protocol message is located according to the network state change trend of the streaming network where the SRT protocol message is located; and configure a new output bit rate for compressing and encoding the original audio and video data for output according to the network state change trend of the streaming network where the SRT protocol message is located; The basic status information in the process of streaming SRT protocol messages includes: the number of sent messages, the number of discarded messages, the number of retransmitted messages, and information used to calculate the round-trip time RTT of message sending; The network status variables of the streaming network where the SRT protocol message is located include: the proportion of retransmitted messages, the proportion of discarded messages, and the change trend of RTT, where: The retransmission message ratio is the ratio of the number of retransmission messages to the number of sent messages in the period; The discarded message ratio is the ratio of the number of discarded messages to the number of sent messages in the period; The change trend of the RTT is predicted by the RTT difference between two adjacent cycles, and the RTT difference refers to the change between the RTTs of two adjacent cycles; when the RTT difference is greater than 0, it indicates that the change of the RTT is on the rise; when the RTT difference is less than 0, it indicates that the change of the RTT is on the decline; when the RTT difference is equal to 0, it indicates that the RTT remains unchanged; The bit rate adjustment unit comprises: The current network status judgment subunit is used to compare each network status variable with the corresponding threshold value for the network status variable of the streaming network where the SRT protocol message is located in each cycle, and determine the network status of the streaming network in the current cycle according to the comparison result; when any network status variable of the streaming network where the SRT protocol message is located is greater than its corresponding upper threshold value, it indicates that the network status of the streaming network where the SRT protocol message is located in this cycle is poor; when all network status variables of the streaming network where the SRT protocol message is located are less than their corresponding lower threshold values, it indicates that the network status of the streaming network where the SRT protocol message is located in this cycle is good; when all network status variables of the streaming network where the SRT protocol message is located are not greater than their corresponding upper threshold values ​​and not less than their corresponding lower threshold values, it indicates that the network status of the streaming network where the SRT protocol message is located in this cycle is stable; The network status trend judgment subunit is used to count the number of various network statuses of the streaming network where the SRT protocol message is located in multiple cycles, and judge the network status change trend of the streaming network where the SRT protocol message is located according to the number of various network statuses in each cycle, wherein the number of network statuses includes: the number of poor network statuses, the number of stable network statuses, and the number of good network statuses; when the number of poor network statuses is greater than the number of stable network statuses, and the number of good network statuses is 0, it is determined that the trend of the network status of the streaming network where the SRT protocol message is located has deteriorated; when the number of good network statuses is greater than the number of stable network statuses, and the number of poor network statuses is 0, it is determined that the trend of the network status of the streaming network where the SRT protocol message is located has improved; otherwise, it is determined that the trend of the network status of the streaming network where the SRT protocol message is located is stable.

5. The SRT streaming bitrate adaptive system according to claim 4, characterized in that: The bit rate adjustment unit also includes: The bit rate controller is used to obtain a new output bit rate for compressing and encoding the original audio and video data for output by reducing the bit rate when the network status of the streaming network where the SRT protocol message is located deteriorates, and the new output bit rate is the product of the current bit rate and the reduction coefficient; when the network status of the streaming network where the SRT protocol message is located improves, obtain a new output bit rate for compressing and encoding the original audio and video data for output by increasing the bit rate, and the new output bit rate is the product of the current bit rate and the increase coefficient; when the network status of the streaming network where the SRT protocol message is located is stable, maintain the current bit rate.

6. The SRT streaming bitrate adaptive system according to claim 4, characterized in that: The SRT state acquisition unit includes a period adjustment subunit, and / or the current network state determination subunit includes a threshold adjustment module, wherein: The cycle adjustment subunit is used to adjust the collection cycle length of the basic status information generated by the SRT protocol stack during the streaming SRT protocol message process, and configure the sensitivity of the perception of the network status change of the streaming network; The threshold adjustment module is used to adjust the corresponding thresholds of each network state variable of the streaming network where the SRT protocol message is located, and configure the sensitivity of perceiving the network state change of the streaming network.