Video playing method and device, electronic equipment and computer readable storage medium

The client adjusts the video playback speed according to the network transmission performance, solves the problem of lag in online video playback, and achieves efficient fluency and low resource consumption.

CN120602718APending Publication Date: 2025-09-05TAOBAO CHINA SOFTWARE
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510758444.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

During online video playback, video stuttering due to factors such as network fluctuations, server load and user bandwidth limitations. The existing technology solves the stuttering problem by dynamically adjusting the code rate of the server, but this occupies a large amount of computing resources and network bandwidth, and the effect is not good.

Method used

The client updates the sampling frequency according to the current network transmission performance, obtains the video buffer amount, adjusts the video playback speed, reduces the use of server computing resources and network bandwidth, and controls the playback speed by reflecting the network status by reflecting the video buffer amount.

Benefits of technology

It improves the smoothness of video playback, reduces the consumption of server computing resources and network bandwidth, effectively solves the phenomenon of lag, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602718A_ABST
    Figure CN120602718A_ABST
Patent Text Reader

Abstract

The invention discloses a video playing method and device, electronic equipment and a computer readable storage medium. The video playing method comprises the following steps: acquiring current network transmission performance corresponding to a client; according to the current network transmission performance, a sampling frequency is updated, and the sampling frequency is in negative correlation with the current network transmission performance; according to the updated sampling frequency, obtaining the buffer capacity of the video which is not played at present by the client; the video playing speed of the client side is determined according to the newly obtained video buffering capacity, the client side is controlled to play a video according to the video playing speed, and the video playing speed is in positive correlation with the video buffering capacity. Through the scheme provided by the invention, the consumption of server computing resources and the occupation of network bandwidth in the video playing process can be reduced, the video playing fluency is improved, and the jamming phenomenon is better solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a video playback method, device, electronic device, and computer-readable storage medium. Background Art

[0002] With the increase in internet bandwidth and the widespread adoption of mobile devices, users are consuming video content in a shift from traditional local playback to online streaming, such as live streaming and online video streaming. However, online video playback often experiences lags due to factors such as network fluctuations, server load, and user bandwidth limitations, severely impacting user experience.

[0003] Related technologies: When a video freezes, the server usually dynamically adjusts the bit rate according to the network bandwidth. When the network bandwidth is low, the bit rate of the transmitted video is reduced so that the video can be transmitted smoothly to reduce freezes. When the network bandwidth is high, the bit rate of the transmitted video is increased. The server then encodes the video according to the adjusted bit rate and sends it to the client.

[0004] However, the method of adjusting the bit rate requires the server to continuously calculate the adjusted bit rate based on the bandwidth status. Since there are a large number of clients connected to the server, calculating the bit rate for each client will occupy a relatively large amount of computing resources on the server side. The bit rate calculation process will also consume a relatively large amount of network bandwidth, thereby occupying the bandwidth of video transmission, affecting the smoothness of video playback, and the effect of solving the lag problem is not good. Summary of the Invention

[0005] This application provides a video playback method, device, electronic device, and computer-readable storage medium that can reduce the consumption of server computing resources and network bandwidth during video playback, improve the smoothness of video playback, and better solve the problem of lag. The specific solution is as follows:

[0006] In a first aspect, the present application provides a video playback method, the method comprising:

[0007] Get the current network transmission performance corresponding to the client;

[0008] Updating a sampling frequency according to the current network transmission performance, wherein the sampling frequency is negatively correlated with the current network transmission performance;

[0009] Obtaining the amount of video buffer that is not currently played by the client according to the updated sampling frequency;

[0010] The video playback speed of the client is determined according to the newly acquired video buffer amount, and the client is controlled to play the video at the video playback speed, wherein the video playback speed is positively correlated with the video buffer amount.

[0011] Optionally, determining the video playback speed of the client according to the newly acquired video buffer amount includes:

[0012] When the newly acquired video buffer amount is greater than the first buffer threshold, determining a playback speed greater than or equal to 1 as the video playback speed of the client;

[0013] When the newly acquired video buffer amount is less than or equal to the first buffer threshold, a playback speed less than 1 is determined as the video playback speed of the client.

[0014] Optionally, determining a playback speed greater than or equal to 1 as the video playback speed of the client includes:

[0015] When the newly acquired video buffer amount is greater than a second buffer threshold, determining a playback speed greater than 1 as the video playback speed of the client, and the second buffer threshold is greater than the first buffer threshold;

[0016] When the newly acquired video buffer amount is less than or equal to the second buffer threshold, a 1x playback speed is determined as the video playback speed of the client.

[0017] Optionally, the first buffer threshold is a first multiple of a preset ideal buffer upper limit, the second buffer threshold is the ideal buffer upper limit, and the first multiple is less than 1.

[0018] Optionally, before determining the video playback speed of the client according to the newly acquired video buffer amount, the method further includes:

[0019] Obtaining the video download speed of the client according to the updated sampling frequency;

[0020] The determining the video playback speed of the client according to the newly acquired video buffer amount includes:

[0021] The video playback speed of the client is determined according to the newly acquired video buffer amount and with the newly acquired video download speed as a constraint condition.

[0022] Optionally, determining a playback speed greater than or equal to 1 as the video playback speed of the client includes:

[0023] When the newly acquired video buffer amount is greater than a second buffer threshold and the newly acquired video download speed is greater than a first speed threshold, determining a playback speed greater than 1 as the video playback speed of the client, and the second buffer threshold is greater than the first buffer threshold;

[0024] When the newly acquired video buffer amount is greater than the second buffer threshold and the newly acquired video download speed is less than or equal to the first speed threshold, 1x playback speed is determined as the video playback speed of the client.

[0025] Optionally, the first speed threshold is a second multiple of a preset lower limit of an ideal download speed, and the second multiple is a multiple greater than 1.

[0026] Optionally, determining the video playback speed of the client according to the newly acquired video buffer amount includes:

[0027] Determining a buffer health score corresponding to the video buffer amount according to the newly acquired video buffer amount;

[0028] The video playback speed of the client is determined according to the buffer health score.

[0029] Optionally, controlling the client to play the video at the video playback speed includes:

[0030] When the determined video playback speed is different from the current playback speed of the client, the client is controlled to gradually change the playback speed to the video playback speed in a preset speed step-by-step adjustment manner.

[0031] Optionally, the speed gradual adjustment method includes at least one of the following:

[0032] Determining multiple transition speeds between the current playback speed of the client and the video playback speed, and adjusting the video played by the client to the multiple transition speeds in sequence and then adjusting it to the video playback speed;

[0033] The playback speed of the client is adjusted to the video playback speed in a manner of uniformly adjusting the playback speed, wherein the uniformly adjusting the playback speed means that the speed adjustment amount per unit time is the same.

[0034] Optionally, the method further includes:

[0035] When a jamming phenomenon is detected, determining a severity of the jamming phenomenon;

[0036] A jamming adjustment strategy is determined based on the severity of the jamming phenomenon, and the jamming adjustment strategy includes at least one of the following: reducing the video playback speed of the client, clearing the video buffered by the client, reducing the clarity of the transmitted video, and controlling the client to re-establish a connection with the server.

