Transcoding stream quality judgment method and device, equipment, storage medium and product
By real-time update of the timeout threshold and combining multiple parameters to judge the quality of transcoding streams, the problem of insufficient accuracy and stability of transcoding stream quality judgment in the prior art is solved, and more accurate cut-off decisions and better user experience are achieved.
Patent Information
- Application Number
- CN202510050161.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-05-16
AI Technical Summary
In the prior art, the transcoding stream quality judgment method based on a fixed timeout threshold has poor accuracy and stability in the cutting decision, resulting in poor quality judgment of the transcoding stream.
By real-time update of the timeout threshold for the transcoding stream quality determination, combining the integrity of the transcoding stream image group and the source stream image group, the length of the queue to be sent, the buffer length on the playback side, the length of the played video length and the round trip time of the packet, the available video queue length and the threshold for the video queue length are determined, and the quality of the transcoding stream is then judged.
It improves the accuracy and stability of cutting decisions, can cut the gears to the source stream in a timely and correct manner, reduces playback lag, and improves user viewing experience.
Smart Images

Figure CN120017870A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, apparatus, device, storage medium and product for determining the quality of a transcoded stream. Background Art
[0002] In live video broadcasting, policies related to source streams or transcoded streams are usually configured under the decision of the audience video server (VS) side. The source stream refers to the image group (GOP) data that is collected by the host side through the camera and encoded into the corresponding video packet data stream using certain video encoding standards (such as h264, h265, etc.). The transcoded stream refers to the video packet data stream that meets the bit rate requirements after framing and decoding the source stream sent by the host. Compared with the source stream, the transcoded stream usually has a lower bit rate while ensuring the image quality as much as possible, and the bandwidth required for transmission will be smaller, and the corresponding probability of freezes on the audience side will also be lower.
[0003] The stability of the transcoding stream is easily affected by the state of the transcoding server. For example, the transcoding server (CS, Code decoder server) is highly loaded during certain time periods, the transcoding server is down, and the link between the anchor video server (anchor VS) and the transcoding server has high packet loss and large delay, which can lead to a significant increase in transcoding delay and even the disconnection of the transcoding stream. The transcoding stream is also affected by the frame loss strategy of the transcoding server. In addition, decoding and transcoding failures will have a negative impact on the transcoding stream. Therefore, in order to resist the serious negative impact brought by the instability of the transcoding stream and enjoy the advantages of low bit rate and high definition brought by the transcoding stream, both the source stream and the transcoding stream are usually sent to the audience video server. When the audience video server determines that the transcoding stream has timed out, the video server side should switch from the transcoding stream to the source stream in time and send it to the corresponding audience.
[0004] In the related art, the quality of the transcoded stream is generally determined by comparing the transcoding delay with the timeout threshold. For example, the video server calculates the average of the time difference between the most recently received transcoded stream key frame (I frame) and the corresponding source stream key frame as the transcoding delay. When the transcoding delay exceeds the timeout threshold, the transcoded stream is judged to be of poor quality and the source stream is switched to be sent. However, the timeout threshold of this transcoded stream quality determination method is the same fixed value for all viewers, the accuracy and stability of the switching decision are poor, and the transcoded stream quality determination effect is poor. Summary of the invention
[0005] The embodiments of the present application provide a transcoding stream quality determination method, apparatus, device, storage medium and product to solve the technical problems in the related art that the accuracy and stability of the switching decision of the transcoding stream quality determination method based on a fixed timeout threshold are poor, and the transcoding stream quality determination effect is poor. The timeout threshold for transcoding stream quality determination can be updated in real time to improve the accuracy and stability of the switching decision. When the transcoding stream quality is poor, the file can be switched to the source stream in a timely and correct manner to reduce playback jams and improve the user viewing experience.
[0006] In a first aspect, an embodiment of the present application provides a method for determining transcoding stream quality, comprising:
[0007] Determining the integrity of the transcoded stream group of pictures and the integrity of the source stream group of pictures;
[0008] When the integrity of the transcoded stream image group is consistent with the integrity of the source stream image group, determining the available video queue length of the transcoded stream according to the queue length of the transcoded stream to be sent, the buffer length of the playback side, the length of the video played on the playback side, and the round trip time of the data packet;
[0009] Smoothing the transcoding stream delay sampling value to obtain a smooth transcoding stream delay, determining a smooth transcoding delay timeout according to an absolute value of a difference between the transcoding stream delay sampling value and the smooth transcoding stream delay, and determining a video queue length threshold according to the smooth transcoding delay timeout, wherein the transcoding stream delay sampling value is determined according to a difference in reception completion time of a transcoding stream key frame of a transcoding stream image group and a source stream key frame of a source stream image group, or a difference in reception completion time of a transcoding stream intermediate frame of a transcoding stream image group and a source stream intermediate frame of a source stream image group;
[0010] The transcoding stream quality determination result is determined according to a comparison result of the available video queue length and the video queue length threshold.
[0011] In a second aspect, an embodiment of the present application provides a transcoded stream quality determination device, including an integrity determination module, a length determination module, a threshold determination module and a quality determination module, wherein:
[0012] The integrity determination module is configured to determine the integrity of the transcoded stream image group and the integrity of the source stream image group;
[0013] The length determination module is configured to determine the available video queue length of the transcoded stream according to the queue length to be sent of the transcoded stream, the buffer length of the playback side, the length of the video played on the playback side, and the round trip time of the data packet when the integrity of the transcoded stream image group is consistent with the integrity of the source stream image group;
[0014] The threshold determination module is configured to perform smoothing processing on the transcoding stream delay sampling value to obtain a smooth transcoding stream delay, determine a smooth transcoding delay timeout according to an absolute value of a difference between the transcoding stream delay sampling value and the smooth transcoding stream delay, and determine a video queue length threshold according to the smooth transcoding delay timeout, wherein the transcoding stream delay sampling value is determined according to a reception completion time difference between a transcoding stream key frame of a transcoding stream image group and a source stream key frame of a source stream image group, or a reception completion time difference between a transcoding stream intermediate frame of a transcoding stream image group and a source stream intermediate frame of a source stream image group;
[0015] The quality determination module is configured to determine a transcoding stream quality determination result according to a comparison result of the available video queue length and the video queue length threshold.
[0016] In a third aspect, an embodiment of the present application provides a transcoding stream quality determination device, including: a memory and one or more processors;
[0017] The memory is used to store one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the transcoding stream quality determination method as described in the first aspect.
[0019] In a fourth aspect, an embodiment of the present application provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the transcoding stream quality determination method as described in the first aspect when executed by a computer processor.
[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device performs the transcoding stream quality determination method as described in the first aspect.
[0021] In the embodiment of the present application, when the integrity of the transcoded stream image group and the source stream image group is consistent, the available video queue length of the transcoded stream is determined according to the queue length of the transcoded stream to be sent, the buffer length on the playback side, the length of the video played on the playback side, and the round-trip time of the data packet, the transcoded stream delay sampling value is smoothed to obtain the smoothed transcoded stream delay, the smoothed transcoding delay timeout is determined according to the absolute value of the difference between the transcoded stream delay sampling value and the smoothed transcoded stream delay, and the video queue length threshold is determined according to the smoothed transcoding delay timeout, and the available video queue length is compared with the video queue length threshold. The result determines the transcoding stream quality judgment result, wherein the transcoding stream delay sampling value is determined according to the reception completion time difference of the transcoding stream key frame of the transcoding stream image group and the source stream key frame of the source stream image group, or the reception completion time difference of the transcoding stream intermediate frame of the transcoding stream image group and the source stream intermediate frame of the source stream image group, so that the video queue length threshold decreases slowly when the transcoding delay decreases, and increases rapidly when the transcoding delay increases. When the transcoding stream quality is poor, the source stream can be switched in time and correctly to reduce playback jams, thereby ensuring the audience clarity while effectively reducing the audience viewing jams and improving the viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flow chart of a method for determining the quality of a transcoded stream provided in an embodiment of the present application;
[0023] Figure 2 is a flow chart of another method for determining transcoding stream quality provided by an embodiment of the present application;
[0024] Figure 3 It is a schematic diagram of a change curve of a transcoding stream delay sampling value, a smooth transcoding stream delay and a smooth transcoding delay timeout provided in an embodiment of the present application;
[0025] Figure 4 It is a structural schematic diagram of a transcoding stream quality determination device provided in an embodiment of the present application;
[0026] Figure 5 It is a structural diagram of a transcoding stream quality determination device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The above process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The above process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0028] The transcoding stream quality determination method provided in the present application can be applied to the timeout judgment of the transcoding stream delay sampling value of live video broadcast. When the integrity of the transcoding stream image group and the source stream image group is consistent, the quality of the transcoding stream is judged according to the comparison result of the available video queue length and the video queue length threshold. The video queue length threshold is obtained based on the smooth transcoding delay timeout determined by the absolute value of the difference between the transcoding stream delay sampling value and the smooth transcoding stream delay. The transcoding stream delay sampling value is obtained by sampling the key frames and intermediate frames of the transcoding stream and the source stream, so that the video queue length threshold decreases slowly when the transcoding delay decreases, and increases rapidly when the transcoding delay increases. When the transcoding stream quality is poor, the source stream can be switched in time and correctly to reduce playback jams, thereby ensuring the clarity of the audience while reducing the audience's viewing jams and improving the viewing experience.
[0029] In the existing live transmission link, the host side sends the source stream to the host video server after acquisition and encoding. The host video server sends the source stream to the transcoding server. The transcoding server transcodes multiple video streams with different bit rates. These video streams with different bit rates are distinguished by different gears. The corresponding audience video server subscribes to the transcoded stream of the corresponding gear according to the audience's demand for video streams with different bit rates, and sends it to the corresponding audience after receiving the transcoded stream sent by the transcoding server. The audience video server usually maintains multiple video stream queues to store the recently received video stream data of different gears. The audience video server selects the appropriate video stream gear according to the network conditions of the corresponding audience side, and sends the corresponding video stream data to the corresponding audience at an appropriate sending rate. The stability of the transcoding stream is easily affected by the state of the transcoding server. For example, the transcoding server is highly loaded during certain time periods, the transcoding server service is down, and the link between the host video server and the transcoding server has high packet loss and large delay, which leads to a significant increase in transcoding delay and even the disconnection of the transcoding stream. The transcoding stream is also affected by the frame loss strategy of the transcoding server. In addition, decoding and transcoding failures will have a negative impact on the transcoding stream. Therefore, in order to resist the serious negative impact caused by the instability of the transcoding stream and enjoy the advantages of low bit rate and high definition brought by the transcoding stream, both the source stream and the transcoding stream are usually sent to the audience video server. When the audience video server determines that the transcoding stream quality is low or the transcoding stream is unavailable, the video server side should switch from the transcoding stream to the source stream in time and send it to the corresponding audience. After judging that the quality of the corresponding transcoding stream is stable and restored, it will switch back to send the transcoding stream. Usually, the transmission link between the host video server and the audience video server is a data center link. Increasing the transmission of the source stream does not bring obvious transmission costs, but can greatly improve the experience on the audience side.
[0030] The judgment of the quality of the transcoded stream by the audience video server will affect the gear and timing of the decision-making, and then directly affect the smoothness and real-time experience of the audience. Therefore, a reliable, accurate and timely transcoded stream quality judgment strategy is crucial to improving the audience's viewing experience. The existing transcoded stream quality judgment scheme mainly adopts a fixed transcoded stream packet receiving interval threshold strategy, which is partially combined with the I frame delay of the transcoded stream. The existing transcoded stream quality judgment strategy is generally: calculate the average value of the time difference between the transcoded stream I frame received in the last 5000ms and the corresponding source stream I frame, and when it exceeds 5000ms, it is determined that the transcoded stream delay sampling value (TCD, transcode video steam delay) has timed out; the time of the last source stream key frame received does not exceed 2S, and the transcoded stream is more than 2000ms from the last packet received, it is determined that the transcoded stream quality does not meet the standard; the current time is 500ms from the time of receiving the first packet of the last key frame, but the corresponding key frame is still not received completely, then the transcoded stream is determined to be unavailable. The transcoding delay under this timeout judgment strategy is calculated only using the key frames in one image group. The transcoding delay cannot accurately reflect the changes in the transcoding status, and it is impossible to make the correct switching decision in time for the transcoding status. The strategy is too dependent on one of the image groups, and the decision-making stability is poor. It also does not consider the integrity of the transcoded stream image group. In addition, the timeout threshold of the strategy is the same fixed value for all viewers, and does not consider the impact of the length of the playback buffer (playerJitterLen) on the audience's playback side and the audience's round-trip time (RTT, Round-Trip Time) on the switching decision. It is impossible to switch to the source stream in time according to changes in the user network and transcoding delay. Based on this, a transcoding stream quality determination method of an embodiment of the present application is provided, which judges the quality of the transcoding stream in real time, and switches to the source stream in a timely and correct manner when the transcoding stream quality is poor to reduce playback jams and improve the user viewing experience. While ensuring that the transcoding stream is fully utilized, the playback side jams are reduced as much as possible, providing a live viewing experience with real-time and smoother picture content.
[0031] Figure 1 A flowchart of a transcoding stream quality determination method provided in an embodiment of the present application is given. The transcoding stream quality determination method provided in an embodiment of the present application can be performed by a transcoding stream quality determination device, which can be implemented in hardware and / or software and integrated in a transcoding stream quality determination device (e.g., an audience video server in a live broadcast scenario).
[0032] The following description is made by taking the transcoding stream quality determination device executing the transcoding stream quality determination method as an example. Figure 1 , the transcoding stream quality determination method includes:
[0033] S110: Determine the integrity of the transcoded stream GOP and the integrity of the source stream GOP.
[0034] Exemplarily, timed checks and calculations are continuously performed in a timer to determine the integrity of the transcoded stream image group and the source stream image group, wherein the integrity of the source stream image group can be determined based on the number of frames in the source stream image group and the number of completely received source stream frames, and similarly, the integrity of the transcoded stream image group can be determined based on the number of completely received transcoded frames in the transcoded stream image group.
[0035] For example, when the number of complete received frames of the source stream image group is the same as the number of complete received frames of the transcoded stream image group, the integrity of the transcoded stream image group is consistent with the integrity of the source stream image group. When the number of complete received frames of the source stream image group is different from the number of complete received frames of the transcoded stream image group, the integrity of the transcoded stream image group is inconsistent with the integrity of the source stream image group. In one embodiment, when the integrity of the transcoded stream image group indicates that the transcoded stream reception is incomplete, the video stream sent to the user can be switched from the transcoded stream to the source stream to ensure the user's viewing experience.
[0036] In one embodiment, the transcoded stream quality determination device can manage the corresponding video stream receiving queues (recvQueue) for video streams of different gears (such as source streams and FHD high-definition gear transcoded streams). The transcoded stream quality determination maintains a linked list of sending and receiving information in units of image groups, records the sending and receiving status of all frames in the corresponding image group, and arranges them in ascending order according to the key frame numbers of the corresponding image group, and stores them in the form of a linked list or an ordered map. For example, the following information is maintained in the recvQueue: the maximum sending frame number GOP of the i-th image group i .maxSendSeq, maximum received frame sequence number GOP i .maxRecvSeq, key frame number GOP i .IFrameSeq, the number of frames contained in the image group GOP i .gopSize, frame playback duration GOP i .gopInterval and the number of complete received frames for this group of pictures GOP i .recvFrameCount.
[0037] The integrity of the transcoded stream image group and the source stream image group is determined according to the number of complete received frames corresponding to the transcoded stream image group and the source stream image group. The integrity difference between the transcoded stream and the source stream can be accurately evaluated. When the integrity of the transcoded stream is inconsistent with that of the source stream, it is switched to the source stream for delivery to ensure smooth video playback on the playback side. For example, when the source stream is received completely but the corresponding transcoded stream is not received completely due to frame loss, decoding and transcoding failure, etc., sending the transcoded stream will cause a stuttering problem on the playback side. At this time, it is switched to the source stream for delivery to effectively ensure smooth playback on the playback side. When the integrity of the transcoded stream is consistent with that of the source stream, the transcoded stream quality is determined based on the available video queue length and the video queue length threshold.
[0038] S120: When the integrity of the transcoded stream image group is consistent with the integrity of the source stream image group, determine the available video queue length of the transcoded stream according to the queue length of the transcoded stream to be sent, the buffer length on the playback side, the length of the video played on the playback side, and the round-trip time of the data packet.
[0039] Exemplarily, when the integrity of the transcoded stream image group and the source stream image group is consistent, the length of the queue to be sent (toBeSentQueueLen), the length of the playback side buffer (lastPlayerJitterLen), the length of the video played on the playback side (recvLastACKPassTime), and the round-trip time of the data packet of the transcoded stream are determined.
[0040] Among them, the length of the queue to be sent of the transcoded stream can be understood as the length of the transcoded stream video data of the corresponding gear (for example, different gears such as ultra-high definition, high definition, and standard definition) waiting to be sent to the playback side in the transcoded stream quality determination device (for example, the total duration of the unsent transcoded stream video frames). The buffer length on the playback side can be understood as the jitter buffer length on the playback side, which can be determined based on the buffer length information (playerJitterLen) carried in the confirmation message replied by the playback side. Optionally, when the playback side returns confirmation information (ACK information) to the transcoded stream quality determination device, it carries the corresponding buffer length information and the reception completion timestamp of each image frame. The length of the video played on the playback side can be understood as the length of the video that has been played on the playback side from the receipt of the latest confirmation information fed back by the playback side to the current time. The round-trip time of the data packet can be understood as the time required for a round trip of the data packet between the transcoded stream quality determination device and the playback side.
[0041] In one embodiment, the available video queue length of the transcoded stream can be determined according to the above-determined to-be-sent queue length, the playback side buffer length, the length of the video played on the playback side, and the round-trip time of the data packet.
[0042] S130: Smoothing the transcoding stream delay sampling value to obtain a smooth transcoding stream delay, determining a smooth transcoding delay timeout according to an absolute value of a difference between the transcoding stream delay sampling value and the smooth transcoding stream delay, and determining a video queue length threshold according to the smooth transcoding delay timeout.
[0043] Exemplarily, a smooth transcoding delay timeout for converting from a source stream image group to a transcoded stream image group is determined, for example, by sampling two positions of a key frame and an intermediate frame (the sequence number of the intermediate frame may be the average of the sequence numbers of the first frame and the last frame in the image group) in the transcoded stream image group and the source stream image group to obtain a transcoded stream delay sampling value, and by smoothing the transcoded stream delay sampling value to obtain a smooth transcoded stream delay. The smooth transcoding delay timeout may be determined based on the absolute value of the difference between the transcoded stream delay sampling value and the smooth transcoded stream delay.
[0044] The transcoding stream delay sampling value is determined according to the difference in reception completion time of the transcoding stream key frame of the transcoding stream image group and the source stream key frame of the source stream image group, or the difference in reception completion time of the transcoding stream intermediate frame of the transcoding stream image group and the source stream intermediate frame of the source stream image group. For example, when the position of the previous sampling is the key frame position of the current transcoding stream image group and the current source stream image group, the transcoding stream delay sampling value of this time is determined according to the difference in reception completion time of the transcoding stream intermediate frame of the transcoding stream image group and the source stream intermediate frame of the source stream image group. When the position of the previous sampling is the intermediate frame position of the current source stream image group and the current transcoding stream image group, the transcoding stream delay sampling value of this time is determined according to the difference in reception completion time of the transcoding stream key frame of the next transcoding stream image group and the source stream key frame of the next source stream image group.
[0045] Optionally, the transcoding stream quality determination method may be executed at preset time intervals (e.g., 1s, 2s, 5s, etc.) to promptly respond to changes in the network and delay, update the video queue length threshold and the available video queue length in real time, and promptly perform transcoding stream quality determination to ensure the user's live video viewing experience. For example, the transcoding stream quality determination method is periodically executed in a second-level timer, that is, the transcoding stream quality determination process is triggered by a 1-second-level timer to continuously monitor the quality of the received transcoding stream. The transcoding stream quality determination process first determines whether the integrity of the transcoding stream is the same as the source stream. If not, it switches to the source stream for delivery. Otherwise, it continues to determine the size relationship between the available video queue length on the transcoding side and the video queue length threshold. If the available video queue length on the transcoding side is sufficient, that is, greater than the video queue length threshold, it continues to keep delivering the transcoding stream. Otherwise, it switches to the source stream for delivery. In addition, when the available video queue length is insufficient (for example, the available video queue length is less than the video queue length threshold), regardless of whether the available video queue length of the source stream is sufficient, the source stream will be switched to be sent, because the source stream is more timely than the transcoded stream, which can minimize the jamming on the playback side.
[0046] In one embodiment, after determining the smooth transcoding delay timeout, the video queue length threshold is determined according to the smooth transcoding delay timeout. The video queue length threshold can be understood as the minimum amount of data stored in the transcoding stream quality determination device that can ensure smooth playback of the transcoded stream video of the corresponding gear on the playback side. Among them, this scheme adds the absolute value of the difference between the transcoding stream delay sampling value and the smooth transcoding stream delay to the determination of the smooth transcoding delay timeout. The video queue length threshold determined based on the smooth transcoding delay timeout will slowly decrease when the transcoding delay decreases, and will rise rapidly when the transcoding delay increases, so that when dealing with the deteriorating transcoding situation, a longer available video queue length can be used to resist the negative impact of transcoding, avoid the audience side from freezing as much as possible, and improve the user's live viewing experience.
[0047] S140: Determine a transcoding stream quality determination result according to a comparison result of the available video queue length and the video queue length threshold.
[0048] Exemplarily, after determining the available video queue length and the video queue length threshold, the available video queue length and the video queue length threshold are compared, and the transcoding stream quality determination result is determined according to the comparison result, so as to determine whether to continue to send the transcoding stream video to the playback side according to the transcoding stream quality determination result. For example, when the transcoding stream quality determination result is up to standard, the video packets corresponding to the transcoding stream can continue to be sent to the playback side, and when the transcoding stream quality determination result is not up to standard, it can be switched to sending the video packets corresponding to the source stream to the playback side, and stop sending the video packets corresponding to the transcoding stream to the playback side, so as to ensure smooth playback of the video on the playback side.
[0049] In one possible embodiment, the transcoding stream quality determination method provided by the present solution determines the transcoding stream quality determination result based on the available video queue length and the video queue length threshold. When the available video queue length is less than the video queue length threshold, the transcoding stream quality determination result is determined to be substandard, and it is necessary to switch from sending the transcoding stream to the user to sending the source stream. When the available video queue length is greater than or equal to the video queue length threshold, the transcoding stream quality determination result is determined to be up to standard, and the transcoding stream can continue to be sent to the user. The present solution accurately determines the transcoding stream quality determination result based on the comparison result of the available video queue length and the video queue length threshold, effectively improving the accuracy and stability of the switching decision, and improving the user's live viewing experience.
[0050] As described above, when the integrity of the transcoded stream image group and the source stream image group is consistent, the available video queue length of the transcoded stream is determined according to the queue length of the transcoded stream to be sent, the buffer length on the playback side, the length of the video played on the playback side, and the round-trip time of the data packet, the transcoded stream delay sampling value is smoothed to obtain the smoothed transcoded stream delay, the smoothed transcoding delay timeout is determined according to the absolute value of the difference between the transcoded stream delay sampling value and the smoothed transcoded stream delay, and the video queue length threshold is determined according to the smoothed transcoding delay timeout, and the comparison result of the available video queue length and the video queue length threshold is used. The transcoding stream quality determination result is determined, wherein the transcoding stream delay sampling value is determined according to the reception completion time difference of the transcoding stream key frame of the transcoding stream image group and the source stream key frame of the source stream image group, or the reception completion time difference of the transcoding stream intermediate frame of the transcoding stream image group and the source stream intermediate frame of the source stream image group, so that the video queue length threshold decreases slowly when the transcoding delay decreases, and increases rapidly when the transcoding delay increases. When the transcoding stream quality is poor, the source stream can be switched in time and correctly to reduce playback jams, thereby ensuring the clarity of the audience while effectively reducing the audience's viewing jams and improving the viewing experience.
[0051] Based on the above embodiments, Figure 2 A flowchart of another transcoding stream quality determination method provided in an embodiment of the present application is given, and the transcoding stream quality determination method is a specific embodiment of the above transcoding stream quality determination method. Figure 2 , the transcoding stream quality determination method includes:
[0052] S210: Determine the integrity of the transcoded stream GOP and the integrity of the source stream GOP.
[0053] S220: When the integrity of the transcoded stream image group is consistent with the integrity of the source stream image group, determine the available video queue length of the transcoded stream according to the queue length of the transcoded stream to be sent, the buffer length on the playback side, the length of the video played on the playback side, and the round-trip time of the data packet.
[0054] In a possible embodiment, the transcoded stream quality determination method provided by the present solution may also determine the reception time of the latest received confirmation information before determining the length of the available video queue of the transcoded stream, and determine the difference between the current time and the time when the confirmation information was received as the length of the video played on the playback side.
[0055] Exemplarily, the latest confirmation information (ACK information) received by the corresponding playback side for the corresponding gear is determined, the reception time of the latest confirmation information received by the transcoding stream quality determination device is determined, and the difference between the current time and the confirmation information reception time is calculated. The difference can be determined as the length of the video played on the playback side, that is, the time elapsed from the receipt of the latest confirmation information to the current time, which indicates that the playback side has played the video of the corresponding length. This solution accurately determines the length of the video played on the playback side through the reception time of the latest confirmation information received, improves the accuracy of determining the length of the queue to be sent, and ensures the quality of transcoding stream quality determination.
[0056] In a possible embodiment, the transcoded stream quality determination method provided by the present scheme may further traverse the transcoded stream image groups in the transcoded stream receiving queue before determining the length of the available video queue of the transcoded stream, and determine the length of the transcoded stream image group to be sent according to the number of unsent transcoded stream image frames of the transcoded stream image group in the transcoded stream receiving queue, the image group size of the transcoded stream image group, and the playback time of the transcoded stream image group; and determine the length of the queue to be sent of the transcoded stream according to the accumulated value of the length to be sent.
[0057] Exemplarily, the transcoded stream image groups in the transcoded stream receiving queue are traversed in reverse order. For each unprocessed transcoded stream image group, the to-be-sent length of the transcoded stream image group can be determined according to the number of unsent transcoded stream image frames of the transcoded stream image group in the transcoded stream receiving queue determined above, the image group size of the transcoded stream image group, and the playback time of the transcoded stream image group. The to-be-sent lengths of the transcoded stream image groups are accumulated, and the to-be-sent length of the next transcoded stream image group is continuously determined. The accumulated value of the to-be-sent length can be used as the to-be-sent queue length of the transcoded stream.
[0058] In one possible embodiment, the scheme provides a method for determining the length of the available video queue of the transcoded stream based on the length of the queue to be sent, the length of the buffer on the playback side, the length of the video played on the playback side, and the round-trip time of the data packet. The method may be to add the length of the queue to be sent and the length of the buffer on the playback side, and subtract the length of the video played on the playback side and the round-trip time of the data packet from the addition result to obtain a subtraction result, and determine the subtraction result as the length of the available video queue of the transcoded stream. The scheme determines the length of the queue to be sent of the transcoded stream based on the cumulative value of the length to be sent of each transcoded stream image group, thereby improving the accuracy of determining the length of the available video queue and ensuring the quality of the transcoded stream quality determination. For example, the length of the queue to be sent can be determined by the following formula:
[0059] availVideoQWueueLen
[0060] =toBeSentQueueLen+lastPlayerJitterLen
[0061] -recvLastACKPassTime-SRTT
[0062] Among them, availVideoQueueLen is the length of the available video queue, toBeSentQueueLen is the length of the queue to be sent, lastPlayerJitterLen is the length of the buffer on the playback side, recvLastACKPassTime is the length of the video played on the playback side, SRTT (smooth round trip time) is the round trip time of the data packet, SRTT refers to the smooth value of the time required for a round trip between the transcoding stream quality determination device and the data packet on the playback side, which can effectively avoid the situation where the length of the queue to be sent fluctuates violently due to the violent fluctuation of the round-trip delay, and improve the accuracy of transcoding stream quality determination. For example, add the product of the preset ratio (for example, 1 / 8) and the current round-trip delay, the difference between 1 and the preset ratio and the product of the last determined round-trip time of the data packet, and determine the addition result as the current round-trip time of the data packet. The calculation formula of recvLastACKPassTime is:
[0063] recvLastACKPassTime=now-lastPlayerJitterLenTimestamp
[0064] Among them, now represents the current timestamp, lastPlayerJitterLenTimestamp is the corresponding received timestamp (confirmation information reception time), and the difference between the two is the time elapsed from the lastPlayerJitterLen of the latest notification to the present. For a certain image group that has not been sent, the corresponding to-be-sent queue length toBeSentQueueLen is calculated as shown in the following formula:
[0065] GOP i .toBeSentQueueLen
[0066] =(GOP i .maxRecvSeq-GOP i .maxSendSeq) / GOP i .gopSize*GOP i .gopInterval
[0067] Its meaning is to calculate the number of remaining unsent frames, multiply it by the corresponding playback time of each frame, and the result is the length of the video queue to be sent for the entire GOP. When calculating the length of the queue to be sent of the transcoded stream toBeSentQueueLen, the length of the queue to be sent can be initialized to 0, toBeSentQueueLen=0, and the transcoded stream image group in the corresponding gear recvQueue is traversed in reverse order. If the image group has been completely sent, exit the current calculation process and return toBeSentQueueLen. If the current image group has not been sent, calculate the corresponding queue length queueLen to be sent for the current image group, and add it to toBeSentQueueLen, and continue to process the next image group.
[0068] S230: Determine the reception completion time of the transcoded stream sampling points in the transcoded stream image group and the reception completion time of the source stream sampling points in the source stream image group, the transcoded stream sampling points include the transcoded stream key frames and the transcoded stream intermediate frames of the transcoded stream image group, and the source stream sampling points include the source stream key frames and the source stream intermediate frames of the source stream image group.
[0069] S240: Subtract the receiving completion time of the transcoded stream sampling point from the receiving completion time of the source stream sampling point to obtain a transcoded stream delay sampling value, smooth the transcoded stream delay sampling value to obtain a smoothed transcoded stream delay, and determine a smoothed transcoded delay timeout according to an absolute value of a difference between the transcoded stream delay sampling value and the smoothed transcoded stream delay.
[0070] Exemplarily, when the last sampling point is the key frame of the current image group, if the intermediate frame of the same image group needs to be sampled this time, the difference between the reception completion time of the transcoded stream intermediate frame of the transcoded stream image group and the reception completion time of the source stream intermediate frame corresponding to the source stream image group is determined as the transcoded stream delay sampling value this time; when the last sampling point is the intermediate frame of the previous image group, if the key frame of the current image group needs to be sampled this time, the difference between the reception completion time of the transcoded stream key frame of the current transcoded stream image group and the reception completion time of the source stream key frame corresponding to the current source stream image group is determined as the transcoded stream delay sampling value this time. After determining the transcoded stream delay sampling value, the transcoded stream delay sampling value can be smoothed to obtain a smoothed transcoded stream delay, and the smoothed transcoded delay timeout is determined according to the absolute value of the difference between the transcoded stream delay sampling value and the smoothed transcoded stream delay.
[0071] This solution uses the key frames and intermediate frames in the transcoded stream image group and the source stream image group as sampling points, and determines the transcoded stream delay sampling value according to the difference in reception completion time of the sampling points. It can accurately reflect the transcoding delay from the source stream image group to the transcoded stream image group, improve the timeliness of the transcoded stream delay sampling value, and can promptly and correctly switch to the source stream when the transcoded stream quality is poor to reduce playback jams and improve the user viewing experience.
[0072] In a possible embodiment, the transcoded stream image groups in the transcoded stream receiving queue can be traversed to determine the reception completion time of the transcoded stream sampling points in the transcoded stream image groups, and the reception completion time of the corresponding source stream sampling points can be further determined according to the corresponding relationship between the frame numbers of the source stream and the transcoded stream. Based on this, the transcoded stream quality determination method provided by the present solution determines the reception completion time of the transcoded stream sampling points in the transcoded stream image groups and the reception completion time of the source stream sampling points in the source stream image groups, which can be: traversing the transcoded stream image groups in the transcoded stream receiving queue, when the last processed frame number corresponding to the transcoded stream image group and the key frame number of the last processed transcoded stream image group are inconsistent, it indicates that the last sample was the middle position of the last image group, and the key frame number of the next image group needs to be sampled this time. When there is no next transcoded stream image group in the transcoded stream receiving queue, the calculation of the transcoded stream delay can be exited. When the next transcoded stream image group exists in the transcoded stream receiving queue, the last processed transcoded stream image group is updated to the next transcoded stream image group, and the last processed frame number is updated to the updated key frame number of the last processed transcoded stream image group, and the receiving completion time corresponding to the updated last processed frame number is determined as the receiving completion time of the transcoded stream sampling point in the transcoded stream image group, and the receiving completion time of the source stream sampling point corresponding to the transcoded stream sampling point is determined. When the last processed frame number corresponding to the transcoded stream image group is consistent with the key frame number of the last processed transcoded stream image group, it indicates that the last sampled was the key frame position of the last image group, and the middle frame position of the image group needs to be sampled this time. If the current transcoded stream image group is not received completely, the calculation of the transcoded stream delay is exited. When the current transcoded stream image group has been completely received, the last processed frame number is updated to the middle frame number of the last processed transcoded stream image group, and the reception completion time corresponding to the updated last processed frame number is determined as the reception completion time of the transcoded stream sampling point in the transcoded stream image group, and the reception completion time of the source stream sampling point corresponding to the transcoded stream sampling point is determined.
[0073] The transcoding stream quality determination device provided by this solution records and maintains the last processed frame sequence number (lastDealFrameSeq) and the last processed picture group (lastDealGOP) corresponding to each gear. In order to improve the timeliness of smooth transcoding delay timeout, each picture group can be sampled twice, the first time is the key frame of the picture group, and the second time is the middle frame of the picture group.
[0074] For example, for the transcoded stream receiving queue recvQueue, the corresponding last processed frame number is lastDealFrameSeq, and the key frame number of the last processed image group lastDealGOP is lastDealFrameSeq. lastDealGOP is initialized to NULL, and lastDealFrameSeq is initialized to -1. If recvQueue is empty, it means that no processing is required and it can be returned without processing. If lastDealGOP is NULL, the recvQueue is traversed from the first image group in the receiving queue recvQueue. If lastDealGOP is not NULL, the processing starts from lastDealGOP.
[0075] If the key frame numbers of lastDealFrameSeq and lastDealGOP are not equal, it means that the last processed was the middle position of the last picture group, and now it is necessary to jump to the next picture group for processing. If there is no next picture group for lastDealGOP, exit the process without processing. Otherwise, set lastDealGOP to the next picture group and lastDealFrameSeq to the key frame number of lastDealGOP. If the key frame numbers of lastDealFrameSeq and lastDealGOP are equal, it means that the last processed was the key frame position of the last picture group, and this time the middle position of this picture group should continue to be processed. If the middle frame of the current picture group has not been received completely, exit without processing; otherwise, set lastDealFrameSeq to the middle frame number of lastDealGOP. In one embodiment, the recvCompleteTimeStamp corresponding to the lastDealFrameSeq of the transcoded stream and the source stream can be found, and the difference between the two is the transcoded stream delay sampling value (TCD, Transcode Video Steam Delay).
[0076] In a possible embodiment, the transcoding stream quality determination method provided by the present solution smoothes the transcoding stream delay sampling value to obtain a smoothed transcoding stream delay, which may be: smoothing the current transcoding stream delay sampling value according to a first smoothing coefficient to obtain a smoothed transcoding stream delay.
[0077] Exemplarily, after determining the current transcoding stream delay sampling value, the current transcoding stream delay sampling value may be smoothed according to the first smoothing coefficient and the transcoding stream delay sampling value determined last time to obtain a smooth transcoding stream delay (STCD, smooth TCD). For example, the product of the first smoothing coefficient (the first smoothing coefficient is less than 1) and the current transcoding stream delay sampling value is added to the product of the third smoothing coefficient (for example, the difference between 1 and the first smoothing coefficient) and the transcoding stream delay sampling value determined last time, and the addition result is determined as the smooth transcoding stream delay. For example, the smooth transcoding stream delay corresponding to the i-th image group may be determined by the following formula:
[0078] STCD(0)=TCD(i=0)
[0079] STCD(i)=(1-α)*STCD(i-1)+α*TCD(i>0)
[0080] Among them, STCD(i) is the smooth transcoding stream delay corresponding to the i-th image group, α is the first smoothing coefficient, for example α=1 / 8 (that is, the current STCD value is determined by the sum of 7 / 8 of the previous STCD value and 1 / 8 of the current TCD value). This solution obtains a smooth transcoding delay timeout by smoothing the transcoding stream delay sampling value, thereby reducing the situation where the transcoding stream delay sampling value is affected by the transcoding machine load, transcoding algorithm, etc. and has a sharp fluctuation, which affects the transcoding stream quality judgment, and improves the accuracy of transcoding stream quality judgment.
[0081] In a possible embodiment, the transcoding stream quality determination method provided by the present solution determines the smooth transcoding delay timeout according to the absolute value of the difference between the transcoding stream delay sampling value and the smooth transcoding stream delay, which may be: the absolute value of the difference between the transcoding stream delay sampling value and the smooth transcoding stream delay is smoothed according to the second smoothing coefficient to obtain the current smooth transcoding delay variance (the initial smooth transcoding delay variance may be set to 0). For example, the product of the second smoothing coefficient (the second smoothing coefficient is less than 1) and the absolute value of the difference between the transcoding stream delay sampling value and the smooth transcoding stream delay is added to the product of the third smoothing coefficient (for example, the difference between 1 and the second smoothing coefficient) and the smooth transcoding delay variance determined last time, and the addition result is determined as the current smooth transcoding delay variance. After determining the current smooth transcoding delay variance, the smooth transcoding stream delay may be added to the current smooth transcoding delay variance of a preset multiple (for example, 2 times), and the addition result is determined as the smooth transcoding delay timeout (STCDTO, smooth TCD timeout). Optionally, the smooth transcoding delay timeout provided by this solution can be determined by the following formula:
[0082] TCDVAR(0)=0(i=0)
[0083] TCDVAR(i)=(1-h)*TCDVAR(i-1)+h*abs(TCD-STCD)(i>0)
[0084] STCDTO=STCD+2*TCDVAR
[0085] Among them, STCDTO is the smooth transcoding delay timeout, STCD is the smooth transcoding stream delay, TCDVAR is the smooth transcoding delay variance, TCD is the transcoding stream delay sampling value, abs(TCD-STCD) is the absolute value of the difference between the transcoding stream delay sampling value and the smooth transcoding stream delay, and h is the second smoothing coefficient, for example, h=1 / 4. Figure 3 A schematic diagram of a change curve of a transcoding stream delay sampling value, a smooth transcoding stream delay, and a smooth transcoding delay timeout is provided, wherein curves A, B, and C are curves of the corresponding values of the transcoding stream delay sampling value, the smooth transcoding stream delay, and the smooth transcoding delay timeout changing with the sample sequence number. It can be seen that the smooth transcoding delay timeout can slowly decrease as the transcoding stream delay sampling value decreases, and quickly increase when the transcoding stream delay sampling value increases. It is not easy to misjudge that transcoding is available when the transcoding delay decreases briefly, and it can identify problems on the transcoding side when the transcoding delay increases rapidly.
[0086] S250: Determine a video queue length threshold according to a smooth transcoding delay timeout.
[0087] In one embodiment, the relationship between the video queue length threshold and the smooth transcoding delay timeout can be fitted by a quadratic equation, for example, the square of the smooth transcoding delay timeout is multiplied by a first preset coefficient, the multiplication result is added to a second preset coefficient, and the addition result is determined as the video queue length threshold, the video queue length threshold is accurately determined, and the accuracy of transcoding stream quality determination is improved. In one embodiment, the smooth transcoding delay timeout can also be multiplied by a first preset coefficient, the multiplication result is added to a second preset coefficient, and the addition result is determined as the value corresponding to the video queue length threshold.
[0088] In one embodiment, the video queue length threshold may be determined by the following formula:
[0089] minVideoQueueLenThres=k*STCDTO 2 +b
[0090] Among them, minVideoQueueLenThres is the value corresponding to the video queue length threshold, STCDTO is the value corresponding to the smooth transcoding delay timeout, k is the first preset coefficient, and b is the second preset coefficient.
[0091] For example, the smooth transcoding delay timeout takes 100 milliseconds as the basic unit, that is, STCDTO=2 represents the smooth transcoding delay timeout is 200ms, and the video queue length threshold takes 50 milliseconds as the basic unit, that is, minVideoQueueLenThres is 16 represents the video queue length threshold is 800ms. Let the following relationships hold: STCDTO=2, minVideoQueueLenThres=16, and STCDTO=10, minVideoQueueLenThres=30, we can solve k=0.146, b=15.42, and get the quadratic equation for determining the video queue length threshold: minVideoQueueLenThres=0.146*STCDTO 2 +15.42. Among them, when the smooth transcoding delay timeout increases evenly, the growth rate of the video queue length threshold is getting faster and faster, and the change trend curve of the video queue length threshold is in line with expectations, that is, in order to cope with the worsening transcoding situation, more and more available video queue lengths are needed to resist the negative impact of transcoding and avoid lag on the viewer side as much as possible.
[0092] S260: Determine a transcoding stream quality determination result according to a comparison result of the available video queue length and the video queue length threshold.
[0093] As described above, when the integrity of the transcoded stream image group and the source stream image group is consistent, the available video queue length of the transcoded stream is determined according to the queue length of the transcoded stream to be sent, the buffer length on the playback side, the length of the video played on the playback side, and the round-trip time of the data packet, the transcoded stream delay sampling value is smoothed to obtain the smoothed transcoded stream delay, the smoothed transcoding delay timeout is determined according to the absolute value of the difference between the transcoded stream delay sampling value and the smoothed transcoded stream delay, and the video queue length threshold is determined according to the smoothed transcoding delay timeout, and the comparison result of the available video queue length and the video queue length threshold is used. The transcoding stream quality determination result is determined, wherein the transcoding stream delay sampling value is determined according to the reception completion time difference of the transcoding stream key frame of the transcoding stream image group and the source stream key frame of the source stream image group, or the reception completion time difference of the transcoding stream intermediate frame of the transcoding stream image group and the source stream intermediate frame of the source stream image group, so that the video queue length threshold decreases slowly when the transcoding delay decreases, and increases rapidly when the transcoding delay increases. When the transcoding stream quality is poor, the source stream can be switched in time and correctly to reduce playback jams, thereby ensuring the clarity of the audience while effectively reducing the audience's viewing jams and improving the viewing experience.
[0094] Figure 4 Schematic diagram of a transcoding stream quality determination device provided by an embodiment of the present application. Figure 4The transcoded stream quality determination device includes an integrity determination module 41, a length determination module 42, a threshold determination module 43 and a quality determination module 44.
[0095] Among them, the integrity determination module 41 is configured to determine the integrity of the transcoded stream image group and the integrity of the source stream image group; the length determination module 42 is configured to determine the available video queue length of the transcoded stream according to the queue length to be sent of the transcoded stream, the buffer length of the playback side, the length of the video played on the playback side, and the round-trip time of the data packet when the integrity of the transcoded stream image group is consistent with the integrity of the source stream image group; the threshold determination module 43 is configured to smooth the transcoded stream delay sampling value to obtain a smooth transcoded stream delay, determine the smooth transcoding delay timeout according to the absolute value of the difference between the transcoded stream delay sampling value and the smooth transcoded stream delay, and determine the video queue length threshold according to the smooth transcoding delay timeout, wherein the transcoded stream delay sampling value is determined according to the difference in reception completion time of the transcoded stream key frame of the transcoded stream image group and the source stream key frame of the source stream image group, or the difference in reception completion time of the transcoded stream intermediate frame of the transcoded stream image group and the source stream intermediate frame of the source stream image group; the quality determination module 44 is configured to determine the transcoded stream quality determination result according to the comparison result of the available video queue length and the video queue length threshold.
[0096] As described above, when the integrity of the transcoded stream image group and the source stream image group is consistent, the available video queue length of the transcoded stream is determined according to the queue length of the transcoded stream to be sent, the buffer length on the playback side, the length of the video played on the playback side, and the round-trip time of the data packet, the transcoded stream delay sampling value is smoothed to obtain the smoothed transcoded stream delay, the smoothed transcoding delay timeout is determined according to the absolute value of the difference between the transcoded stream delay sampling value and the smoothed transcoded stream delay, and the video queue length threshold is determined according to the smoothed transcoding delay timeout, and the available video queue length is compared with the video queue length threshold. The result determines the transcoding stream quality judgment result, wherein the transcoding stream delay sampling value is determined according to the reception completion time of the transcoding stream key frame of the transcoding stream image group and the source stream key frame of the source stream image group, or the reception completion time of the transcoding stream intermediate frame of the transcoding stream image group and the source stream intermediate frame of the source stream image group, so that the video queue length threshold decreases slowly when the transcoding delay decreases, and increases rapidly when the transcoding delay increases. When the transcoding stream quality is poor, the source stream can be switched in time and correctly to reduce playback jams, thereby ensuring the audience clarity while effectively reducing the audience viewing jams and improving the viewing experience.
[0097] In a possible embodiment, the integrity determination module 41 determines the integrity of the transcoded stream image group and the integrity of the source stream image group, and is configured to: determine the number of complete received frames of the source stream image group, and determine the integrity of the source stream image group based on the number of complete received frames of the source stream image group; determine the number of complete received frames of the transcoded stream image group, and determine the integrity of the transcoded stream image group based on the number of complete received frames of the transcoded stream image group.
[0098] In a possible embodiment, the transcoded stream quality determination device further includes a sending execution module, which is configured to: when the integrity of the transcoded stream image group indicates that the transcoded stream reception is incomplete, switch the video stream sent to the user from the transcoded stream to the source stream.
[0099] In one possible embodiment, the length determination module 42 determines the available video queue length of the transcoded stream based on the queue length of the transcoded stream to be sent, the buffer length on the playback side, the length of the video played on the playback side, and the round-trip time of the data packet, and is configured as follows: adding the queue length of the transcoded stream to be sent and the buffer length on the playback side, and subtracting the length of the video played on the playback side and the round-trip time of the data packet from the addition result to obtain a subtraction result, and determining the subtraction result as the available video queue length of the transcoded stream.
[0100] In a possible embodiment, before determining the available video queue length of the transcoded stream, the length determination module 42 is further configured to: determine the reception time of the latest received confirmation information, and determine the difference between the current time and the confirmation information reception time as the length of the video played on the playback side.
[0101] In a possible embodiment, before determining the available video queue length of the transcoded stream, the length determination module 42 is further configured to:
[0102] Traversing the transcoded stream image groups in the transcoded stream receiving queue, and determining the to-be-sent length of the transcoded stream image group according to the number of unsent transcoded stream image frames of the transcoded stream image group in the transcoded stream receiving queue, the image group size of the transcoded stream image group, and the playback time of the transcoded stream image group;
[0103] The length of the queue to be sent of the transcoded stream is determined according to the accumulated value of the length to be sent.
[0104] In a possible embodiment, before smoothing the transcoding stream delay sample value to obtain the smoothed transcoding stream delay, the length determination module 42 is further configured to:
[0105] Determine the reception completion time of the transcoded stream sampling points in the transcoded stream image group and the reception completion time of the source stream sampling points in the source stream image group, the transcoded stream sampling points include the transcoded stream key frames and the transcoded stream intermediate frames of the transcoded stream image group, and the source stream sampling points include the source stream key frames and the source stream intermediate frames of the source stream image group;
[0106] The transcoded stream delay sampling value is obtained by subtracting the receiving completion time of the transcoded stream sampling point from the receiving completion time of the source stream sampling point.
[0107] In a possible embodiment, the length determination module 42 determines the reception completion time of the transcoded stream sampling point in the transcoded stream image group and the reception completion time of the source stream sampling point in the source stream image group, and is configured as follows:
[0108] Traversing the transcoded stream image groups in the transcoded stream receiving queue, when the last processed frame sequence number corresponding to the transcoded stream image group is inconsistent with the key frame sequence number of the last processed transcoded stream image group, updating the last processed transcoded stream image group to the next transcoded stream image group, and updating the last processed frame sequence number to the updated key frame sequence number of the last processed transcoded stream image group, and determining the receiving completion time corresponding to the updated last processed frame sequence number as the receiving completion time of the transcoded stream sampling point in the transcoded stream image group, and determining the receiving completion time of the source stream sampling point corresponding to the transcoded stream sampling point;
[0109] When the last processed frame number corresponding to the transcoded stream image group is consistent with the key frame number of the last processed transcoded stream image group, the last processed frame number is updated to the intermediate frame number of the last processed transcoded stream image group, and the reception completion time corresponding to the updated last processed frame number is determined as the reception completion time of the transcoded stream sampling point in the transcoded stream image group, and the reception completion time of the source stream sampling point corresponding to the transcoded stream sampling point is determined.
[0110] In a possible embodiment, the length determination module 42 performs smoothing processing on the transcoding stream delay sampling value to obtain the smoothed transcoding stream delay, and is configured to: perform smoothing processing on the current transcoding stream delay sampling value according to the first smoothing coefficient to obtain the smoothed transcoding stream delay.
[0111] In a possible embodiment, the length determination module 42 determines the smooth transcoding delay timeout according to the absolute value of the difference between the transcoding stream delay sampling value and the smooth transcoding stream delay, and is configured as follows:
[0112] Smoothing the absolute value of the difference between the transcoding stream delay sampling value and the smoothed transcoding stream delay according to the second smoothing coefficient to obtain a current smoothed transcoding delay variance;
[0113] The smooth transcoding delay timeout is obtained by adding the smooth transcoding stream delay to the current smooth transcoding delay variance of a preset multiple.
[0114] In a possible embodiment, the threshold determination module 43 determines the video queue length threshold according to the smooth transcoding delay timeout, and is configured as: multiplying the square of the smooth transcoding delay timeout by a first preset coefficient, and adding the multiplication result to a second preset coefficient to obtain the video queue length threshold.
[0115] In a possible embodiment, the quality judgment module 44 determines the transcoding stream quality judgment result based on the comparison result of the available video queue length and the video queue length threshold, and is configured as follows: when the available video queue length is less than the video queue length threshold, the transcoding stream quality judgment result is determined to be substandard.
[0116] It is worth noting that in the embodiment of the above-mentioned transcoding stream quality determination device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
[0117] The embodiment of the present application further provides a transcoding stream quality determination device, and the transcoding stream quality determination device can be integrated with the transcoding stream quality determination apparatus provided in the embodiment of the present application. Figure 5 Schematic diagram of a transcoding stream quality determination device provided by an embodiment of the present application. Figure 5 The transcoding stream quality determination device includes: an input device 53, an output device 54, a memory 52 and one or more processors 51; the memory 52 is used to store one or more programs; when the one or more programs are executed by the one or more processors 51, the one or more processors 51 implement the transcoding stream quality determination method provided in the above embodiment. The transcoding stream quality determination device, equipment and computer provided above can be used to execute the transcoding stream quality determination method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
[0118] The embodiment of the present application also provides a non-volatile storage medium storing computer executable instructions, which are used to execute the transcoding stream quality determination method provided in the above embodiment when executed by a computer processor. Of course, the non-volatile storage medium storing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the transcoding stream quality determination method provided above, can also execute the related operations in the transcoding stream quality determination method provided in any embodiment of the present application. The transcoding stream quality determination device, equipment and storage medium provided in the above embodiment can execute the transcoding stream quality determination method provided in any embodiment of the present application. For technical details not described in detail in the above embodiment, please refer to the transcoding stream quality determination method provided in any embodiment of the present application.
[0119] On the basis of the above embodiments, the embodiments of the present application also provide a computer program product. The technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer program product is stored in a storage medium, and includes a number of instructions for enabling a computer device, a mobile terminal or a processor therein to execute all or part of the steps of the transcoding stream quality determination method provided in each embodiment of the present application.
Claims
1. A method for determining the quality of a transcoded stream, characterized in that: include: Determining the integrity of the transcoded stream group of pictures and the integrity of the source stream group of pictures; When the integrity of the transcoded stream image group is consistent with the integrity of the source stream image group, determining the available video queue length of the transcoded stream according to the queue length of the transcoded stream to be sent, the buffer length of the playback side, the length of the video played on the playback side, and the round trip time of the data packet; Smoothing the transcoding stream delay sampling value to obtain a smooth transcoding stream delay, determining a smooth transcoding delay timeout according to an absolute value of a difference between the transcoding stream delay sampling value and the smooth transcoding stream delay, and determining a video queue length threshold according to the smooth transcoding delay timeout, wherein the transcoding stream delay sampling value is determined according to a difference in reception completion time of a transcoding stream key frame of a transcoding stream image group and a source stream key frame of a source stream image group, or a difference in reception completion time of a transcoding stream intermediate frame of a transcoding stream image group and a source stream intermediate frame of a source stream image group; The transcoding stream quality determination result is determined according to a comparison result of the available video queue length and the video queue length threshold.
2. The method for determining transcoding stream quality according to claim 1, characterized in that: The determining the integrity of the transcoded stream image group and the integrity of the source stream image group includes: Determine the number of complete received frames of the source stream image group, and determine the integrity of the source stream image group based on the number of complete received frames of the source stream image group; determine the number of complete received frames of the transcoded stream image group, and determine the integrity of the transcoded stream image group based on the number of complete received frames of the transcoded stream image group.
3. The method for determining transcoding stream quality according to claim 2, characterized in that: After determining the integrity of the transcoded stream image group according to the number of complete received frames of the transcoded stream image group, the method further includes: When the integrity of the transcoded stream image group indicates that the transcoded stream reception is incomplete, the video stream sent to the user is switched from the transcoded stream to the source stream.
4. The method for determining transcoding stream quality according to claim 1, wherein: The method of determining the available video queue length of the transcoded stream according to the queue length to be sent of the transcoded stream, the buffer length of the playback side, the length of the video played on the playback side, and the round trip time of the data packet includes: The length of the queue to be sent of the transcoded stream and the length of the buffer on the playback side are added together, and the length of the video played on the playback side and the round-trip time of the data packet are subtracted from the addition result to obtain a subtraction result, which is determined as the available video queue length of the transcoded stream.
5. The method for determining transcoding stream quality according to claim 1, characterized in that: Before determining the available video queue length of the transcoding stream, the method further includes: The receiving time of the latest received confirmation information is determined, and the difference between the current time and the receiving time of the confirmation information is determined as the length of the video played on the playback side.
6. The method for determining transcoding stream quality according to claim 1, characterized in that: Before determining the available video queue length of the transcoding stream, the method further includes: Traversing the transcoded stream image groups in the transcoded stream receiving queue, and determining the to-be-sent length of the transcoded stream image group according to the number of unsent transcoded stream image frames of the transcoded stream image group in the transcoded stream receiving queue, the image group size of the transcoded stream image group, and the playback time of the transcoded stream image group; The length of the queue to be sent of the transcoded stream is determined according to the accumulated value of the length to be sent.
7. The method for determining transcoding stream quality according to claim 1, characterized in that: Before the smoothing of the transcoding stream delay sample value to obtain the smoothed transcoding stream delay, the method further includes: Determine the reception completion time of the transcoded stream sampling points in the transcoded stream image group and the reception completion time of the source stream sampling points in the source stream image group, wherein the transcoded stream sampling points include the transcoded stream key frames and the transcoded stream intermediate frames of the transcoded stream image group, and the source stream sampling points include the source stream key frames and the source stream intermediate frames of the source stream image group; The transcoded stream delay sampling value is obtained by subtracting the receiving completion time of the transcoded stream sampling point from the receiving completion time of the source stream sampling point.
8. The method for determining transcoding stream quality according to claim 7, characterized in that: The determining of the receiving completion time of the transcoded stream sampling point in the transcoded stream image group and the receiving completion time of the source stream sampling point in the source stream image group comprises: Traversing the transcoded stream image groups in the transcoded stream receiving queue, when the last processed frame sequence number corresponding to the transcoded stream image group is inconsistent with the key frame sequence number of the last processed transcoded stream image group, updating the last processed transcoded stream image group to the next transcoded stream image group, and updating the last processed frame sequence number to the updated key frame sequence number of the last processed transcoded stream image group, and determining the receiving completion time corresponding to the updated last processed frame sequence number as the receiving completion time of the transcoded stream sampling point in the transcoded stream image group, and determining the receiving completion time of the source stream sampling point corresponding to the transcoded stream sampling point; In the case that the last processed frame sequence number corresponding to the transcoded stream image group is consistent with the key frame sequence number of the last processed transcoded stream image group, the last processed frame sequence number is updated to the intermediate frame sequence number of the last processed transcoded stream image group, and the reception completion time corresponding to the updated last processed frame sequence number is determined as the reception completion time of the transcoded stream sampling point in the transcoded stream image group, and the reception completion time of the source stream sampling point corresponding to the transcoded stream sampling point is determined.
9. The method for determining transcoding stream quality according to claim 7, characterized in that: The step of smoothing the transcoding stream delay sample values to obtain a smooth transcoding stream delay includes: The current transcoding stream delay sampling value is smoothed according to the first smoothing coefficient to obtain a smoothed transcoding stream delay.
10. The method for determining transcoding stream quality according to claim 9, characterized in that: The determining the smooth transcoding delay timeout according to the absolute value of the difference between the transcoding stream delay sampling value and the smooth transcoding stream delay comprises: Smoothing the absolute value of the difference between the transcoding stream delay sampling value and the smoothed transcoding stream delay according to a second smoothing coefficient to obtain a current smoothed transcoding delay variance; The smooth transcoding delay timeout is obtained by adding the smooth transcoding stream delay to a preset multiple of the current smooth transcoding delay variance.
11. The method for determining transcoding stream quality according to claim 1, characterized in that: The step of determining a video queue length threshold according to the smooth transcoding delay timeout includes: The square of the smooth transcoding delay timeout is multiplied by a first preset coefficient, and the multiplication result is added to a second preset coefficient to obtain a video queue length threshold.
12. The method for determining transcoding stream quality according to claim 1, characterized in that: The determining the transcoding stream quality determination result according to the comparison result of the available video queue length and the video queue length threshold comprises: When the available video queue length is less than the video queue length threshold, it is determined that the transcoding stream quality determination result is not up to standard.
13. A transcoded stream quality determination device, characterized in that: It includes an integrity determination module, a length determination module, a threshold determination module and a quality determination module, wherein: The integrity determination module is configured to determine the integrity of the transcoded stream image group and the integrity of the source stream image group; The length determination module is configured to determine the available video queue length of the transcoded stream according to the queue length to be sent of the transcoded stream, the buffer length of the playback side, the length of the video played on the playback side, and the round trip time of the data packet when the integrity of the transcoded stream image group is consistent with the integrity of the source stream image group; The threshold determination module is configured to perform smoothing processing on the transcoding stream delay sampling value to obtain a smooth transcoding stream delay, determine a smooth transcoding delay timeout according to an absolute value of a difference between the transcoding stream delay sampling value and the smooth transcoding stream delay, and determine a video queue length threshold according to the smooth transcoding delay timeout, wherein the transcoding stream delay sampling value is determined according to a reception completion time difference between a transcoding stream key frame of a transcoding stream image group and a source stream key frame of a source stream image group, or a reception completion time difference between a transcoding stream intermediate frame of a transcoding stream image group and a source stream intermediate frame of a source stream image group; The quality determination module is configured to determine a transcoding stream quality determination result according to a comparison result of the available video queue length and the video queue length threshold.
14. A transcoded stream quality determination device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the transcoding stream quality determination method according to any one of claims 1 to 12.
15. A non-volatile storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to execute the transcoding stream quality determination method according to any one of claims 1 to 12 when executed by a computer processor.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for determining the quality of a transcoded stream according to any one of claims 1 to 12 is implemented.