Video live broadcast method and device

By periodically obtaining the cache duration and dispersion of live videos, dynamically adjusting the playback rate, solving the problem of lag in live videos when the network is unstable, and improving the accuracy of variable speed decisions and user experience.

CN119450088APending Publication Date: 2025-02-14BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310945382.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Existing live video technology is prone to lag when the network is unstable, which will affect the smooth experience of live videos, and existing optimization methods may lead to inaccurate speed decisions.

Method used

By periodically obtaining the cache duration of the live video broadcast, and combining whether there is lag and the dispersion of the cache duration within the first preset time, the playback rate of the live video broadcast is dynamically adjusted to improve the accuracy of network stability judgment.

Benefits of technology

It improves the accuracy of determining whether the network is stable, thereby improving the accuracy of variable speed decisions, reducing the lag and delay of live video broadcasts, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119450088A_ABST
    Figure CN119450088A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a video live broadcast method and device, and relates to the technical field of communication. The method comprises the following steps: periodically obtaining the cache duration of live video; the cache duration of any period is the playing time duration for playing the cache data of the live video acquired in the period at an original rate; if the live video is blocked in a first preset duration and the cache duration acquired in the current period is less than a first threshold duration, acquiring dispersion of each cache duration acquired in a second preset duration; and if the dispersion is greater than a threshold dispersion, setting the playing rate of the live video as a first rate, the first rate being less than the original rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a video live broadcast method and device. Background Art

[0002] Live video streaming is a service that relies on broadband network resources, uses streaming video compression technology to encode video data, and sends the encoded video stream to client devices for playback in real time.

[0003] Since the video stream of live video needs to be sent to the client device in real time for playback, when the network is unstable, the live video is prone to freezes, which not only affects the smooth experience of live video, but also accumulates and increases the delay of live video. A typical optimization method in the related art is to adjust the playback speed of live video according to the amount of cached data in the playback buffer. However, the amount of cached data in the playback buffer cannot reflect whether the network is stable, so the existing optimization method may lead to inaccurate speed change decisions. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a video live broadcast method and device for improving the accuracy of determining whether a network is stable, thereby improving the accuracy of speed change decisions.

[0005] In order to achieve the above purpose, the embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a video live broadcast method, comprising:

[0007] The cache duration of the live video is periodically obtained; the cache duration of any period is the length of time for playing the cache data of the live video obtained in the period at the original rate;

[0008] If the live video has been stuck within the first preset duration, and the cache duration obtained in the current period is less than the first threshold duration, then the discreteness of each cache duration obtained within the second preset duration is obtained;

[0009] If the discreteness is greater than a threshold discreteness, the playback rate of the live video is set to a first rate, which is less than the original rate.

[0010] As an optional implementation of the embodiment of the present invention, the method further includes:

[0011] If the discreteness is less than or equal to the preset threshold, the playback rate of the live video is set to the original rate.

[0012] As an optional implementation of the embodiment of the present invention, the obtaining of the discreteness of each cache duration obtained within the second preset duration includes:

[0013] The variance of each cache duration obtained within the second preset duration is calculated to obtain the dispersion of each cache duration obtained within the second preset duration.

[0014] As an optional implementation of the embodiment of the present invention, the method further includes:

[0015] If the live video broadcast has not been stuck within the first preset duration, determine whether the cache duration obtained in the current period is greater than or equal to a second threshold duration;

[0016] If so, the playback rate of the live video is set to a second rate; the second rate is greater than the original rate.

[0017] As an optional implementation of the embodiment of the present invention, the method further includes:

[0018] If the cache duration obtained in the current period is less than the second threshold duration, and the current playback rate of the live video is the original rate, then determine whether the cache duration obtained in the current period is greater than the third threshold duration;

[0019] If so, the playback rate of the live video is set to the second rate.

[0020] As an optional implementation of the embodiment of the present invention, the method further includes:

[0021] If the cache duration obtained in the current period is less than the second threshold duration, and the current playback rate of the live video is the second rate, then determining whether the cache duration obtained in the current period is less than the third threshold duration;

[0022] If so, the playback rate of the live video is set to the original rate.