[0037] Optionally, the jamming phenomenon includes at least one of the following:

[0038] The video playback on the client is interrupted;

[0039] The video display frame rate of the client is lower than the preset frame rate;

[0040] The audio playback on the client is intermittent;

[0041] The amount of unplayed videos buffered by the client is less than a third buffer threshold, and the third buffer threshold is less than the first buffer threshold;

[0042] No data transmission occurs on the client side;

[0043] The audio timestamp played by the client is inconsistent with the video timestamp.

[0044] Optionally, the severity includes mild lag, moderate lag, and severe lag;

[0045] Determining a jam adjustment strategy according to the severity of the jam phenomenon includes:

[0046] When the jamming phenomenon is mild, if the current playback speed of the client is greater than 1 times the playback speed, reduce the video playback speed of the client; if the current playback speed of the client is less than or equal to 1 times the playback speed, clear the video buffered by the client;

[0047] When the jamming phenomenon is moderate, clearing the video buffered by the client and reducing the definition of the transmitted video;

[0048] When the jamming phenomenon is severe, the video buffered by the client is cleared, the definition of the transmitted video is reduced, and the client and the server are controlled to re-establish a connection.

[0049] Optionally, the mild freeze includes: the amount of unplayed video buffered by the client is less than a third buffer threshold;

[0050] Moderate lag includes at least one of the following: interruption of video playback on the client, intermittent audio playback on the client, no data transmission on the client, inconsistency between the audio timestamp and the video timestamp played on the client;

[0051] The severe freeze includes at least one of the following: the video display frame rate of the client is less than the preset frame rate, the client is continuously interrupted for more than a first preset time, the client has no data transmission for more than a second preset time, and the connection between the client and the server is disconnected.

[0052] Optionally, the method further includes:

[0053] In response to a resume playback instruction triggered by the user when the video is paused, the video is played by jumping to a target position, where the target position is a video playback position corresponding to when the unplayed buffer remaining amount is a preset remaining amount.

[0054] In a second aspect, the present application provides a video playback device, comprising:

[0055] A first acquiring unit, configured to acquire the current network transmission performance corresponding to the client;

[0056] an updating unit, configured to update a sampling frequency according to the current network transmission performance, wherein the sampling frequency is negatively correlated with the current network transmission performance;

[0057] A buffer monitoring unit, configured to obtain a buffer amount of videos not currently played by the client according to the updated sampling frequency;

[0058] The speed adjustment unit is used to determine the video playback speed of the client according to the newly obtained video buffer amount, and control the client to play the video at the video playback speed, wherein the video playback speed is positively correlated with the video buffer amount.

[0059] In a third aspect, the present application also provides an electronic device comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor; when the processor executes the computer program instructions, the method as described in any one of the first aspects is implemented.

[0060] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement any of the methods described in the first aspect.

[0061] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method as described in any one of the first aspects.

[0062] Compared with the prior art, this application has the following advantages:

[0063] The video playback method provided in the embodiment of the present application obtains the current network transmission performance corresponding to the client, and the network transmission performance can reflect the speed at which the client can obtain video data from the server. When the network transmission performance is good, the client obtains the video from the server faster, and when the network transmission performance is poor, the client obtains the video from the server slower. Then, the sampling frequency is updated according to the current network transmission performance, and the amount of video buffer that is not currently played on the client is obtained according to the updated sampling frequency, and the video playback speed of the client is determined according to the newly obtained video buffer. Since the sampling frequency is negatively correlated with the current network transmission performance, that is, the better the network transmission performance, the lower the sampling frequency. When the network transmission performance is good, it means that the client The video data transmission speed between the client and the server is faster and smoother. In this case, playback delays, freezes, etc. are usually less likely to occur, so there is no need to constantly adjust the client's video playback speed to solve delays and freezes. Instead, the normal playback speed can be maintained. The adjustment of the video playback speed is based on the acquisition of a new video buffer amount as a trigger condition. Therefore, when the network transmission performance is good, the sampling frequency is set relatively low, so that the frequency of adjusting the video playback speed can be reduced when the network transmission performance is good, thereby achieving high efficiency and effectiveness of video playback speed adjustment. When the network transmission performance is poor, the sampling frequency is set relatively high, so that the speed can be adjusted in time when the video is delayed and freezes, so as to timely reduce freezes and delays.

[0064] In addition, when adjusting the playback speed, the present application adjusts the video playback speed according to the video buffering amount of the client. This operation can be completed by the client, and the client can easily obtain the amount of buffered and unplayed video, so that the video playback speed can be flexibly and conveniently adjusted according to the obtained video buffering amount. Since the amount of unplayed video buffering reflects the smoothness of the client receiving the video from the server, when the amount of unplayed video buffering is large, it means that the current network transmission performance is relatively good, and the video data of the server can be transmitted to the client in time. When the amount of unplayed video buffering is small, it means that the current network transmission performance may be relatively poor, and the video data of the server may not be able to be transmitted to the client in time. The video transmission may be delayed or stuck. Therefore, when determining the video playback speed, the present application makes the video playback speed positively correlated with the video buffering amount, that is, the more the video buffering amount, the faster the playback speed is set, so that the buffered video can be played in time. The less the video buffering amount, the slower the playback speed is set, so that the delay and stuck during video playback can be reduced.

[0065] Since there is no need to calculate the adjusted video bit rate based on the network bandwidth, the server does not need to participate in the calculation of the video bit rate. Instead, the client can adjust and control the video playback speed based on the video buffer amount, reducing the consumption of server computing resources and network bandwidth during video playback, improving the smoothness of video playback, and better solving the problem of lag. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 This is a schematic diagram of the application scenario of the video playback control solution provided by this application;

[0067] Figure 2 This is a flowchart of an example of a video playback method provided in an embodiment of the present application;

[0068] Figure 3 is a flowchart of another example of the video playback method provided in an embodiment of the present application;

[0069] Figure 4 This is a structural block diagram of an example of a video playback device provided in an embodiment of the present application;

[0070] Figure 5 is a structural block diagram of another example of a video playback device provided in an embodiment of the present application;

[0071] Figure 6 This is a structural block diagram of the electronic device provided in this application. DETAILED DESCRIPTION

[0072] In order to enable those skilled in the art to better understand the technical solutions of this application, the following clearly and completely describes this application in conjunction with the drawings in the embodiments of this application. However, this application can be implemented in many other ways different from the following description. Therefore, based on the embodiments provided in this application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of this application.

[0073] It should be noted that the terms "first", "source domain", "third", etc. in the claims, description and drawings of the present application are used to distinguish similar objects and are not used to describe a specific order or sequence. The data used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including", "having" and their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0074] In order to facilitate understanding of the various embodiments of the present application, the application background of the embodiments is described.

