Method, apparatus and medium for video coding
By predicting the packet loss rate and sending code rate of the terminal device in the video encoding device, and dynamically selecting the video encoder and encoding code rate, the congestion control problem in video encoding technology is solved, and the video quality optimization and user experience improvement are achieved.
Patent Information
- Application Number
- CN202310722694.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2024-12-17
AI Technical Summary
In the multi-point-to-multipoint or point-to-multipoint scenario, existing video encoding technology is difficult to effectively control congestion, resulting in unstable video transmission quality and the inability to dynamically adjust the code rate according to the transmission quality of different networks and the capabilities of decoding terminals, which affects the User experience.
By predicting the packet loss rate and sending code rate of the terminal device in the video encoding device, dynamically selecting the appropriate video encoder and encoding code rate, and using clustering algorithms for code rate management, ensuring that the video stream received by each terminal device is adapted to the Its transmission bandwidth and decoding capabilities achieve the optimal guarantee of video quality.
It realizes the code rate matching of video decoding terminals under different network environments, improves video transmission quality and user experience, reduces system complexity, and is suitable for cloud video servers and other video encoding applications.
Smart Images

Figure CN119155448A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computers, and more particularly, to a method, an apparatus, and a computer-readable storage medium for video encoding. Background Art
[0002] For example, video multimedia applications such as cloud video applications are developing rapidly, and the video service data they carry is becoming increasingly large. For example, most of the services carried by the video encoding equipment of the video server are not transmitted in a point-to-point manner, but in a multi-point-to-multi-point or a point-to-multi-point manner.
[0003] In the process of video communication, in order to reduce the delay of video transmission, for example, real-time video data can be transmitted using the Real-time Transport Protocol (RTP) based on the User Datagram Protocol (UDP). The UDP protocol is an unreliable protocol and does not have a reliable congestion control mechanism, which becomes a bottleneck restricting the quality of video transmission. Therefore, efficient congestion control is required to ensure the quality of service (QoS) of video data. When using other unreliable protocols for video data transmission, the problem of congestion control also needs to be solved. Summary of the invention
[0004] Embodiments of the present disclosure provide a method, device, and medium for video encoding.
[0005] According to a first aspect of the present disclosure, a method for video encoding is provided. The method comprises: determining a predicted bit rate received by at least one terminal device according to a packet loss rate and a transmission bit rate between a video encoding device and at least one terminal device; obtaining multiple encoding bit rates of multiple video encoders in the video encoding device; and selecting at least one video encoder from multiple video encoders for video encoding according to the predicted bit rate and the multiple encoding bit rates.
[0006] According to a second aspect of the present disclosure, a device for video encoding is provided. The device includes: a bit rate prediction module, configured to determine the predicted bit rate received by the at least one terminal device according to the packet loss rate and the transmission bit rate between the video encoding device and the at least one terminal device; a coding bit rate acquisition module, configured to obtain multiple coding bit rates of multiple video encoders in the video encoding device; and a video encoder determination module, configured to select at least one video encoder from the multiple video encoders for video encoding according to the predicted bit rate and the multiple coding bit rates.
[0007] According to a third aspect of the present disclosure, a video encoding device is further provided, comprising: a processor, and a memory storing instructions, wherein when the instructions are executed by the processor, the video encoding device executes the method described in the first aspect.
[0008] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, on which computer-executable instructions are stored, wherein when the computer-executable instructions are executed, a device implements the method according to the first aspect.
[0009] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0011] Figure 1 A schematic diagram of a video encoding and decoding system implemented according to an embodiment of the present disclosure is shown;
[0012] Figure 2 A schematic diagram schematically illustrates video coding congestion control and transmission implemented according to an exemplary embodiment of the present disclosure;
[0013] Figure 3 A flowchart of a method for video coding congestion control implemented according to an exemplary embodiment of the present disclosure is schematically shown;
[0014] Figure 4 A schematic diagram schematically shows a clustering of predicted bit rates implemented according to an exemplary embodiment of the present disclosure;
[0015] Figure 5 A scatter diagram schematically shows a predicted bit rate implemented according to an exemplary embodiment of the present disclosure;
[0016] Figure 6 A schematic diagram schematically illustrates a clustering calculation implemented according to an exemplary embodiment of the present disclosure;
[0017] Figure 7 A block diagram schematically shows a video encoding device implemented according to an exemplary embodiment of the present disclosure; and
[0018] Figure 8 A block diagram of a video encoding device according to an exemplary implementation of the present disclosure is schematically shown.
[0019] Throughout the drawings, the same or similar reference numbers denote the same or similar elements. DETAILED DESCRIPTION
[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0021] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below. In addition, all specific numerical values in this document are examples, which are only for the purpose of helping understanding, and are not intended to limit the scope.
[0022] With the rapid development of cloud video multimedia applications such as building intercom systems, remote teaching, telemedicine, and remote monitoring, the video service data carried by the video is becoming increasingly large. Especially with the further development trend of real-time video services, video image services are transmitted as the main carrier services of cloud services, such as real-time intercom communications, remote video conferencing, cloud classrooms, telemedicine diagnosis, and remote monitoring. Most of the services carried by video servers are not point-to-point video communications, but multi-point to multi-point and point-to-multi-point video transmission methods.
[0023] In the process of video communication on the cloud platform, in order to reduce the delay of video transmission, most of the real-time video data adopts the RTP protocol based on UDP transmission. The UDP protocol itself is an unreliable protocol. At the same time, there are fixed network fluctuations and bandwidth limitations of each routing node in the network. Unlike the Transport Control Protocol (TCP), which has a complete congestion control mechanism, UDP has no congestion control regulations, which has caused a bottleneck restricting the quality of video transmission. Therefore, efficient congestion control methods are an important means to ensure the QoS of real-time streaming media applications. It can be understood by ordinary technicians in this field that in addition to the UDP protocol, the use of other transmission protocols without congestion control also faces the entire problem. In addition to the video server in the cloud video application, local single-point or multi-point video servers and single-point or multi-point video encoding terminals in other video applications may face the same problem. The decoding capabilities of different video decoding terminals may also cause congestion control problems.
[0024] In the multi-point to multi-point or one-point to multi-point scenario of traditional video encoding, the bit rate is controlled by judging the packet loss rate. The performance of each re-encoding according to the strategy is poor. The resolution and bit rate of the encoded video stream cannot design different QOS strategies for video decoding terminals with different transmission qualities. Multiple video decoding terminals can only receive video streams with the same resolution and bit rate.
[0025] The algorithm for determining the relationship between packet loss rate and bit rate is unreasonable and does not comprehensively consider other factors that affect the packet loss rate. If multiple video decoding terminals need to receive video streams with different bit rates, a scalable video coding (SVC) algorithm that generates different bit rates in one encoding is used. The SVC encoding algorithm requires the sender to have strong encoding capabilities, and the video decoding terminal has a strong ability to support SVC decoding, but many hardware devices do not have these capabilities. At the same time, SVC encoding reduces the compression rate of video encoding in disguise and increases the transmission bandwidth, which runs counter to the requirements of congestion bit rate control.
[0026] To solve the above problems, the present disclosure proposes a video encoding method, device and computer-readable storage medium for congestion control. The disclosed embodiment predicts the bit rate of a video decoding terminal, and sets the encoding bit rate based on the predicted bit rate to perform congestion control, thereby implementing a QoS guarantee strategy for different video decoding terminals based on different network transmission qualities, ensuring the image quality of video transmission, and reducing the complexity of system implementation.
[0027] Specifically, the embodiments of the present disclosure may be implemented in a multipoint-to-multipoint or a one-to-multipoint cloud video server.
[0028] Figure 1 The video encoding and decoding system implemented according to the embodiment of the present disclosure is shown. In the system 100, a video encoding device 101 such as a cloud video server and a plurality of terminal devices 103, 105, and 107 such as video decoding terminals are included. The terminal devices 103, 105, and 107 communicate with the video encoding device 101 through transmission channels 109, 111, and 113, respectively. The transmission channels 109, 111, and 113 can be wired transmission methods, or wireless transmission methods such as Wi-Fi, the fourth generation mobile communication system (4G), and the fifth generation mobile communication system (5G). By prefabricating multiple video encoder entities in the video encoding device 101, the number of video encoders is determined according to the performance of the video encoding device 101 itself, with a minimum of 2 video encoders or multiple video encoders are strategically started. During the operation of the service, the predicted transmission bit rate for each terminal device is calculated through an improved bit rate prediction algorithm. Then, according to the number of video encoders, the video encoder and encoding bit rate associated and assigned to each terminal device are determined through a classification method such as a clustering algorithm to ensure the minimum communication quality for achieving the optimal video display quality of each terminal device.
[0029] The present disclosure enables video encoding devices and cloud devices to adapt to clients or different types of video decoding terminals in different network environments, ensuring the optimal video quality that matches the transmission bandwidth of the video decoding terminal. In this way, the video encoding device or cloud video service can access video decoding terminals with different bit rates and different bandwidth qualities, so that the client's video decoding terminal can be used without restrictions, greatly improving the client's user experience. It can be understood by those of ordinary skill in the art that this technical effect can be achieved for other video encoding servers or video encoding terminals other than cloud video encoding devices. The present disclosure is also applicable to situations where a server such as a monitoring server is used as a video decoding device.
[0030] Figure 2 A schematic diagram schematically shows video coding congestion control and transmission implemented according to an exemplary embodiment of the present disclosure.
[0031] In the video encoding device 101, at 201, multiple video encoders are started according to pre-set or strategic. At 203, according to the packet loss rate between the video encoding device 101 and the terminal devices 103, 105, and 107, the predicted bit rate is calculated by an improved bit rate prediction algorithm. At 205, the attribution relationship of the terminal device to the video encoder is determined by a classification algorithm such as a clustering algorithm. At 207, the bit rate of the video encoder is set by a pre-set or dynamically set method. At 209, the video data is transmitted and sent by a transmission protocol such as an RTP protocol. After the video data is sent using the set encoding bit rate, the update of the packet loss rate between the video encoding device 101 and the terminal device is detected at 211. Then, the predicted bit rate is calculated based on the updated packet loss rate, and the attribution relationship of the terminal device to the video encoder is determined by using a clustering classification algorithm, etc., and it is iterated in sequence. The clustering algorithm can be performed when the time interval from the previous clustering calculation exceeds a specific time interval, or when any predicted bit rate exceeds a certain threshold, thereby saving classification calculation resources such as clustering. It can be understood by those skilled in the art that Figure 2 In addition to the connection sequence shown in the figure, the modules in the diagram may also be connected in other sequences, which is not limited in the present disclosure.
[0032] Figure 3 The flowchart of the method for video encoding congestion control implemented according to an exemplary embodiment of the present disclosure is schematically shown. The process 300 may be executed at the video encoding device 101 .
[0033] In 310, the predicted bit rate received by at least one terminal device such as 103, 105, and 107 is determined according to the packet loss rate and the transmission bit rate between the video encoding device 101 and at least one terminal device. In 320, multiple encoding bit rates of multiple video encoders in the video encoding device 101 are obtained. In 330, at least one video encoder is selected from multiple video encoders for video encoding according to the predicted bit rate and the multiple encoding bit rates. In this way, the predicted bit rate can be reasonably calculated by the packet loss rate and the transmission bit rate, and the video encoder can be reasonably selected to determine the encoding bit rate, so as to adapt the transmission channel characteristics between the video encoding device 101 and the terminal devices 103, 105, and 107, prevent video data congestion, and improve the quality of the transmitted video. In the embodiment of the present disclosure, the video encoding device 101 can also establish an association between at least one video encoder and at least one terminal device, so as to allocate appropriate video encoder resources to each terminal device, prevent video data congestion, and maximize the quality of the video played at each terminal device.
[0034] In the embodiment of the present disclosure, the following method may be used to determine the predicted bit rate received by at least one terminal device based on the packet loss rate and the transmission bit rate between the video encoding device and at least one terminal device such as 103, 105, 107.
[0035] In the embodiment of the present disclosure, the video encoding device 101 may set the maximum value of the bit rate fluctuation of the video encoder to be A max , the minimum value is A min , through A max , A min The adjustment range of the bit rate congestion control can be set, and the trigger threshold bit rate threshold for switching the bit rate change can be set, so that the video encoding device 101 can perform agile bit rate adjustment. The video encoding device 101 can obtain the reception feedback information of each of the terminal devices 103, 105, and 107 through the control message of the Real-time Transport Control Protocol (RTCP), such as the RTCP Receiver Report (RR) message. The packet loss statistics of the RTCP RR message of each terminal device are obtained, that is, the value of the Fractionlost field is V1, and the packet loss rate is calculated as lr=V1 / 255, 0≤lr≤1. When lr is expressed as a percentage, lr%=V1 / 255*100. In order to avoid changes in packet loss rate caused by sudden fluctuations in bit rate, the total packet loss of RTCP RR continuously sampled in a period T1 can be obtained as Alr, and the total number of data packets sent by RTCP RR is R1. The average packet loss rate based on RR statistics in the T1 period is lr%=Alr / R1*100.
[0036] In the embodiment of the present disclosure, the predicted bit rate R that the video encoding device 101 sends to the terminal device 103 in the next stage can be calculated based on the current transmission bit rate CR and the packet loss rate lr between the video encoding device 101 and the terminal device such as the terminal device 103. s (t k ). The following process of calculating the predicted bit rate corresponds to Figure 2 The predicted bit rate 203 in the above description can be understood by a person skilled in the art that the predicted bit rate between the video encoding device 101 and other terminal devices 105, 107, etc. can also be determined in the same manner.
[0037] In the embodiment of the present disclosure, under the condition that the packet loss rate lr% is less than or equal to the first target packet loss rate of 2%, for example, it can be determined that the packet loss rate in UDP transmission is within the normal fluctuation range, and the transmission can be regarded as relatively normal. s(t k-1 ) is lower than the threshold bit rate threshold, that is, the packet loss rate is very low or the transmission bandwidth is redundant, then the target prediction bit rate between the video encoding device 101 and the terminal device 103 in the next stage is A s (t k )=1.08*A s (t k-1 )+1000, which is 1.08 times the current sending bit rate plus 1000, which tends to increase the sending bit rate and obtain better transmission video quality. The current sending bit rate CR can also be written as A s (t k-1 ). In the embodiment of the present disclosure, 1.08 is the first coefficient. A person skilled in the art can understand that the first coefficient can take other values, and the first target packet loss rate can also take other values, which is not limited in the present disclosure.
[0038] In the disclosed embodiment, under the condition that the packet loss rate lr%>2% and lr%<=5%, and the current transmission bit rate is higher than the threshold bit rate threshold, if there is a negative acknowledgment (Non-ACKnowledgement, NACK) retransmission guarantee mechanism between the video encoding device 101 and the terminal device 103, then Nlr%=lr%-3% is calculated, and Nlr% is used as the final packet loss rate. The NACK retransmission guarantee mechanism can resist packet loss rates below 3% without causing additional transmission side effects to the network link of the video transmission. Therefore, under the condition that there is a NACK retransmission guarantee mechanism, the calculation method A for the target predicted bit rate of the next stage is maintained. s (t k )=1.08*A s (t k-1 )+1000. Under the condition that there is no NACK retransmission guarantee mechanism between the video encoding device 101 and the terminal device 103, A s (t k )=A s (t k-1 ), or A s (t k )=CR, that is, it tends to maintain the target prediction bit rate the same as the current transmission bit rate and remain unchanged. s (t k-1) can also be written as the current sending bit rate CR. In the embodiment of the present disclosure, 5% is the second target packet loss rate that is higher than the first target packet loss rate. It can be understood by those skilled in the art that the second target packet loss rate can also take other values, and the present disclosure does not limit this. In this way, when the packet loss rate is between 2% and 5% and the current sending bit rate exceeds the threshold bit rate, better video quality is provided under the condition of an ACK retransmission guarantee mechanism, and the current video quality is maintained without a retransmission guarantee mechanism, and the video transmission quality is optimized accordingly according to the transmission environment.
[0039] In the embodiment of the present disclosure, under the condition that the packet loss rate lr%>5%, and lr%<=8%, and CR>threshold, if there is a negative acknowledgment NACK retransmission guarantee mechanism between the video encoding device 101 and the terminal device 103, then Nlr%=lr%-3%, and the value of Nlr% is used as the final packet loss rate. The NACK retransmission guarantee mechanism can resist a packet loss rate below 3% without causing additional transmission side effects to the transmission network link, so when there is a NACK retransmission guarantee mechanism, the predicted bit rate between the video encoding device 101 and the terminal device 103 is A s (t k )=CR, that is, the predicted bit rate is the same as the current transmission bit rate. If there is no negative acknowledgement NACK retransmission guarantee mechanism between the video encoding device 101 and the terminal device 103, then A s (t k )=A s (t k-1 )*(1-0.25lr), that is, the target predicted bit rate between the video encoding device 101 and the terminal device 103 is (1-0.25lr) times the current sending bit rate, which results in reducing the bit rate sent to the terminal device 103 in the next time period. In the embodiment of the present disclosure, 8% is the third target packet loss rate that is higher than the second target packet loss rate, and 0.25 is the second coefficient. Those skilled in the art will appreciate that the third target packet loss rate may also take other values, and the second coefficient may also take other values, and the present disclosure does not limit this. In this way, when the packet loss rate is between 5% and 8%, and the current sending bit rate exceeds the threshold bit rate, the current video quality is maintained under the condition of an ACK retransmission guarantee mechanism, and the predicted bit rate is reduced in the absence of a retransmission guarantee mechanism to reduce network congestion, and the video transmission quality is optimized accordingly according to the transmission environment.
[0040] In the embodiment of the present disclosure, when the packet loss rate lr%>8% and CR>threshold, A s (t k )=A s (t k-1)*(1-0.5lr), that is, the target predicted bit rate between the video encoding device 101 and the terminal device 103 is (1-0.5lr) times the current transmission bit rate. In the embodiment of the present disclosure, 0.5 is the third coefficient. Those skilled in the art can understand that the third coefficient can also take other values, and the present disclosure does not limit this. In this way, when the packet loss rate is higher than 8% and the current transmission bit rate exceeds the threshold bit rate, the predicted bit rate for the next time period is further reduced, thereby further reducing network congestion and optimizing the video transmission quality according to the transmission environment.
[0041] In the embodiment of the present disclosure, if any of the above judgment conditions is not met, the target predicted bit rate A of the terminal device 103 for the next period is s (t k ) maintains the existing sending bit rate CR, thereby maintaining the stability of the video data sent by the video encoding device 101 to the terminal device 103.
[0042] In the embodiment of the present disclosure, the maximum value A of the bit rate fluctuation of the video encoder is considered. max , minimum value A min The limit is based on the target predicted bit rate A s (t k ) The value of the predicted bit rate between the final video encoding device 101 and the terminal device 103 is calculated as:
[0043] R s (t k )=max(min(A s (t k ), A max ), A min ) (1)
[0044] Among them, min() is the minimum function, max() is the maximum function, A min is the minimum value of the video encoder bit rate fluctuation, A max is the maximum value of the video encoder bit rate fluctuation, A s (t k ) is the target predicted bit rate for the next stage. This satisfies the video encoder's own restrictions on bit rate fluctuations and prevents the video encoder's capacity limit from being exceeded. In the disclosed embodiment, other terminal devices such as 105 and 107 can also use the above method to calculate the predicted bit rate.
[0045] In an embodiment of the present disclosure, when the video encoding device 101 performs multi-channel video encoding for multiple terminal devices such as 103, 105, and 107, the network capabilities of each channel are different, and they have different uplink bandwidths and downlink bandwidths. The present disclosure estimates the optimal transmission bit rate according to the situation of each channel, and acts on the encoder to update its encoding bit rate. In an embodiment of the present disclosure, if an independent video encoder is adapted for each terminal device, too many video encoders will cause the computing resource overhead of the video encoding device 101, such as CPU overhead, to be too large, which may be greater than the maximum number of encoders preset by the performance of the current service or hardware. Based on this, the present disclosure proposes the following effective encoder management method, which effectively dynamically sets and divides the bit rate of the video encoder to flexibly adapt the QoS strategy for different terminal devices.
[0046] In the embodiment of the present disclosure, after the video encoding device 101 is initialized or started, multiple video encoders can be started according to their own performance. The maximum number of video encoders is set to codecmax, and the encoder number is codecn. For example, codec1, codec2, codec3... The video encoder in the present disclosure can be pre-initialized according to the performance of the video encoding device 101, or the video encoder can be enabled according to the degree of deviation of the random variable of the predicted bit rate from the corresponding mathematical expectation, thereby avoiding performance waste.
[0047] In the embodiment of the present disclosure, the bit rate of each video encoder can be set in a variety of ways, corresponding to Figure 2"Encoder bit rate setting 207" in the present disclosure. The first way to set the video encoder bit rate in the present disclosure is to set the optimal bit rate of each video encoder according to the resolution and encoding format, such as codec1-VGA (400kbps), codec2-720p (2Mbps), codec3-720ph265 (1.5Mbps), codec4-1080p (3Mbps), etc. The second way to set the video encoder bit rate in the present disclosure is that multiple video encoders use a fixed resolution, but the output encoding bit rates are different, such as codec1-720p (800Kbps), codec2-720p (1.2Mbps), codec3-720p (1.5Mbps), codec4-720p (2Mbps), etc. The third method of setting the bit rate of the video encoder disclosed in the present invention is the dynamic bit rate selection of the video encoder. The maximum number of video encoders that can be enabled in the preset video encoding device 101 is codecmax. According to the cluster classification algorithm, the lowest bit rate under the category or the average bit rate or the maximum bit rate under the category is selected as the bit rate of the encoder. For example, if there are 1Mbps, 2Mbps, and 3Mbps under the category, the lowest 1M or the average 2M or the maximum 3M can be strategically selected as the bit rate of the encoder. In this way, a flexible method can be used to select and set the bit rate to meet the needs of video encoding devices with different performances.
[0048] In the disclosed embodiment, after the video encoder in the video encoding device 101 is pre-initialized, initially multiple terminal devices such as 103, 105, 107, etc. all share an optimal default video encoder, thereby saving software and hardware resources in the video encoding device 101. After the default video encoder is enabled, the variance or maximum difference of the predicted bit rate is used as a judgment condition for enabling another video encoder. For example, assuming that X1, X2...Xn are predicted bit rates for multiple terminal devices such as 103, 105, 107, etc., the bit rate variance and maximum difference of X1, X2...Xn are calculated in the following manner.
[0049] The average bit rate is:
[0050] The code rate variance is:
[0051] The maximum difference is: M = max | X i -X j |(i,j∈(1...n))(4)
[0052] Set the variance threshold of X1, X2...Xn to Sx, and the maximum difference threshold to Mx. Accordingly, there are two methods for determining whether to enable another video encoder: the variance threshold method and the maximum difference method. The variance threshold method is more accurate and requires a larger amount of calculation, while the maximum difference method requires a smaller amount of calculation. In this way, if the hardware performance of the video encoding device 101 is higher, the variance threshold method can be selected to improve accuracy; if the hardware performance is lower, the maximum difference method can be selected to avoid complex calculations. In the embodiment of the present disclosure, the variance threshold Sx is the first threshold, and the maximum difference threshold Mx is the second threshold.
[0053] In the embodiment of the present disclosure, if S 2 >Sx (variance threshold method) or M>Mx (maximum difference method), another video encoder is started in the video encoding device 101, otherwise the existing stock video encoder is used. In the embodiment of the present disclosure, in order to support more than two video encoders, more different thresholds Sx and Mx can be designed according to the variance and the maximum difference to distinguish the video encoders. In the end, in the video encoding device 101, the number of video encoders that can be enabled can reach the maximum value Codecmax of the number of video encoders.
[0054] In the embodiment of the present disclosure, the following method is used to determine which terminal devices should belong to which encoder in the video encoding device 101, corresponding to Figure 2 "Encoder Affiliation 205" in the above. The above has determined the enabling conditions of multiple video encoders. If only one encoder is currently enabled, all terminal devices belong to this encoder. If multiple encoders are pre-made, or two or more encoders are started, it is possible to divide which encoder each terminal device uses. The present disclosure uses either a method for pre-making a predicted bit rate variation range, or a clustering algorithm such as a K-means clustering algorithm to perform encoder affiliation selection processing.
[0055] In the disclosed embodiment, the attribution selection method of the pre-made predicted bit rate variation range can be implemented in the following manner: after the video encoding device 101 is initialized, multiple terminal devices such as 103, 105, and 107 share a video encoder, and when the predicted bit rate of a certain terminal device is lower than the third threshold or the packet loss rate is higher than the fourth threshold, the terminal device is switched to another video encoder or the next video encoder, otherwise no processing is performed. When the predicted bit rate of another terminal device returns to the normal range, the other terminal device is classified back to the original video encoder.
[0056] In the disclosed embodiment, for example, the attribution selection method of K-means clustering can be implemented in the following manner: the cluster center is selected as the maximum and minimum value points of the two predicted bit rates and used as the centroid. The time complexity of the K-means clustering algorithm is O(n), where n is the number of terminal devices participating in the clustering. The timing for updating the cluster center is not to update each time a new predicted bit rate of a single terminal device is obtained, but to update at a certain interval, or when the predicted bit rate of a certain terminal device exceeds the fifth threshold, thereby saving the computing resources of the video encoding device 101.
[0057] In the disclosed embodiment, the K-means clustering algorithm is an iterative clustering analysis algorithm. The steps are: if you want to divide the input multiple objects into K groups, then randomly select K objects from the multiple objects as initial cluster centers, then calculate the distance between each object and each initial cluster center, and assign each object to the cluster center closest to it. The cluster centers and the objects assigned to them represent a cluster. Each time a sample is assigned, the cluster center will be recalculated based on the existing objects in the cluster. This process will be repeated until a certain termination condition is met. The termination condition can be that there are no objects, or the minimum number of objects are reassigned to different clusters, so that no cluster center or the minimum number of cluster centers will change again, so that the classification error is minimized or locally minimized.
[0058] In the embodiment of the present disclosure, if there are n terminal devices receiving video at the same time, there are n predicted bit rates X1, X2, ..., Xn, and a clustering algorithm is used to calculate the classification of the terminal devices. In the embodiment of the present disclosure, there are two ways to select sample data: 1. One-dimensional method to construct X1, X2, ..., Xn, representing the estimated bit rate of each channel; 2. Two-dimensional method to construct, using the time t of the last bit rate update and the bit rate X to construct a two-dimensional vector: (t1, X1), (t2, X2), ..., (tn, Xn). The choice of sample data construction method can be determined by the frequency of bit rate update. If the frequency of bit rate update is high, that is, the classification result is sensitive to time t, and the predicted bit rate changes quickly, a one-dimensional construction method is used; or if only two video encoders are limited, a one-dimensional construction method can be selected. If the classification is not sensitive to time t, the predicted bit rate changes slowly, or for multiple encoders, a two-dimensional construction method can be selected to make the classification more accurate.
[0059] In the disclosed embodiment, the K-means algorithm can be specifically implemented by the following steps: First, randomly select K sample data as the initial cluster center or centroid (K represents the number of categories) in the sample data of the input object. On the basis of selecting the K initial cluster centers, calculate the distance between each object and the initial cluster center, assign each object to the nearest initial cluster center, and form K clusters. In the K clusters, recalculate the cluster center of each cluster. For the new cluster center, recalculate the distance between each object and the new cluster center, assign each object to the nearest new cluster center, and form updated K clusters. Repeat the above process of calculating cluster centers and clustering until the clusters no longer change or the maximum number of iterations is reached.
[0060] Figure 4 The schematic diagram of clustering predicted bit rates according to an exemplary embodiment of the present disclosure is schematically shown. Specifically, Figure 4 The clustering results for the predicted bit rates are shown.
[0061] In the schematic diagram 400, there are sample data 401 of predicted bit rates of multiple terminal devices, wherein the horizontal axis is relative time and the vertical axis is relative bit rate. The sample data 401 of predicted bit rates is subjected to K-means clustering iteration with two cluster centers, and finally two cluster centers 403 and 405 are obtained, and the cluster boundary is 407. The predicted bit rates on the left side of the cluster boundary 407, or the terminal devices belonging to the cluster center 403, correspond to the first video encoder in the video encoding device 101; the predicted bit rates on the right side of the cluster boundary 407, or the terminal devices belonging to the cluster center 405, correspond to the second video encoder in the video encoding device 101.
[0062] Figure 5 A scatter diagram of the predicted code rate implemented according to an exemplary embodiment of the present disclosure is schematically shown.
[0063] In the embodiment of the present disclosure, there are 5 terminal devices. According to the above algorithm, the 5 predicted code rates of the 5 terminal devices can be calculated as follows: X1=3, X2=1.5, X3=1.8, X4=1.2, X5=0.9, and the time for prediction is: t1=2, t2=1, t3=2.4, t4=4, t5=3.6. These data can form 5 two-dimensional sample data, which are recorded as: M1: (2, 3), M2: (1, 1.5), M3: (2.4, 1.8), M4: (4, 1.2), M5: (3.6, 0.9), as shown in the following figure. Figure 5 shown.
[0064] Assuming that there are two pre-made video encoders in the video encoding device 101, two points are selected as the initial cluster centers. For example, the two points with the highest and lowest predicted bit rates, namely M2 and M5, are selected as the initial cluster centers of the two classes, and cluster classification is performed based on the Euclidean distance between each sample data and the initial cluster center. Figure 5 The two-dimensional sample data in the Euclidean distance is the distance between the sample data and the cluster center in the two-dimensional plane, as shown in Figure 6 As shown. Figure 6 Compare the Euclidean distances between each sample data and the two initial cluster centers M2 and M5, and classify M1, M2, and M3, which are closer to M2, into the first category, and classify M4 and M5, which are closer to M5, into the second category. Calculate the new cluster centers of M1, M2, and M3 in the first category as (1.8, 2.1), and the new cluster centers of M4 and M5 in the second category as (3.8, 1.05). Perform clustering and classification calculations again until the category to which each sample data belongs no longer changes. Finally, set the actual bit rates of the two video encoders according to the bit rates of the cluster centers finally obtained.
[0065] In the disclosed embodiment, when the video encoding device 101 supports multiple video encoders, the K-means method can also be directly used for clustering. The number of selected cluster centers is determined according to the preset number of encoders that are expected to be used. When selecting the initial cluster centers of multiple encoders, the one-dimensional or two-dimensional sample data of the predicted bit rate of the terminal device with the smallest difference between the predicted bit rate of all terminal devices and the bit rate of the pre-made encoder is used as the initialized cluster center, and then the K-means method is used for clustering classification, thereby ensuring the accuracy of clustering classification, and setting a suitable video encoder bit rate for the terminal devices in each category, while reducing network congestion and ensuring the quality of video transmission.
[0066] In the disclosed embodiment, the bit rate of the video encoder may also be updated. In the video encoding device 101, there are m video encoders, which provide video encoding services for n terminal devices. The setting of the video encoder bit rate may be predefined, or the initial bit rate may be calculated using a clustering algorithm. The clustering algorithm may have an update interval, and clustering and classification may not be performed again every time the predicted bit rate of a terminal device is updated.
[0067] In the disclosed embodiment, clustering classification can be performed again at specific time intervals T3. For each terminal device, the average value of the predicted bit rate within the specific time interval T3 is taken (if it is two-dimensional sample data, the middle value of the time period T3 can be taken) as the input of clustering classification, and K-means calculation is re-performed, clustering classification is re-performed, and then according to the video encoder corresponding to the terminal device, the video encoding bit rate of the terminal device is set to perform video transmission. For a video encoder, when the predicted encoding bit rate in the prediction time period based on T3 is less than the preset minimum bit rate A min Or greater than the preset maximum bit rate A max When the minimum bit rate A min Or maximum bit rate A max The bit rate of the video encoder is set. In this way, the bit rate of the video encoder can be prevented from being set beyond its capability, the working reliability of the video encoder is improved, and the quality of video transmission is improved while reducing network congestion.
[0068] Figure 7 Schematically shows a block diagram of a video encoding device implemented according to an exemplary embodiment of the present disclosure. Figure 7 As shown, the video encoding device 700 includes a bit rate prediction module 702 , a coding bit rate acquisition module 704 and a video encoder determination module 706 .
[0069] The bit rate prediction module 702 is configured to determine the predicted bit rate received by at least one terminal device according to the packet loss rate and the transmission bit rate between the video encoding device and the at least one terminal device. The encoding bit rate acquisition module 704 is configured to obtain multiple encoding bit rates of multiple video encoders in the video encoding device. The video encoder determination module 706 is configured to select at least one video encoder from multiple video encoders for video encoding according to the predicted bit rate and the multiple encoding bit rates.
[0070] In some embodiments, the video encoding device 700 may further include an association establishing module configured to establish an association between at least one video encoder and at least one terminal device.
[0071] In some embodiments, the bit rate prediction module 702 is further configured to: under the condition that the packet loss rate is less than or equal to the first target packet loss rate, or the sending bit rate between the video encoding device and the at least one terminal device is lower than the threshold bit rate, amplify and offset the sending bit rate using a first coefficient; and determine the predicted bit rate based on the amplified and offset bit rate, the highest bit rate and the lowest bit rate, the highest bit rate includes the highest encoding bit rate output by the video encoder, and the lowest bit rate includes the lowest encoding bit rate output by the video encoder.
[0072] In some embodiments, the bit rate prediction module 702 is further configured to: when the packet loss rate is greater than the first target packet loss rate and less than or equal to the second target packet loss rate, and the sending bit rate is higher than the threshold bit rate, and there is a retransmission guarantee, use the first coefficient to amplify and offset the sending bit rate; and determine the predicted bit rate based on the amplified and offset bit rate, the highest bit rate and the lowest bit rate.
[0073] In some embodiments, the bit rate prediction module 702 is further configured to: determine the sending bit rate as the predicted bit rate when the packet loss rate is greater than the first target packet loss rate and less than or equal to the second target packet loss rate, and the sending bit rate is higher than the threshold bit rate, and there is no retransmission guarantee.
[0074] In some embodiments, the bit rate prediction module 702 is further configured to: when the packet loss rate is greater than the second target packet loss rate and less than or equal to the third target packet loss rate, and the sending bit rate is higher than the threshold bit rate, and there is no retransmission guarantee, reduce the sending bit rate according to the second coefficient and the packet loss rate, and the second coefficient is different from the first coefficient; and determine the predicted bit rate according to the bit rate after the rate reduction, the highest bit rate and the lowest bit rate.
[0075] In some embodiments, the bit rate prediction module 702 is further configured to: under the condition that the packet loss rate is greater than the third target packet loss rate and the sending bit rate is higher than the threshold bit rate, reduce the sending bit rate according to the third coefficient and the packet loss rate, and the third coefficient is greater than the second coefficient; and determine the predicted bit rate according to the bit rate after the rate reduction, the highest bit rate and the lowest bit rate.
[0076] In some embodiments, the encoding bit rate acquisition module 704 is further configured to implement at least one of the following: determining multiple encoding bit rates based on multiple image resolutions and encoding formats; determining multiple encoding bit rates based on multiple predetermined encoding bit rates under the condition of a fixed image resolution; and using a clustering algorithm to determine the average bit rate, minimum bit rate or maximum bit rate of a class as multiple encoding bit rates.
[0077] In some embodiments, the video encoder determination module 706 is further configured to: select and use the first video encoder from a plurality of video encoders according to the predicted bit rate and the encoding bit rate of the first video encoder.
[0078] In some embodiments, the video encoding device 700 may further include a difference determination module configured to determine the variance or maximum difference of the predicted bit rate after using the first video encoder. The video encoding device 700 may also include a second video encoder use module configured to determine to use a second video encoder having a different encoding bit rate from the first video encoder under the condition that the variance is greater than a first threshold value or the maximum difference is greater than a second threshold value.
[0079] In some embodiments, the video encoding device 700 may also be associated with a switching module, which is configured to switch the target terminal device from being associated with the first video encoder to being associated with the second video encoder when the predicted bit rate of the target terminal device is lower than a third threshold, or the packet loss rate between the target terminal device and the video encoding device is greater than a fourth threshold.
[0080] In some embodiments, establishing an association between at least one video encoder and at least one terminal device includes: performing clustering calculations on a plurality of the predicted bit rates according to a cluster number greater than or equal to two to determine a cluster center point; determining the encoding bit rate of the video encoder of the number of clusters according to the cluster center points; and determining an association between a plurality of terminal devices and the video encoder according to the distances between the plurality of predicted bit rates and the cluster center points.
[0081] In some embodiments, establishing an association between at least one video encoder and at least one terminal device further includes: performing cluster calculation again to determine the cluster center when the time interval from the previous cluster calculation exceeds a specific time interval or any predicted bit rate exceeds a fifth threshold; re-determining the encoding bit rate of the video encoder with the number of clusters based on the re-calculated cluster center; and determining the association between multiple terminal devices and the video encoder based on multiple predicted bit rates and the distances between the re-calculated cluster center points.
[0082] Figure 8 Schematically shows a block diagram of a video encoding device according to an exemplary implementation of the present disclosure, and the device 800 may be a device or apparatus described in an embodiment of the present disclosure. Figure 8 As shown, the device 800 includes a central processing unit / graphics processing unit (CPU / GPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or computer program instructions loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The CPU / GPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804. Although not shown in FIG. Figure 8 As shown in FIG. 8 , device 800 may also include a co-processor.
[0083] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0084] The various methods or processes described above may be performed by the CPU / GPU 801. For example, in some embodiments, the methods may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the CPU / GPU 801, one or more steps or actions in the methods or processes described above may be performed.
[0085] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0086] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0087] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0088] The computer program instructions for performing the disclosed operation may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, programming languages including object-oriented programming languages, and conventional procedural programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In certain embodiments, by utilizing the state information of a computer-readable program instruction to customize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the present disclosure.
[0089] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0090] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0091] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the equipment, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous frames can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the functions involved. It should also be noted that each frame in the block diagram and / or flow chart, and the combination of frames in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0092] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A video encoding method, comprising: Determining a predicted bit rate received by the at least one terminal device according to a packet loss rate and a transmission bit rate between the video encoding device and the at least one terminal device; Acquire multiple encoding bit rates of multiple video encoders in the video encoding device; as well as At least one video encoder is selected from the multiple video encoders for video encoding according to the predicted bit rate and the multiple encoding bit rates.
2. The method according to claim 1, further comprising: An association is established between the at least one video encoder and the at least one terminal device.
3. The method according to claim 1 or 2, wherein determining the predicted bit rate received by the at least one terminal device according to the packet loss rate and the transmission bit rate between the video encoding device and the at least one terminal device comprises: Under the condition that the packet loss rate is less than or equal to the first target packet loss rate, or the transmission bit rate between the video encoding device and the at least one terminal device is lower than the threshold bit rate, amplifying and shifting the transmission code rate using a first coefficient; as well as Determine the predicted bit rate according to the amplified and offset bit rate, the highest bit rate and the lowest bit rate, The highest bit rate includes the highest encoding bit rate output by the video encoder, and the lowest bit rate includes the lowest encoding bit rate output by the video encoder.
4. The method according to claim 3, wherein determining the predicted bit rate received by the at least one terminal device according to the packet loss rate and the transmission bit rate between the video encoding device and the at least one terminal device further comprises: Under the condition that the packet loss rate is greater than the first target packet loss rate and less than or equal to the second target packet loss rate, and the sending code rate is higher than the threshold code rate, and retransmission is guaranteed, amplifying and shifting the transmission code rate using the first coefficient; as well as The predicted bit rate is determined according to the amplified and offset bit rate, the highest bit rate and the lowest bit rate.
5. The method according to claim 4, wherein determining the predicted bit rate received by the at least one terminal device according to the packet loss rate and the transmission bit rate between the video encoding device and the at least one terminal device further comprises: Under the condition that the packet loss rate is greater than the first target packet loss rate and less than or equal to the second target packet loss rate, and the sending code rate is higher than the threshold code rate, and there is no retransmission guarantee, The sending code rate is determined as the predicted code rate.
6. The method according to claim 5, wherein determining the predicted bit rate received by the at least one terminal device according to the packet loss rate and the transmission bit rate between the video encoding device and the at least one terminal device further comprises: Under the condition that the packet loss rate is greater than the second target packet loss rate and less than or equal to the third target packet loss rate, and the sending code rate is higher than the threshold code rate, and retransmission is guaranteed, The sending code rate is determined as the predicted code rate.
7. The method according to claim 6, wherein determining the predicted bit rate received by the at least one terminal device according to the packet loss rate and the transmission bit rate between the video encoding device and the at least one terminal device further comprises: Under the condition that the packet loss rate is greater than the second target packet loss rate and less than or equal to the third target packet loss rate, and the sending code rate is higher than the threshold code rate, and there is no retransmission guarantee, reducing the transmission code rate according to a second coefficient and the packet loss rate, the second coefficient being different from the first coefficient; as well as The predicted bit rate is determined according to the bit rate after the rate reduction, the maximum bit rate and the minimum bit rate.
8. The method according to claim 7, wherein determining the predicted bit rate received by the at least one terminal device according to the packet loss rate and the transmission bit rate between the video encoding device and the at least one terminal device further comprises: Under the condition that the packet loss rate is greater than the third target packet loss rate and the sending code rate is higher than the threshold code rate, reducing the sending code rate according to a third coefficient and the packet loss rate, the third coefficient being greater than the second coefficient; as well as The predicted bit rate is determined according to the bit rate after the rate reduction, the maximum bit rate and the minimum bit rate.
9. The method according to claim 2, wherein obtaining a plurality of encoding bit rates of a plurality of video encoders in the video encoding device comprises at least one of the following: Determining the plurality of encoding bit rates according to a plurality of image resolutions and encoding formats; Under the condition of a fixed image resolution, determining the multiple encoding rates according to multiple predetermined encoding rates; and Using a clustering algorithm, an average bit rate, a minimum bit rate, or a maximum bit rate of a class is determined as the multiple encoding bit rates.
10. The method according to claim 1, wherein the selecting at least one video encoder from the plurality of video encoders for video encoding according to the predicted bit rate and the plurality of encoding bit rates comprises: The first video encoder is selected and used from among the multiple video encoders according to the predicted bit rate and the encoding bit rate of the first video encoder.
11. The method according to claim 10, further comprising: After using the first video encoder, determining a variance or a maximum difference of the predicted bit rate; as well as Under the condition that the variance is greater than a first threshold, or the maximum difference is greater than a second threshold, it is determined to use a second video encoder having a different encoding bit rate from that of the first video encoder.
12. The method according to claim 1, further comprising: Under the condition that the predicted bit rate of the target terminal device is lower than a third threshold, or the packet loss rate between the target terminal device and the video encoding device is greater than a fourth threshold, the target terminal device is switched from being associated with the first video encoder to being associated with the second video encoder.
13. The method according to claim 9, wherein establishing an association between the at least one video encoder and the at least one terminal device comprises: Performing cluster calculation on the plurality of predicted bit rates according to a number of clusters greater than or equal to two, and determining a cluster center point; Determining the encoding bit rate of the video encoder of the number of clusters according to the cluster center points; as well as The association between the multiple terminal devices and the video encoder is determined according to the distances between the multiple predicted bit rates and the cluster center point.
14. The method according to claim 13, wherein establishing the association between the at least one video encoder and the at least one terminal device further comprises: When the time interval from the last cluster calculation exceeds a specific time interval, or any predicted bit rate exceeds a fifth threshold, cluster calculation is performed again to determine the cluster center point; Determining again the encoding bit rate of the video encoder of the number of clusters according to the recalculated cluster center points; as well as The association between the multiple terminal devices and the video encoder is determined according to the distances between the multiple predicted bit rates and the recalculated cluster center points.
15. A video encoding device, comprising: A bit rate prediction module, configured to determine a predicted bit rate received by at least one terminal device according to a packet loss rate and a transmission bit rate between the video encoding device and at least one terminal device; An encoding bit rate acquisition module, configured to acquire multiple encoding bit rates of multiple video encoders in the video encoding device; as well as The video encoder determination module is configured to select at least one video encoder from the multiple video encoders for video encoding according to the predicted bit rate and the multiple encoding bit rates.
16. A video encoding device, comprising: A processor, and a memory storing instructions, wherein when the instructions are executed by the processor, the video encoding device performs the method according to any one of claims 1 to 14. 17 . A computer-readable storage medium storing instructions, wherein when the instructions are executed by an electronic device, the electronic device executes the method according to claim 1 .