[0023] As an optional implementation of the embodiment of the present invention, the method further includes:

[0024] Determine whether each cache duration acquired within the first preset duration includes a cache duration that is less than or equal to a fourth threshold duration;

[0025] If yes, it is determined that the live video has been stuck within the first preset time period;

[0026] If not, it is determined that the live video broadcast has not been stuck within the first preset time length.

[0027] As an optional implementation of the embodiment of the present invention, the method further includes:

[0028] Determine whether the live video broadcast start time is less than a fifth threshold time;

[0029] If so, the playback rate of the live video is maintained at the original rate.

[0030] As an optional implementation of the embodiment of the present invention, the method further includes:

[0031] Determine whether the playback duration of the live video at the current playback rate is less than a sixth threshold duration;

[0032] If so, it is prohibited to change the playback rate of the live video.

[0033] In a second aspect, an embodiment of the present application provides a video live broadcast device, including:

[0034] An acquisition unit, used for periodically acquiring a cache duration of a live video; the cache duration of any period is the length of time for playing the cache data of the live video acquired in the period at an original rate;

[0035] A processing unit, configured to obtain a discreteness of each cache duration obtained within a second preset duration if a freeze occurs in the live video broadcast within the first preset duration and the cache duration obtained in the current period is less than the first threshold duration;

[0036] The playback unit is used to set the playback rate of the live video to a first rate when the discreteness is greater than a threshold discreteness, and the first rate is lower than the original rate.

[0037] As an optional implementation of the embodiment of the present application, the playback unit is also used to set the playback rate of the live video to the original rate when the discreteness is less than or equal to the preset threshold.

[0038] As an optional implementation of the embodiment of the present application, the processing unit is specifically used to calculate the variance of each cache duration obtained within the second preset duration to obtain the discreteness of each cache duration obtained within the second preset duration.

[0039] As an optional implementation of the embodiment of the present application,

[0040] The processing unit is further configured to determine whether the cache duration acquired in the current period is greater than or equal to a second threshold duration when no freeze occurs in the live video broadcast within the first preset duration;

[0041] The playback unit is further configured to set the playback rate of the live video to a second rate when the cache duration acquired in the current period is greater than or equal to the second threshold duration; the second rate is greater than the original rate.

[0042] As an optional implementation of the embodiment of the present application,

[0043] The processing unit is further configured to determine whether the cache duration obtained in the current period is greater than a third threshold duration when the cache duration obtained in the current period is less than the second threshold duration and the current playback rate of the live video is the original rate;

[0044] The playback unit is further configured to set the playback rate of the live video broadcast to the second rate when the cache duration acquired in the current cycle is greater than the third threshold.

[0045] As an optional implementation of the embodiment of the present application,

[0046] The processing unit is further configured to determine whether the cache duration obtained in the current period is less than a third threshold duration when the cache duration obtained in the current period is less than the second threshold duration and the current playback rate of the live video is the second rate;

[0047] The playback unit is further configured to set the playback rate of the live video to the original rate when the cache duration acquired in the current cycle is less than the third threshold duration.

[0048] As an optional implementation of an embodiment of the present application, the processing unit is specifically used to determine whether the various cache durations obtained within the first preset duration include a cache duration that is less than or equal to a fourth threshold duration; if so, it is determined that the live video broadcast has been stuck within the first preset duration; if not, it is determined that the live video broadcast has not been stuck within the first preset duration.

[0049] As an optional implementation of the embodiment of the present application,

[0050] The processing unit is further used to determine whether the duration of the live video broadcast is less than a fifth threshold duration;

[0051] The playback unit is further configured to maintain the playback rate of the live video at the original rate when the start time of the live video is less than the fifth threshold time.

[0052] As an optional implementation of the embodiment of the present application,

[0053] The processing unit is further configured to determine whether a playback duration of the live video at a current playback rate is less than a sixth threshold duration;

[0054] The playback unit is further configured to prohibit changing the playback rate of the live video when a playback duration of the live video at a current playback rate is greater than a sixth threshold duration.

[0055] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to enable the electronic device to implement the video live broadcast method described in any of the above-mentioned embodiments when executing the computer program.