[0075] With the increase in internet bandwidth and the prevalence of mobile devices and other terminal devices, users' consumption of video content has gradually shifted from traditional local playback to online playback, such as live video streaming and online video streaming. However, during online video playback, lags often occur due to factors such as network fluctuations, server load, and user bandwidth limitations, seriously affecting the user experience. Related technologies typically use servers to dynamically adjust the bitrate based on network bandwidth when video lag occurs. When the network bandwidth is low, the bitrate of the transmitted video is reduced to ensure smooth video transmission and reduce lags. When the network bandwidth is high, the bitrate of the transmitted video is increased. The server then encodes the video at the adjusted bitrate and sends it to the client. However, this bitrate adjustment method requires the server to continuously calculate the adjusted bitrate based on the bandwidth status. Due to the large number of clients connected to the server, calculating the bitrate for each client consumes a considerable amount of server computing resources. The bitrate calculation process also consumes a considerable amount of network bandwidth, which in turn occupies the bandwidth available for video transmission, affecting the smoothness of video playback and effectively resolving lags.

[0076] To address the above issues, embodiments of the present application provide a video playback method, apparatus, electronic device, video playback control system, and computer-readable storage medium. These methods are designed to reduce server computing resource consumption and network bandwidth usage during video playback, improve video playback fluency, and better resolve video lag.

[0077] The video playback method provided in this application can be applied to live video playback, and can also be applied to other non-live video playback, for example, it can be applied to online video playback, and this application does not specifically limit it.

[0078] In order to facilitate understanding of the method embodiment of this application, its application scenario is introduced. Figure 1 , Figure 1 The following is a schematic diagram of an application scenario of the solution provided in the embodiment of the present application. This application scenario is a schematic illustration and is not intended to be a specific description of its application scenario. Figure 1 As shown, in this application scenario, a server 102 and a client 101 are provided. In this embodiment, a connection is established between the client 101 and the server 102 via network communication, thereby performing data transmission.

[0079] The client 101 can be an electronic device with display and data processing functions, such as a mobile phone, tablet computer (pad), smart watch, desktop computer, smart TV, VR device, vehicle-mounted device, wearable device, laptop computer, etc. The client 101 is used to obtain video from the server 102 in real time and play the video after buffering a certain amount of video. The client can also be used to receive user input of video operation instructions, which can include pausing, playing, speed control, etc. of the video, and perform corresponding operations on the video according to the instructions input by the user. The client 101 is also used to control the video playback speed according to the remaining video buffer amount. The client 101 can also be used to send access requests, interactive information, etc. to the server 102, so that the server 102 sends the corresponding request data to the client 101 for display.

[0080] The server 102 has high computing power. The server 102 can be a server, which has a high-speed processor (central processing unit, CPU) computing power, long-term reliable operation, powerful input / output (input / output, I / O) external data throughput capacity and better scalability. The server 102 can be a single server or a server cluster. The server 102 is used to obtain live video data from the streaming end and send it to the client 101, or send the video already stored in the server to the client 101. The server 102 can also provide other specific services for the client 101, such as user information access, website access, application access, etc., which are not specifically limited in this application.

[0081] The client 101 and the server 102 may communicate with each other using various communication systems, such as a wired communication system or a wireless communication system. Examples of the wireless communication system include the global system for mobile communications (GSM), code division multiple access (CDMA), wideband code division multiple access (WCDMA), general packet radio service (GPRS), long term evolution (LTE), LTE frequency division duplex (FDD), LTE time division duplex (TDD), universal mobile telecommunication system (UMTS), worldwide interoperability for microwave access (WiMAX), future fifth generation (5G) or new radio (NR), satellite communication systems, and the like.

[0082] Example 1

[0083] The first embodiment of the present application provides a video playback method, which can be applied to electronic devices, such as desktop computers, laptops, mobile phones, tablet computers (pads), smart watches, smart TVs, VR devices, vehicle-mounted devices, wearable devices, clients, and other electronic devices with data processing functions. In the embodiments of the present application, controlling video playback through the client can improve the convenience of video playback control and reduce the occupation of server resources. Therefore, the following text mainly introduces the solution of the present application by applying the video playback method provided by the present application to the client as an example.

[0084] like Figure 2 As shown, the video playback method provided in the first embodiment of the present application includes the following steps S110 to S140.

[0085] Step S110: Obtain the current network transmission performance corresponding to the client.

[0086] The above current network transmission performance is used to represent the performance of the client in obtaining video data from the server. The better the current network transmission performance, the smoother the client obtains video data from the server, the smoother the client's video playback, and the more efficiently, quickly, and timely the client can receive the transmitted video data from the server.

[0087] The current network transmission performance can be determined based on at least one network parameter selected from, but not limited to, the network bandwidth availability between the client and the server, the client's video download speed, the network jitter between the client and the server, the transmission packet loss rate, the network load, and the data transmission delay. The server can conveniently obtain the current network transmission parameters using various tools in related technologies. For example, the server can determine the transmission delay based on the time it takes the server to send data and the time it takes the client to receive data, calculate the video download speed by calculating the amount of video data received by the client per unit time, and so on. The specific methods for obtaining each network transmission parameter will not be detailed in this application.

[0088] In the embodiment of the present application, the above-mentioned current network transmission performance can be expressed by the current network transmission performance value, or by other forms, such as by performance levels such as "poor, relatively poor, normal, relatively good, good", and the specific expression method is not limited.

[0089] In the embodiment of the present application, for positive network parameters (i.e., the higher the parameter value of the network parameter, the better the network transmission performance), the current network transmission performance can be directly represented by the network parameter, for example, by the network bandwidth availability rate, the video download speed through the client to represent the network transmission performance, for negative network parameters (i.e., the higher the parameter value of the network parameter, the worse the network transmission performance), the current network transmission performance can be directly represented by the reciprocal of the network parameter or other numerical values ​​negatively correlated with the network parameter, for example, by the reciprocal of the network jitter, the reciprocal of the transmission packet loss rate, and the reciprocal of the data transmission delay to represent the network transmission performance. Those skilled in the art can flexibly set the specific determination method of the network transmission performance according to each network parameter, and this application does not specifically limit it.

[0090] In step S110, the electronic device (eg, client) may obtain the current network transmission performance corresponding to the client in real time.

[0091] In an embodiment of the present application, before step S110, the above-mentioned video playback method may further include the following steps: in response to a video start playback instruction triggered by a user, sending a video acquisition request to the server, so that the server sends video data to the client after receiving the video acquisition request, and after the client receives the video data, it buffers a preset amount of video data and then plays the buffered data. In this way, the server continuously sends data to the client, and the client continuously buffers a certain amount of data in advance, and at the same time plays the pre-buffered data to achieve smooth playback of the video. In this case, step S110, that is, during the process of playing the video, obtains the current network transmission performance corresponding to the client to guide the subsequent adjustment of the playback speed.

[0092] Step S120: updating a sampling frequency according to the current network transmission performance, wherein the sampling frequency is negatively correlated with the current network transmission performance.

[0093] The sampling frequency is used to guide the frequency of obtaining the video buffer capacity of the client. The higher the sampling frequency, the more frequently the electronic device will sample and obtain the video buffer capacity of the client.

[0094] The sampling frequency is negatively correlated with the current network transmission performance, that is, as the current network transmission performance increases, the sampling frequency will decrease accordingly. The sampling frequency may decrease accordingly, or the sampling frequency may decrease continuously as the video buffering amount increases, or the sampling frequency may decrease in stages as the current network transmission performance increases, that is, it is negatively correlated in stages. Specifically, the current network transmission performance and the sampling frequency may be linearly negatively correlated, that is, linearly inversely proportional, or nonlinearly negatively correlated, for example, discrete point negative correlation, exponential negative correlation, logarithmic negative correlation, stage-by-stage negative correlation, etc. The present application does not specifically limit the specific negative correlation between the sampling frequency and the current network transmission performance, wherein the stage-by-stage negative correlation means that different ranges of current network transmission performance correspond to different sampling frequencies, and the sampling frequency corresponding to the current network transmission performance in the high range is lower than the sampling frequency corresponding to the current network transmission performance in the low range.

[0095] When the sampling frequency is negatively correlated with the current network transmission performance in a phased manner, the frequent updates of the sampling frequency can be reduced, and the determined sampling frequency can be made consistent with the current network transmission performance.

[0096] Step S130: obtaining the buffered amount of the video currently not played by the client according to the updated sampling frequency.

[0097] When network performance changes, the sampling frequency may be updated. When the sampling frequency is updated, the video buffer amount is obtained according to the updated sampling frequency, that is, the adjustment basis for adjusting the video playback speed is obtained.

[0098] The above-mentioned video buffering amount is the number of video frames or video duration buffered by the client but not played.

[0099] Specifically, in step S130 , when it is detected that the sampling frequency is updated, the amount of video buffer that is not currently played by the client is obtained according to the updated sampling frequency.

[0100] Step S140: determining the video playback speed of the client according to the newly acquired video buffer amount, and controlling the client to play the video at the video playback speed, wherein the video playback speed is positively correlated with the video buffer amount.

[0101] Specifically, in response to obtaining a new video buffer amount, the video playback speed of the client may be determined according to the newly obtained video buffer amount, and the client may be controlled to play the video at the video playback speed.

[0102] Since step S130 continuously obtains the amount of video buffer that is not currently played by the client according to the updated sampling frequency, each time a new amount of video buffer is obtained, the electronic device will determine a new video playback speed based on the video buffer. The determined video playback speed may be the same as the current playback speed. In this case, it is played at the original speed. When the determined video playback speed is different from the current playback speed, it is adjusted to the newly determined video playback speed.

[0103] The video playback speed is positively correlated with the video buffering capacity, that is, as the video buffering capacity increases, the video playback speed will increase accordingly. The corresponding increase in video playback speed can be that the video playback speed continuously increases with the video buffering capacity, or the video playback speed increases with the video buffering capacity in stages, that is, it is positively correlated in stages. Specifically, the continuous increase in video playback speed with the video buffering capacity can be that the video playback speed and the video buffering capacity are linearly positively correlated, that is, linearly proportional, or the video playback speed and the video buffering capacity are exponentially positively correlated, logarithmically positively correlated, and other continuously changing relationships. Stage-wise negative correlation means that different ranges of current video buffering capacities correspond to different video playback speeds, and the video playback speed corresponding to the video buffering capacity in a high range is higher than the video playback speed corresponding to the video buffering capacity in a low range.

[0104] The video playback method provided in the embodiment of the present application obtains the current network transmission performance corresponding to the client, and the network transmission performance can reflect the speed at which the client can obtain video data from the server. When the network transmission performance is good, the client obtains the video from the server faster, and when the network transmission performance is poor, the client obtains the video from the server slower, and then updates the sampling frequency according to the current network transmission performance, obtains the current unplayed video buffer amount of the client according to the updated sampling frequency, and determines the video playback speed of the client according to the newly obtained video buffer amount. Since the sampling frequency is negatively correlated with the current network transmission performance, that is, the better the network transmission performance, the lower the sampling frequency. When the network transmission performance is good, it means that the client The video data transmission speed between the client and the server is faster and smoother. In this case, playback delays, freezes, etc. are usually less likely to occur, so there is no need to constantly adjust the client's video playback speed to solve delays and freezes. Instead, the normal playback speed can be maintained. The adjustment of the video playback speed is based on the acquisition of a new video buffer amount as a trigger condition. Therefore, when the network transmission performance is good, the sampling frequency is set relatively low, so that the frequency of adjusting the video playback speed can be reduced when the network transmission performance is good, thereby achieving high efficiency and effectiveness of video playback speed adjustment. When the network transmission performance is poor, the sampling frequency is set relatively high, so that the speed can be adjusted in time when the video is delayed and freezes, so as to timely reduce freezes and delays.

[0105] In addition, when adjusting the playback speed, the present application adjusts the video playback speed according to the video buffering amount of the client. This operation can be completed by the client, and the client can easily obtain the amount of buffered and unplayed video, so that the video playback speed can be flexibly and conveniently adjusted according to the obtained video buffering amount. Since the amount of unplayed video buffering reflects the smoothness of the client receiving the video from the server, when the amount of unplayed video buffering is large, it means that the current network transmission performance is relatively good, and the video data of the server can be transmitted to the client in time. When the amount of unplayed video buffering is small, it means that the current network transmission performance may be relatively poor, and the video data of the server may not be able to be transmitted to the client in time. The video transmission may be delayed or stuck. Therefore, when determining the video playback speed, the present application makes the video playback speed positively correlated with the video buffering amount, that is, the more the video buffering amount, the faster the playback speed is set, so that the buffered video can be played in time. The less the video buffering amount, the slower the playback speed is set, so that the delay and stuck during video playback can be reduced.

[0106] Since there is no need to calculate the adjusted video bit rate based on the network bandwidth, the server does not need to participate in the calculation of the video bit rate. Instead, the client can adjust and control the video playback speed based on the video buffer amount, reducing the consumption of server computing resources and network bandwidth during video playback, improving the smoothness of video playback, and better solving the problem of lag.

[0107] In a specific embodiment, step S140 may determine the video playback speed of the client according to the following steps S141 to S142.

[0108] Step S141: when the newly acquired video buffer amount is greater than a first buffer threshold, a playback speed greater than or equal to 1 is determined as the video playback speed of the client.

[0109] The first buffering threshold can be flexibly set according to actual conditions. For example, the first buffering threshold can be any video buffering amount between 3 seconds of video frames and 15 seconds of video frames, or can be other greater or lesser video buffering amounts.

[0110] In a specific implementation, a preset ideal buffer range can be set, which can be 3 seconds of video frames to 15 seconds of video frames, or other buffer ranges. The first buffer threshold is the first multiple of the upper limit of the preset ideal buffer range, the first multiple is less than 1, and the first multiple is usually greater than or equal to 0.2. That is, when the acquired video buffer amount is greater than the first multiple of the upper limit of the preset ideal buffer range, that is, when the ratio of the video buffer amount to the upper limit of the ideal buffer range is greater than the first multiple, a playback speed greater than or equal to 1 is determined as the video playback speed of the client. This embodiment sets the upper limit of the ideal buffer range, and the playback speed can be determined with reference to the ideal buffer range.