[0056] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which, when the computer program is executed by a computing device, enables the computing device to implement the video live broadcast method described in any of the above-mentioned embodiments.

[0057] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to implement the video live broadcast method described in any of the above-mentioned embodiments.

[0058] The video live broadcast method provided in the embodiment of the present application can periodically obtain the playback time length of the cached data of the video live broadcast at the original rate as the cached time length, and determine whether the video live broadcast has been stuck within the first preset time length, and the cached time length obtained in the current period is less than the first threshold time length, and when it is determined that the video live broadcast has been stuck within the first preset time length, and the cached time length obtained in the current period is less than the first threshold time length, obtain the discreteness of each cached time length obtained within the second preset time length, and set the playback rate of the video live broadcast to a first rate less than the original rate when the discreteness is greater than the threshold discreteness. Since the embodiment of the present application further determines the discreteness of each cached time length obtained within the second preset time length when the cached time length obtained in the current period is less than the first threshold time length, so as to determine whether the network is stable in combination with historical data, and only when the discreteness is greater than the threshold discreteness, the playback rate of the video live broadcast will be set to the first rate less than the original rate, so the embodiment of the present application can improve the accuracy of determining whether the network is stable, thereby improving the accuracy of speed change decision. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0061] Figure 1 One of the flow charts of the video live broadcast method provided in the embodiment of the present application;

[0062] Figure 2 The second flowchart of the video live broadcast method provided in the embodiment of the present application;

[0063] Figure 3 A structural diagram of a video live broadcast device provided in an embodiment of the present application;

[0064] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0066] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein. Obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.

[0067] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In addition, in the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more.

[0068] The embodiment of the present application provides a video live broadcast method, which can be applied to any device that plays a video live broadcast. Figure 1 As shown, the video live broadcast method includes the following steps S11 to S16:

[0069] S11. Periodically obtain the cache duration of the live video.

[0070] The cache duration of any cycle is the length of time for playing the cache data of the live video obtained in the cycle at the original rate.

[0071] Exemplarily, the time interval between two consecutive acquisitions of the cache duration of the live video (the period of periodically acquiring the cache duration of the live video) is greater than or equal to 200 milliseconds and less than or equal to 5000 milliseconds. That is, the value range of the sampling interval of the cache duration is [200ms, 5000ms]. For example, the cache duration of the live video can be acquired once every 1 second.

[0072] It should be noted that although the cache duration in the embodiment of the present application is the length of time it takes to play the cached data of the live video at the original rate, in some embodiments the cache duration does not need to be calculated based on the cached data and the original rate, because each frame of the cached data carries a timestamp, and the cache duration can be obtained based on the timestamp of the first frame and the timestamp of the last frame in the cached data.

[0073] S12: Determine whether the live video has been stuck within a first preset duration.

[0074] In some embodiments, the first preset duration may be in the range of [5s, 10s]. For example, if the first preset duration is 10s, then it is determined whether the live video has been stuck in the past 10s.

[0075] In some embodiments, the implementation of the above step S12 (determining whether the live video has been stuck within the first preset duration) includes the following steps a to c:

[0076] Step a: determine whether the cache durations obtained within the first preset duration include a cache duration that is less than or equal to a fourth threshold duration.

[0077] Exemplarily, the fourth threshold duration may be 0. That is, it is determined whether there is a period in which no playable cached data exists in each cache duration obtained within the first preset duration.

[0078] In the above step a, if the cache durations obtained within the first preset duration include a cache duration that is less than or equal to the fourth threshold duration, the following step b is executed, and if the cache durations obtained within the first preset duration do not include a cache duration that is less than or equal to the fourth threshold duration, the following step c is executed:

[0079] Step b: determining whether the live video has been stuck within the first preset duration.

[0080] Step c: Determine that the live video broadcast has not been stuck within the first preset duration.

[0081] S13: Determine whether the cache duration acquired in the current cycle is less than a first threshold duration.

[0082] In some embodiments, the first threshold duration can be determined according to the delay of the live video broadcast. For example, the first threshold duration can be the delay of the live video broadcast minus 2000ms.

[0083] In the above steps S12 and S13, if the live video is stuck within the first preset duration, and the cache duration obtained in the current cycle is less than the first threshold duration, the following step S14 is executed:

[0084] S14: Obtain the discreteness of each cache duration obtained within the second preset duration.

[0085] In some embodiments, the second preset duration may be in the range of [5s, 30s]. For example, the second preset duration is 10 seconds. That is, the discreteness of the cache duration of the live video obtained in each period in the past 10s is obtained.

[0086] Discreteness is a physical quantity used to measure the difference between variables. There are many indicators that can be used to measure the discreteness between variables. The most commonly used ones are variance, range, mean deviation and standard deviation.

[0087] In some embodiments, the above step S14 (obtaining the discreteness of each cache duration obtained within the second preset duration) includes:

[0088] The variance of each cache duration obtained within the second preset duration is calculated to obtain the dispersion of each cache duration obtained within the second preset duration.

[0089] The discreteness in the embodiment of the present application is used to measure the cache duration obtained in multiple cycles, and the cache duration obtained in different cycles is mainly determined by the transmission rate of the network. Therefore, the network stability can be determined based on the discreteness of each cache duration obtained within the second preset duration.

[0090] S15: Determine whether the dispersion is greater than a threshold dispersion.

[0091] In some embodiments, the threshold discreteness may be 0.5.

[0092] In the above step S15, if the discreteness is greater than the threshold discreteness, the following step S16 is executed:

[0093] S16: Setting the playback rate of the live video to a first rate.

[0094] The first rate is smaller than the original rate.

[0095] In some embodiments, the difference between the first rate and the original rate is less than or equal to 15%. Since changing the playback speed of the live video will cause the audio to change, if the difference between the first rate and the original rate is too large, it will seriously affect the user experience. The above embodiment sets the difference between the first rate and the original rate to be less than or equal to 15%, so the above embodiment can avoid seriously affecting the user experience.

[0096] Exemplarily, the first rate may be 0.9 times the original rate.

[0097] The video live broadcast method provided in the embodiment of the present application can periodically obtain the playback time length of the cached data of the video live broadcast at the original rate as the cached time length, and determine whether the video live broadcast has been stuck within the first preset time length, and the cached time length obtained in the current period is less than the first threshold time length, and when it is determined that the video live broadcast has been stuck within the first preset time length, and the cached time length obtained in the current period is less than the first threshold time length, obtain the discreteness of each cached time length obtained within the second preset time length, and set the playback rate of the video live broadcast to a first rate less than the original rate when the discreteness is greater than the threshold discreteness. Since the embodiment of the present application further determines the discreteness of each cached time length obtained within the second preset time length when the cached time length obtained in the current period is less than the first threshold time length, so as to determine whether the network is stable in combination with historical data, and only when the discreteness is greater than the threshold discreteness, the playback rate of the video live broadcast will be set to the first rate less than the original rate, so the embodiment of the present application can improve the accuracy of determining whether the network is stable, thereby improving the accuracy of speed change decision.

[0098] In some embodiments, in the above step S15, if the discreteness is less than or equal to the threshold discreteness, the playback rate of the live video is set to the original rate.

[0099] That is, if the discreteness is less than or equal to the threshold discreteness, the live video is played at the original rate.

[0100] As an extension and refinement of the above embodiment, the present application embodiment provides another video live broadcast method, referring to Figure 2 As shown, the video live broadcast method includes the following steps S201 to S209:

[0101] S201. Periodically obtain the cache duration of the live video.

[0102] The cache duration of any cycle is the length of time for playing the cache data of the live video obtained in the cycle at the original rate.

[0103] S202: Determine whether the live video broadcast has been stuck within a first preset duration.

[0104] In the above step S202, if the live video broadcast has not been stuck within the first preset time, the following step S203 is performed:

[0105] S203: Determine whether the cache duration acquired in the current cycle is greater than or equal to a second threshold duration.

[0106] In some embodiments, the second threshold duration can be determined based on the average delay of the live video broadcast. For example, the second threshold duration is the average delay of the live video broadcast plus 1500ms.

[0107] In the above step S203, if the cache duration acquired in the current cycle is greater than or equal to the second threshold duration, the following step S204 is executed:

[0108] S204: Set the playback rate of the live video to a second rate.