[0111] Specifically, 1x speed can be determined as the video playback speed of the client, so that the user can watch the video at normal speed. Alternatively, 1.1, 1.2, 1.5, and other speeds greater than 1 can be determined as the video playback speed of the client to chase frames and reduce the live broadcast delay of the live video. In the embodiment of the present application, since the frame chasing is performed by automatically adjusting the playback speed, the video playback speed should not be set too high when chasing frames to avoid causing a large visual contrast for the user, thereby reducing the impact on the user's viewing experience. Therefore, the above-mentioned video playback speed can be any speed between 1 and 1.2x speed, that is, in step S141, a playback speed greater than or equal to 1 and less than the preset speed can be determined as the video playback speed of the client, and the preset speed is greater than 1 and less than 1.3.

[0112] In a specific embodiment, step S142 may determine a playback speed greater than or equal to 1 as the video playback speed of the client according to the following steps S142a to S142b.

[0113] Step S142a: When the newly acquired video buffer amount is greater than a second buffer threshold, a playback speed greater than 1 is determined as the video playback speed of the client, and the second buffer threshold is greater than the first buffer threshold.

[0114] The second buffer threshold can be greater than the first buffer threshold. For example, the second buffer threshold can be the second multiple of the upper limit of the preset ideal buffer range, and the second multiple is greater than the above-mentioned first multiple. The second buffer threshold can also be the upper limit of the preset ideal buffer range (that is, the ideal buffer upper limit), which is not specifically limited in this application.

[0115] When the video buffering amount is greater than the second buffering threshold, it means that the client has a large number of buffered videos, which means that the client has a large number of unplayed videos. In this case, the client may have a relatively large playback delay. At this time, the video can be played at a speed greater than 1 to achieve frame tracking and reduce playback delay.

[0116] Step S142b: When the newly acquired video buffer amount is less than or equal to the second buffer threshold, a 1x playback speed is determined as the video playback speed of the client.

[0117] The video buffering amount is less than or equal to the second buffering threshold, indicating that the buffered video amount is not too much and is not enough to cause frame chasing. Therefore, the normal 1x speed can be determined as the video playback speed for video playback.

[0118] This embodiment determines whether to chase frames by judging whether the video buffer volume is too large. It can not only chase frames when playback delay occurs and the buffer volume is large to improve the real-time performance of live video, but also can play normally when the buffer volume is not too large to avoid excessive frame chasing and video freezes, thereby improving the user's viewing experience.

[0119] Step S142: When the newly acquired video buffer amount is less than or equal to the first buffer threshold, a playback speed smaller than 1 is determined as the video playback speed of the client.

[0120] When the video buffer amount is less than or equal to the first buffer threshold, it means that the client has very little video buffer that has not been played, which means that the client's network status or other network transmission performance is not good. In this case, if it is played at normal speed again, the buffered video will be played out quickly and become stuck. Therefore, a playback speed of less than 1 can be determined as the video playback speed of the client, thereby achieving slow playback, so that the client can store the acquired video in the buffer in time, better avoiding stuck. The playback speed can be less than 1 and greater than the second preset speed. The second preset speed can be a playback speed of 0.7 to 0.9. For example, a playback speed of 0.7 to 0.9 can be determined as the video playback speed of the client, so that the playback speed is not too small to significantly reduce the user's viewing experience.

[0121] In this embodiment, a video playback speed corresponding to a buffer amount greater than the first buffer threshold is greater than a video playback speed corresponding to a buffer amount less than the first buffer threshold. In other words, the video playback speed is positively correlated with the video buffer amount. This embodiment determines the video playback speed based on the relationship between the video buffer amount and the first buffer threshold, making it possible to simply and conveniently determine a playback speed that matches the video buffer amount.

[0122] Optionally, step S140 may also determine the video playback speed of the client according to the following steps S145 to S146.

[0123] Step S145: Determine a buffer health score corresponding to the newly acquired video buffer amount according to the video buffer amount;

[0124] Step S146: Determine the video playback speed of the client according to the buffer health score.

[0125] The buffer health score may be a ratio of the video buffer amount to the upper limit of the ideal buffer length. In this embodiment, when the buffer health score is greater than a first preset score, a playback speed greater than or equal to 1 may be determined as the video playback speed of the client; and when the buffer health score is less than or equal to the first preset score, a playback speed less than 1 may be determined as the video playback speed of the client.

[0126] Specifically, when the buffer health score is greater than the second preset score, a playback speed greater than 1 can be determined as the video playback speed of the client. The second preset score is greater than the first preset score. When the buffer health score is greater than the first preset score and less than the second preset score, a playback speed of 1 can be determined as the video playback speed of the client.

[0127] This embodiment uses a buffer health score to represent the health of the buffer amount, so that the playback speed can be determined efficiently and quickly.

[0128] In one embodiment, before step S140, the above method may further include the following step S140a.

[0129] Step S140a: Obtain the video download speed of the client according to the updated sampling frequency.

[0130] In conjunction with step S130, it can be understood that this application simultaneously obtains the client's currently unplayed video buffer amount and the client's video download speed according to the updated sampling frequency, that is, simultaneously samples the client's currently unplayed video buffer amount and the client's video download speed for subsequent playback speed control. The video download speed is the amount of video downloaded by the client per unit time.

[0131] Correspondingly, step S140 may determine the video playback speed of the client according to the following step S143.

[0132] Step S143: Determine the video playback speed of the client according to the newly acquired video buffer amount and taking the newly acquired video download speed as a constraint condition.

[0133] Specifically, in response to obtaining a new video buffer amount and a new video download speed, the video playback speed of the client may be determined according to the newly obtained video buffer amount and with the newly obtained video download speed as a constraint condition.

[0134] Specifically, when the newly acquired video buffer capacity is greater than the second buffer threshold and the newly acquired video download speed is greater than the first speed threshold, a playback speed greater than 1 can be determined as the video playback speed of the client. In other words, this embodiment requires not only a relatively large video buffer capacity but also a relatively high video download speed. Only when these two conditions are met will the video be played at a playback speed greater than 1 to achieve frame chasing. This can further reduce the lag caused by frame chasing due to slow download speeds.

[0135] Optionally, when the newly acquired video buffer capacity is greater than the second buffer threshold and the newly acquired video download speed is less than or equal to the first speed threshold, a playback speed of 1x is determined as the video playback speed of the client. In other words, when the video buffer capacity is relatively large but the video download speed is relatively slow, the low video download speed indicates that the current network status is poor and frame chasing is not suitable. Therefore, even if the video buffer capacity is relatively large, frame chasing is not performed and the video is played at a normal speed, thereby reducing the occurrence of lag.

[0136] The first speed threshold can be the second multiple of the preset ideal download speed lower limit, and the second multiple is a multiple greater than 1. The ideal download speed range can be flexibly set according to the actual situation. For example, it can be determined according to the video playback frame rate, video display speed, etc., which is not specifically limited in this application. When the video download speed is less than the second multiple of the ideal download speed lower limit, it means that the download speed is too slow and frame chasing is not performed to reduce the jamming phenomenon. The second multiple can be any value greater than 1. The larger the second multiple is, the more frame chasing will be performed when the download speed is high, and the less likely jamming will occur. Conversely, the smaller the second multiple is, the more timely frame chasing will be performed, which can better avoid live broadcast delays. Those skilled in the art can flexibly set it according to the actual situation.