[0109] The second rate is greater than the original rate.

[0110] In some embodiments, the second rate differs from the original rate by less than or equal to 15%.

[0111] In the above step S203, if the cache duration acquired in the current cycle is less than the second threshold duration, the following step S205 is executed:

[0112] S205: Determine the current playback rate of the live video.

[0113] In the above step S205, if the current playback rate of the live video is the second playback rate, the following step S206 is executed:

[0114] S206: Determine whether the cache duration acquired in the current cycle is less than a third threshold duration.

[0115] In some embodiments, the third threshold duration can be determined based on the average delay of the live video broadcast. For example, the average delay of the live video broadcast is set as the third threshold.

[0116] In the above step S206, if the cache duration acquired in the current cycle is less than the third threshold duration, the following step S207 is executed:

[0117] S207: Setting the playback rate of the live video to the original rate.

[0118] That is, in the process of accelerating the live video playback to catch up with the delay, if the cache duration is less than the third threshold duration, the live video playback is stopped to catch up with the delay.

[0119] In the above step S205, if the current playback rate of the live video is the original playback rate, the following step S208 is executed:

[0120] S208: Determine whether the cache duration acquired in the current cycle is greater than the third threshold duration.

[0121] In the above step S208, if the cache duration acquired in the current cycle is greater than the third threshold duration, the following step S209 is executed:

[0122] S209: Set the playback rate of the live video to the second rate.

[0123] In the above embodiment, the delay catch-up is controlled by using two threshold durations, namely the second threshold duration and the third threshold duration. Therefore, the above embodiment can reduce or avoid the freeze of the live video while reducing the live video, thereby improving the user experience during the live video.

[0124] In some embodiments, the video live broadcast method provided by the embodiments of the present application further includes: determining whether the duration of the video live broadcast being turned on is less than a fifth threshold duration; if so, maintaining the playback rate of the video live broadcast at the original rate.

[0125] In some embodiments, the fifth threshold duration ranges from [2000ms, 10000ms].

[0126] For example, if the fifth threshold duration is 10000 ms, the playback rate of the live video is maintained at the original rate within the first 10 seconds of the start of the live video.

[0127] Since adjusting the playback speed of live video during the startup phase will seriously affect the user experience, adjusting the playback speed of live video during the startup phase should be avoided. Therefore, in the embodiment of the present application, when the live video is turned on for less than the fifth threshold duration, the playback speed of the live video is maintained at the original rate, thereby avoiding adjusting the playback speed of the live video during the startup phase, thereby improving the user experience.

[0128] In some embodiments, each time the playback rate of the live video is reset, it can be determined whether the duration of the live video startup is less than a fifth threshold duration. For example, when the discreteness is greater than the threshold discreteness, it is first determined whether the duration of the live video startup is less than the fifth threshold duration, and then it is determined whether to set the playback rate of the live video to the first rate based on the judgment result.

[0129] In other embodiments, it is first determined whether the duration of the live video broadcast is less than the fifth threshold duration, and only when the duration of the live video broadcast is greater than the fifth threshold duration, is it determined whether to reset the playback rate of the live video broadcast. For example: when starting the live video broadcast, a timer with a duration of the fifth threshold duration is started, and whether the duration of the live video broadcast is less than the fifth threshold duration is determined based on whether the timer has timed out. Compared to determining whether the duration of the live video broadcast is less than the fifth threshold duration every time the playback rate of the live video broadcast is reset, the embodiment of the present application can avoid unnecessary data processing (for example: determining whether the live video broadcast has been stuck within the first preset duration, determining that the cache duration obtained in the current cycle is less than the first threshold duration, etc.), so the embodiment of the present application can reduce the performance consumption of the live video broadcast.

[0130] In some embodiments, the video live broadcast method provided by the embodiments of the present application also includes: determining whether the playback time of the video live broadcast at the current playback rate is less than a sixth threshold time; if so, prohibiting changes to the playback rate of the video live broadcast.

[0131] In some embodiments, the sixth threshold duration may be in the range of [1s, 3s]. For example, the sixth threshold duration may be 2s. That is, if the time from the last adjustment of the playback rate of the live video is less than two seconds, it is prohibited to change the playback rate of the live video again.

[0132] In some embodiments, each time the playback rate of the live video is reset, it can be determined whether the duration of the live video startup is less than the fifth threshold duration. For example, when the cache duration obtained in the current period is greater than or equal to the second threshold duration, it is first determined whether the playback duration of the live video at the current playback rate is less than the sixth threshold duration, and then it is determined whether to set the playback rate of the live video to the second rate based on the judgment result.

[0133] Too frequent adjustment of the playback rate of live video will seriously affect the user experience. The above embodiment prohibits changing the playback rate of the live video when the playback duration of the live video at the current playback rate is less than the sixth threshold duration. Therefore, the above embodiment can avoid too frequent adjustment of the playback rate of the live video, thereby improving the user experience.

[0134] Based on the same inventive concept, as an implementation of the above method, the embodiment of the present application also provides a video live broadcast device, which corresponds to the above method embodiment. For the ease of reading, this embodiment will no longer repeat the details of the above method embodiment one by one, but it should be clear that the video live broadcast device in this embodiment can correspond to all the contents of the above method embodiment.

[0135] The embodiment of the present application provides a video live broadcast device, Figure 3 is a structural diagram of the video live broadcast device, such as Figure 3 As shown, the video live broadcast device 300 includes:

[0136] The acquisition unit 31 is used to periodically acquire the cache duration of the live video; the cache duration of any period is the length of time for playing the cache data of the live video acquired in the period at the original rate;

[0137] The processing unit 32 is used to obtain the discreteness of each cache duration obtained within a second preset duration when the live video has been stuck within the first preset duration and the cache duration obtained in the current period is less than the first threshold duration;

[0138] The playback unit 33 is used to set the playback rate of the live video to a first rate when the discreteness is greater than a threshold discreteness, and the first rate is lower than the original rate.

[0139] As an optional implementation of the embodiment of the present application, the playback unit 33 is also used to set the playback rate of the live video to the original rate when the discreteness is less than or equal to the preset threshold.

[0140] As an optional implementation of the embodiment of the present application, the processing unit 32 is specifically used to calculate the variance of each cache duration obtained within the second preset duration to obtain the discreteness of each cache duration obtained within the second preset duration.

[0141] As an optional implementation of the embodiment of the present application,

[0142] The processing unit 32 is further configured to determine whether the cache duration acquired in the current cycle is greater than or equal to a second threshold duration when no freeze occurs in the live video broadcast within the first preset duration;

[0143] The playback unit 33 is further configured to set the playback rate of the live video to a second rate when the cache duration acquired in the current cycle is greater than or equal to the second threshold duration; the second rate is greater than the original rate.

[0144] As an optional implementation of the embodiment of the present application,

[0145] The processing unit 32 is further configured to determine whether the cache duration obtained in the current period is greater than a third threshold duration when the cache duration obtained in the current period is less than the second threshold duration and the current playback rate of the live video is the original rate;

[0146] The playback unit 33 is further configured to set the playback rate of the live video broadcast to the second rate when the cache duration acquired in the current cycle is greater than the third threshold.

[0147] As an optional implementation of the embodiment of the present application,

[0148] The processing unit 32 is further configured to determine whether the cache duration obtained in the current period is less than a third threshold duration when the cache duration obtained in the current period is less than the second threshold duration and the current playback rate of the live video is the second rate;

[0149] The playback unit 33 is further configured to set the playback rate of the live video to the original rate when the cache duration acquired in the current cycle is less than the third threshold duration.

[0150] As an optional implementation of the embodiment of the present application, the processing unit 32 is specifically used to determine whether the various cache durations obtained within the first preset duration include a cache duration that is less than or equal to a fourth threshold duration; if so, it is determined that the live video has been stuck within the first preset duration; if not, it is determined that the live video has not been stuck within the first preset duration.

[0151] As an optional implementation of the embodiment of the present application,

[0152] The processing unit 32 is further configured to determine whether the duration of the live video broadcast start-up is less than a fifth threshold duration;

[0153] The playback unit 33 is further configured to maintain the playback rate of the live video at the original rate when the start time of the live video is less than the fifth threshold time.