[0137] In other embodiments, the video playback speed in step S143 may be determined according to the following steps: determining a preliminary video playback speed based on the newly acquired video buffer amount; when the preliminary video playback speed is greater than 1x the playback speed, determining whether the client's video playback speed is 1x the speed or the preliminary video playback speed based on whether the newly acquired video download speed is greater than a first speed threshold; specifically, when the newly acquired video download speed is greater than the first speed threshold, the preliminary video playback speed may be determined as the client's video playback speed; when the newly acquired video download speed is less than or equal to the first speed threshold, 1x the speed may be determined as the client's video playback speed. When the preliminary video playback speed is less than or equal to 1x the playback speed, the preliminary video playback speed may be determined as the client's video playback speed.

[0138] This embodiment adds the video download speed as a limiting condition for adjusting the video playback speed, which can better avoid the freeze caused by frame chasing when the video download speed is slow.

[0139] In one embodiment, step S140 may control the client to play the video at the video playback speed according to the following step S144.

[0140] Step S144: When the determined video playback speed is different from the current playback speed of the client, the client is controlled to gradually change the playback speed to the video playback speed in a preset speed step-by-step adjustment manner.

[0141] The above-mentioned gradual speed adjustment method can be: determining multiple transition speeds between the current playback speed of the client and the video playback speed, adjusting the video played by the client to the multiple transition speeds in sequence, and then adjusting it to the video playback speed. For example, if the current playback speed of the client is 1x playback speed and the determined video playback speed is 1.1x playback speed, then the transition speeds of 1.02, 10.5, 1.07, and 1.09 can be determined between 1x playback speed and 1.1x playback speed. After adjusting the client's playback speed from small to large to each transition speed in sequence at intervals of 1 second (or other intervals are also acceptable), the client's playback speed is then adjusted to 1.1x playback speed, thereby achieving a gradual transition of the video playback speed.

[0142] The above-mentioned gradual speed adjustment method can also be: adjusting the playback speed of the client to the video playback speed in a uniform manner, wherein the uniform adjustment of the playback speed means that the speed adjustment amount per unit time is the same, for example, adjusting the playback speed by 0.02 per second, then, if the current playback speed of the client is 1 times the playback speed and the determined video playback speed is 1.1 times the playback speed, the playback speed can be increased by 0.02 every 1 second until it increases to 1.1 times the playback speed, thereby achieving a gradual change in the playback speed.

[0143] When the speed is reduced, the video playback speed can be gradually reduced in the same way, which will not be described in detail in this application.

[0144] This embodiment adjusts the video playback speed in a gradual transition manner, which can reduce the visual impact on the user caused by the adjustment of the video playback speed.

[0145] In one embodiment, the method may further include the following step S150.

[0146] Step S150: In response to a resume playback instruction triggered by the user when the video is paused, the video is played at a target position, where the target position is a corresponding video playback position when the unplayed buffer remaining amount is a preset remaining amount.

[0147] The preset remaining amount can be a video frame of a preset duration or a preset number of video frames, which is not specifically limited in this application. When the user triggers the pause operation and then triggers the resume playback instruction some time later, the electronic device jumps to a position where the buffer remaining amount is a certain amount. When the network status is poor, the remaining buffer amount can be used to reduce lag and improve the user experience.

[0148] In one embodiment, the method may further include the following steps S160 to S170.

[0149] Step S160: When a jamming phenomenon is detected, the severity of the jamming phenomenon is determined.

[0150] The stuttering phenomenon may include at least one of the following: the video playback of the client is interrupted, the video display frame rate of the client is less than the preset frame rate, the audio playback of the client is intermittent, the amount of unplayed video buffered by the client is less than the third buffer threshold, there is no data transmission on the client, the audio timestamp played by the client is inconsistent with the video timestamp, and the third buffer threshold is less than the first buffer threshold. The stuttering phenomenon may also include other phenomena, which are not specifically limited in this application.

[0151] Video playback interruption occurs when the client has no playable data, causing playback to be interrupted. A video frame rate displayed on the client that is lower than the preset frame rate indicates a low display frame rate, indicating a video data transmission failure, resulting in stuttering. Intermittent audio playback on the client typically occurs when network conditions are poor and the video data, due to its large size, cannot be transmitted in a timely manner. However, the audio data, due to its smaller size, has already been transmitted, resulting in the audio not being played in time, causing audio interruption. If the client's unplayed video buffer is less than the third buffer threshold, the buffer is too low, indicating that the client cannot obtain new video data from the server, causing stuttering. Client-side data transmission failure occurs when video playback is not complete. The audio timestamps played by the client are inconsistent with the video timestamps. Specifically, the decoding timestamps (dts) and playback timestamps (pts) contained in the audio data played by the client do not match the decoding timestamps (dts) and playback timestamps (pts) contained in the video data. This indicates a delay or stuttering in the video data transmission.

[0152] The severity of the jamming phenomenon can be represented by a severity value or by different severity levels. For example, the severity levels include mild jamming, moderate jamming, and severe jamming. Those skilled in the art can also set other severity representation methods.

[0153] Different jamming phenomena usually correspond to different degrees of jamming. In this embodiment, jamming phenomena corresponding to different degrees of severity can be pre-set, and the electronic device can determine the severity corresponding to the detected jamming phenomenon based on the jamming phenomena corresponding to different degrees of severity.

[0154] For example, the mild jamming may include: the amount of unplayed video buffered by the client is less than a third buffer threshold. The moderate jamming includes at least one of the following: the video playback of the client is interrupted, the audio playback of the client is intermittent, there is no data transmission on the client, and the audio timestamp played by the client is inconsistent with the video timestamp. The severe jamming may include at least one of the following: the video display frame rate of the client is less than the preset frame rate, the continuous interruption time of the client exceeds the first preset time, the continuous no data transmission of the client exceeds the second preset time, and the connection between the client and the server is disconnected. Those skilled in the art can also set jamming phenomena corresponding to different severities according to actual conditions, and this application does not specifically limit it.

[0155] Step S170: Determine a jamming adjustment strategy based on the severity of the jamming phenomenon, where the jamming adjustment strategy includes at least one of the following: reducing the video playback speed of the client, clearing the video buffered by the client, reducing the clarity of the transmitted video, and controlling the client to re-establish a connection with the server.

[0156] For example, when the jamming phenomenon is mild, the jamming adjustment strategy may be to reduce the video playback speed of the client or clear the video buffered by the client; when the jamming phenomenon is moderate, the jamming adjustment strategy may be to clear the video buffered by the client and reduce the clarity of the transmitted video; when the jamming phenomenon is severe, the jamming adjustment strategy may be to clear the video buffered by the client, reduce the clarity of the transmitted video, and control the client to re-establish a connection with the server. Those skilled in the art may also flexibly set jamming adjustment strategies corresponding to different severity levels, and this application does not specifically limit this.

[0157] Specifically, step S170 can be implemented according to the following steps S171 to S173.

[0158] Step S171: When the jamming phenomenon is mild, if the current playback speed of the client is greater than 1 times the playback speed, reduce the video playback speed of the client; if the current playback speed of the client is less than or equal to 1 times the playback speed, clear the video buffered by the client.