[0154] As an optional implementation of the embodiment of the present application,

[0155] The processing unit 32 is further configured to determine whether the duration of the live video broadcast at the current playback rate is less than a sixth threshold duration;

[0156] The playback unit 33 is further configured to prohibit changing the playback rate of the live video when the playback duration of the live video at the current playback rate is greater than the sixth threshold duration.

[0157] The video live broadcast device provided in this embodiment can execute the video live broadcast method provided in the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0158] Based on the same inventive concept, an embodiment of the present application also provides an electronic device. Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 4 As shown, the electronic device provided in this embodiment includes: a memory 41 and a processor 42, wherein the memory 41 is used to store a computer program, and the processor 42 is used to execute the video live broadcast method provided in the above embodiment when executing the computer program.

[0159] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computing device implements the video live broadcast method provided in the above embodiment.

[0160] Based on the same inventive concept, an embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computing device implements the video live broadcast method provided in the above embodiment.

[0161] 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 adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media that include computer-usable program code.

[0162] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware model components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0163] The memory may include non-permanent memory 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. The memory is an example of a computer-readable medium.

[0164] Computer readable media include permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (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 temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein, and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A video live broadcast method, characterized in that: include: Periodically obtain the cache duration of live video; The cache duration of any period is the length of time for playing the cached data of the live video obtained in the period at the original rate; If the live video has been stuck within the first preset duration, and the cache duration obtained in the current period is less than the first threshold duration, then the discreteness of each cache duration obtained within the second preset duration is obtained; If the discreteness is greater than a threshold discreteness, the playback rate of the live video is set to a first rate, which is lower than the original rate.

2. The method according to claim 1, characterized in that The method further comprises: If the discreteness is less than or equal to the preset threshold, the playback rate of the live video is set to the original rate.

3. The method according to claim 1, characterized in that The obtaining of the discreteness of each cache duration obtained within the second preset duration includes: The variance of each cache duration obtained within the second preset duration is calculated to obtain the dispersion of each cache duration obtained within the second preset duration.

4. The method according to claim 1, characterized in that: The method further comprises: If the live video broadcast has not been stuck within the first preset duration, determining whether the cache duration obtained in the current period is greater than or equal to a second threshold duration; If so, the playback rate of the live video is set to a second rate; the second rate is greater than the original rate.

5. The method according to claim 4, characterized in that The method further comprises: If the cache duration obtained in the current period is less than the second threshold duration, and the current playback rate of the live video is the original rate, then determine whether the cache duration obtained in the current period is greater than the third threshold duration; If so, the playback rate of the live video is set to the second rate.

6. The method according to claim 4, characterized in that The method further comprises: If the cache duration obtained in the current period is less than the second threshold duration, and the current playback rate of the live video is the second rate, then determining whether the cache duration obtained in the current period is less than the third threshold duration; If so, the playback rate of the live video is set to the original rate.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine whether each cache duration acquired within the first preset duration includes a cache duration that is less than or equal to a fourth threshold duration; If yes, it is determined that the live video has been stuck within the first preset time period; If not, it is determined that the live video broadcast has not been stuck within the first preset time length.

8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine whether the live video broadcast start time is less than a fifth threshold time; If so, the playback rate of the live video is maintained at the original rate.

9. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine whether the playback duration of the live video at the current playback rate is less than a sixth threshold duration; If so, it is prohibited to change the playback rate of the live video.

10. A video live broadcast device, characterized in that: include: An acquisition unit, used for periodically acquiring the cache duration of the live video broadcast; The cache duration of any period is the length of time for playing the cached data of the live video obtained in the period at the original rate; A processing unit, configured to obtain a discreteness of each cache duration obtained within a second preset duration if a freeze occurs in the live video broadcast within the first preset duration and the cache duration obtained in the current period is less than the first threshold duration; The playback unit is used to set the playback rate of the live video to a first rate when the discreteness is greater than a threshold discreteness, and the first rate is lower than the original rate.

11. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program and the processor is used to enable the electronic device to implement the video live broadcast method described in any one of claims 1-9 when executing the computer program.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the video live broadcast method described in any one of claims 1-9.