[0159] If there is slight lag and the current playback speed is greater than 1x, it means that the current speed may be too fast and causing the lag. You can reduce the lag by reducing the video playback speed. If there is slight lag and the current playback speed is 1x or less than 1x, it means that the lag is caused by data transmission. In this case, the buffer in the client may have a significant lag. You can clear the buffer to receive the latest data for playback.

[0160] Step S172: When the jamming phenomenon is moderate, clear the video buffered by the client and reduce the clarity of the transmitted video.

[0161] When the video is stuck due to a virus, it means that the client's buffer may have lagged significantly. The buffer can be cleared to receive the latest data for playback. At the same time, since the stuck phenomenon is quite serious, the clarity of the transmitted video can be reduced to reduce the data size of the transmitted video to reduce the stuck phenomenon. In this case, the video definition can be restored to the original definition when the stuck phenomenon disappears.

[0162] When reducing or increasing the definition of the transmitted video, the client may send a definition reduction request or a definition increase request to the server, so that the server sends the video data with reduced definition or the video data with increased definition to the client.

[0163] Step S173: When the jamming phenomenon is severe, clear the video buffered by the client, reduce the clarity of the transmitted video, and control the client to re-establish a connection with the server.

[0164] This embodiment assigns different jamming adjustment strategies to different jamming severity levels, and can make corresponding adjustments in a timely manner when different jamming phenomena occur, so as to reduce jamming and improve the user's video viewing experience.

[0165] The following is an illustrative introduction to the video playback method provided by this application through a specific example. This example is only an illustrative description of this application and does not constitute a limitation on the scope of protection of this application. For other examples, please refer to the above description. Figure 3 As shown, the video playback method provided in this example includes the following steps 1 to 9.

[0166] Step 1: Load the video playback control program.

[0167] Loading the video playback control program can also be understood as reading the frame tracking configuration or loading the frame tracking program, that is, the video playback control program in this application can be understood as the frame tracking configuration or the frame tracking program. The video playback control program is used to execute any of the above-mentioned video playback methods.

[0168] Step 2: Detect whether the buffering time of the client is greater than a second buffering threshold.

[0169] The second buffering threshold is a threshold represented by a buffering duration.

[0170] Step 3: If the buffering time of the client is greater than the second buffering threshold, the video is played at 1.1 times the speed.

[0171] Step 4: Check whether lag occurs when the client plays the video at 1.1x speed.

[0172] Step 5: If lag occurs, reduce the playback speed.

[0173] Step 6: If no lag occurs, maintain the current playback speed.

[0174] Step 7: If the buffering time of the client is less than or equal to the second buffering threshold, the video is played at the current normal speed of 1x.

[0175] Step 8: Check whether there is a pause start operation.

[0176] The pause start operation is when the user triggers the resume playback instruction in the pause state.

[0177] Step 9: If there is a pause or start operation, jump to the target position to play the video.

[0178] The target position is the video playback position corresponding to when the unplayed buffer remaining amount is a preset remaining amount.

[0179] The specific implementation process of each step in this example can be referred to the relevant description above and will not be described in detail here.

[0180] Example 2

[0181] The second embodiment of the present application also provides a video playback device. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For details of the relevant technical features and the effects achieved, please refer to the corresponding description of the video playback method embodiment provided above. Figure 4 As shown, the video playback control device provided in this embodiment includes:

[0182] A first acquiring unit 210 is configured to acquire the current network transmission performance corresponding to the client;

[0183] An updating unit 220, configured to update a sampling frequency according to the current network transmission performance, wherein the sampling frequency is negatively correlated with the current network transmission performance;

[0184] The buffer monitoring unit 230 is configured to obtain the amount of video buffer that is not currently being played by the client according to the updated sampling frequency;

[0185] The speed adjustment unit 240 is configured to determine the video playback speed of the client according to the newly acquired video buffer amount, and control the client to play the video at the video playback speed, wherein the video playback speed is positively correlated with the video buffer amount.

[0186] like Figure 5As shown, the video playback control device provided in the present application can be applied to a video player on a client side. The video player is provided with the above-mentioned buffer monitoring unit 230 and may also be provided with a freeze identification unit 250.

[0187] The jamming identification unit 250 is used to detect whether a jamming phenomenon occurs on the client, and when a jamming phenomenon is detected, determine the severity of the jamming phenomenon.

[0188] The above-mentioned speed adjustment unit 240 is also used to: determine a jamming adjustment strategy according to the severity of the jamming phenomenon, and the jamming adjustment strategy includes at least one of the following: reducing the video playback speed of the client, clearing the video buffered by the client, reducing the clarity of the transmitted video, and controlling the client to re-establish a connection with the server.

[0189] The speed adjustment unit 240 may specifically include: a speed determination subunit 241 and a smooth adjustment subunit 242 .

[0190] The speed determination subunit 241 is configured to determine the video playback speed of the client based on the newly acquired video buffer amount. The smooth adjustment subunit 242 is configured to control the client to gradually change the playback speed to the video playback speed using a preset speed stepwise adjustment method when the determined video playback speed differs from the current playback speed of the client.

[0191] Example 3

[0192] The third embodiment of the present application also provides an electronic device embodiment corresponding to the video playback method provided in the first embodiment. The following description of the electronic device embodiment is only illustrative. The electronic device embodiment is as follows:

[0193] Please refer to Figure 6 Understand the above electronic devices, Figure 6 Schematic diagram of an electronic device. The electronic device provided in this embodiment includes: a processor 1001, a memory 1002, a communication bus 1003, and a communication interface 1004;

[0194] The memory 1002 is used to store computer instructions for data processing. When the computer instructions are read and executed by the processor 1001, the following steps are performed:

[0195] Get the current network transmission performance corresponding to the client;

[0196] Updating a sampling frequency according to the current network transmission performance, wherein the sampling frequency is negatively correlated with the current network transmission performance;

[0197] Obtaining the amount of video buffer that is not currently played by the client according to the updated sampling frequency;

[0198] The video playback speed of the client is determined according to the newly acquired video buffer amount, and the client is controlled to play the video at the video playback speed, wherein the video playback speed is positively correlated with the video buffer amount.

[0199] The fourth embodiment of the present application also provides a computer-readable storage medium for implementing the method described in the first embodiment. The computer-readable storage medium embodiment provided in this application is described in a relatively simple manner. For relevant parts, please refer to the corresponding description of the above method embodiment. The embodiment described below is merely illustrative.

[0200] The computer-readable storage medium provided in this embodiment stores computer instructions, which, when executed by a processor, implement the following steps:

[0201] Get the current network transmission performance corresponding to the client;

[0202] Updating a sampling frequency according to the current network transmission performance, wherein the sampling frequency is negatively correlated with the current network transmission performance;

[0203] Obtaining the amount of video buffer that is not currently played by the client according to the updated sampling frequency;

[0204] The video playback speed of the client is determined according to the newly acquired video buffer amount, and the client is controlled to play the video at the video playback speed, wherein the video playback speed is positively correlated with the video buffer amount.

[0205] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0206] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0207] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.

[0208] 2. Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0209] Although the present application is disclosed as above with the preferred embodiments, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.

Claims

1. A video playback method, characterized in that: The method comprises: Get the current network transmission performance corresponding to the client; Updating a sampling frequency according to the current network transmission performance, wherein the sampling frequency is negatively correlated with the current network transmission performance; Obtaining the amount of video buffer that is not currently played by the client according to the updated sampling frequency; The video playback speed of the client is determined according to the newly acquired video buffer amount, and the client is controlled to play the video at the video playback speed, wherein the video playback speed is positively correlated with the video buffer amount.

2. The video playback method according to claim 1, wherein: The determining the video playback speed of the client according to the newly acquired video buffer amount includes: When the newly acquired video buffer amount is greater than the first buffer threshold, determining a playback speed greater than or equal to 1 as the video playback speed of the client; When the newly acquired video buffer amount is less than or equal to the first buffer threshold, a playback speed less than 1 is determined as the video playback speed of the client.

3. The video playback method according to claim 2, wherein: The step of determining a playback speed greater than or equal to 1 as the video playback speed of the client includes: When the newly acquired video buffer amount is greater than a second buffer threshold, determining a playback speed greater than 1 as the video playback speed of the client, and the second buffer threshold is greater than the first buffer threshold; When the newly acquired video buffer amount is less than or equal to the second buffer threshold, a 1x playback speed is determined as the video playback speed of the client.

4. The video playback method according to claim 3, wherein: The first buffer threshold is a first multiple of a preset ideal buffer upper limit, the second buffer threshold is the ideal buffer upper limit, and the first multiple is less than 1.

5. The video playback method according to claim 2, wherein: Before determining the video playback speed of the client according to the newly acquired video buffer amount, the method further includes: Obtaining the video download speed of the client according to the updated sampling frequency; The determining the video playback speed of the client according to the newly acquired video buffer amount includes: The video playback speed of the client is determined according to the newly acquired video buffer amount and with the newly acquired video download speed as a constraint condition.

6. The video playback method according to claim 5, wherein: The step of determining a playback speed greater than or equal to 1 as the video playback speed of the client includes: When the newly acquired video buffer amount is greater than a second buffer threshold and the newly acquired video download speed is greater than a first speed threshold, determining a playback speed greater than 1 as the video playback speed of the client, and the second buffer threshold is greater than the first buffer threshold; When the newly acquired video buffer amount is greater than the second buffer threshold and the newly acquired video download speed is less than or equal to the first speed threshold, 1x playback speed is determined as the video playback speed of the client.

7. The video playback method according to claim 6, wherein: The first speed threshold is a second multiple of a preset lower limit of an ideal download speed, and the second multiple is a multiple greater than 1.

8. The video playback method according to claim 1, wherein: The determining the video playback speed of the client according to the newly acquired video buffer amount includes: Determining a buffer health score corresponding to the video buffer amount according to the newly acquired video buffer amount; The video playback speed of the client is determined according to the buffer health score.

9. The video playback method according to any one of claims 1 to 8, characterized in that: The controlling the client to play the video at the video playback speed includes: When the determined video playback speed is different from the current playback speed of the client, the client is controlled to gradually change the playback speed to the video playback speed in a preset speed step-by-step adjustment manner.

10. The video playback method according to claim 9, wherein: The speed gradual adjustment method includes at least one of the following: Determining multiple transition speeds between the current playback speed of the client and the video playback speed, and adjusting the video played by the client to the multiple transition speeds in sequence and then adjusting it to the video playback speed; The playback speed of the client is adjusted to the video playback speed in a manner of uniformly adjusting the playback speed, wherein the uniformly adjusting the playback speed means that the speed adjustment amount per unit time is the same.

11. The video playback method according to any one of claims 1 to 8, characterized in that: The method further comprises: When a jamming phenomenon is detected, determining a severity of the jamming phenomenon; A jamming adjustment strategy is determined based on the severity of the jamming phenomenon, and the jamming adjustment strategy includes at least one of the following: reducing the video playback speed of the client, clearing the video buffered by the client, reducing the clarity of the transmitted video, and controlling the client to re-establish a connection with the server.

12. The video playback method according to claim 11, wherein: The stuttering phenomenon includes at least one of the following: The video playback on the client is interrupted; The video display frame rate of the client is lower than the preset frame rate; The audio playback on the client is intermittent; The amount of unplayed videos buffered by the client is less than a third buffer threshold, and the third buffer threshold is less than the first buffer threshold; No data transmission occurs on the client side; The audio timestamp played by the client is inconsistent with the video timestamp.

13. The video playback method according to claim 12, wherein: The severity levels include mild, moderate, and severe lags; Determining a jam adjustment strategy according to the severity of the jam phenomenon includes: When the jamming phenomenon is mild, if the current playback speed of the client is greater than 1 times the playback speed, reduce the video playback speed of the client; if the current playback speed of the client is less than or equal to 1 times the playback speed, clear the video buffered by the client; When the jamming phenomenon is moderate, clearing the video buffered by the client and reducing the definition of the transmitted video; When the jamming phenomenon is severe, the video buffered by the client is cleared, the definition of the transmitted video is reduced, and the client and the server are controlled to re-establish a connection.

14. The video playback method according to claim 13, wherein: The mild jamming includes: the amount of unplayed video buffered by the client is less than a third buffer threshold; Moderate lag includes at least one of the following: interruption of video playback on the client, intermittent audio playback on the client, no data transmission on the client, inconsistency between the audio timestamp and the video timestamp played on the client; The severe freeze includes at least one of the following: the video display frame rate of the client is less than the preset frame rate, the client is continuously interrupted for more than a first preset time, the client has no data transmission for more than a second preset time, and the connection between the client and the server is disconnected.

15. The video playback method according to any one of claims 1 to 8, characterized in that: The method further comprises: In response to a resume playback instruction triggered by the user when the video is paused, the video is played by jumping to a target position, where the target position is a video playback position corresponding to when the unplayed buffer remaining amount is a preset remaining amount.

16. A video playback device, characterized in that: The device comprises: A first acquiring unit, configured to acquire the current network transmission performance corresponding to the client; an updating unit, configured to update a sampling frequency according to the current network transmission performance, wherein the sampling frequency is negatively correlated with the current network transmission performance; A buffer monitoring unit, configured to obtain a buffer amount of videos not currently played by the client according to the updated sampling frequency; The speed adjustment unit is used to determine the video playback speed of the client according to the newly obtained video buffer amount, and control the client to play the video at the video playback speed, wherein the video playback speed is positively correlated with the video buffer amount.

17. An electronic device, characterized in that: include: a processor, a memory, and computer program instructions stored on the memory and executable on the processor; When the processor executes the computer program instructions, the method according to any one of claims 1 to 15 is implemented.

18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Live broadcast method, device and system, equipment and computer readable storage medium

    CN111294634A

  • Video playing method and device and electronic equipment

    CN111327956A

  • Network data acquisition system based on big data

    CN112507208A

  • Live broadcast playing control method and related equipment

    CN115022667A

  • Data acquisition system and method based on digital metering technology

    CN118584877A