Video live streaming method and apparatus

By periodically obtaining the cache duration and dispersion of live videos, dynamically adjusting the playback rate of live videos, solving the problem of live videos caused by network instability, and improving the smoothness and user experience of live videos.

WO2025025806A1PCT designated stage expired Publication Date: 2025-02-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/097625
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-28
Filing Date
2024-06-05
Publication Date
2025-02-06

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, we can judge whether the live video broadcast has stuttered in the first preset time, and when the cache duration obtained in the current period is less than the first threshold time, we can obtain the cache duration obtained in the second preset time. Discreteness of each cache duration. If the degree of dispersion is greater than the threshold, the playback rate of the live video broadcast is set to a first rate smaller than the original rate.

Benefits of technology

By improving the accuracy of judging network stability and improving the accuracy of variable speed decisions, thereby reducing the lag and delay of live videos and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024097625_06022025_PF_FP_ABST
    Figure CN2024097625_06022025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of communications, and provide a video live streaming method and apparatus. The method comprises: periodically acquiring a buffer duration of video live streaming, wherein the buffer duration in any period is the length of playback time for playing, at an original rate, buffered data of the video live streaming acquired in the period; if the video live streaming has experienced lag within a first preset duration, and the buffer duration acquired in a current period is less than a first threshold duration, acquiring dispersion of each buffer duration acquired within a second preset duration; and if the dispersion is greater than a threshold dispersion, setting the playback rate of the video live streaming as a first rate, wherein the first rate is less than the original rate.
Need to check novelty before this filing date? Find Prior Art

Description

Video live broadcast method and device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on July 28, 2023, with application number 202310945382.4 and invention name “A method and device for live video broadcasting”, the entire contents of which are incorporated by reference into this application. Technical Field

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

[0004] 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.

[0005] Because the video stream of live video broadcasts needs to be sent to the client device in real time for playback, it is very easy for live video broadcasts to freeze when the network is unstable. This freeze not only affects the smooth experience of live video broadcasts, but also accumulates and increases the delay of live video broadcasts. A typical optimization method in the related art is to adjust the playback speed of live video broadcasts based on 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.

[0006] Summary of the Invention

[0007] 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.

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

[0009] In a first aspect, an embodiment of the present application provides a method for live video broadcasting, comprising:

[0010] Periodically obtain the cache duration of the live video; the cache duration of any period is the length of time it takes to play the cached data of the live video obtained in that period at the original rate;

[0011] 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, obtaining the discreteness of each cache duration obtained within the second preset duration;

[0012] 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.

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

[0014] 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.

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

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

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

[0018] If the live video broadcast does not freeze 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;

[0019] If so, the playback rate of the live video is set to a second rate; the second rate is greater than the original 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 original rate, then determining whether the cache duration obtained in the current period is greater than a third threshold duration;

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

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

[0024] 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;

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

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

[0027] 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;

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

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

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

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

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

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

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

[0035] If so, changing the playback rate of the live video is prohibited.

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

[0037] An acquisition unit, configured to periodically acquire a cache duration of a live video; the cache duration of any period is the length of time it takes to play the cached data of the live video acquired in that period at an original rate;

[0038] 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 a first threshold duration;

[0039] The playback unit is configured 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.

[0040] As an optional implementation of the embodiment of the present application, the playback unit is further configured 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.

[0041] 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.

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

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

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

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

[0046] The processing unit is further configured to, 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, determine whether the cache duration obtained in the current period is greater than a third threshold duration;

[0047] 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.

[0048] As an optional implementation of the embodiment of this application,

[0049] The processing unit is further configured to, 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, determine whether the cache duration obtained in the current period is less than a third threshold duration;

[0050] 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 period is less than the third threshold duration.

[0051] 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 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.

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

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

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

[0055] As an optional implementation of the embodiment of this application,

[0056] 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;

[0057] The playback unit 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.

[0058] 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 embodiments when executing the computer program.

[0059] 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 embodiments.

[0060] 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 one of the above-mentioned embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] 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.

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

[0063] FIG1 is a flowchart of a method for live video broadcasting provided by an embodiment of the present application;

[0064] FIG2 is a second flowchart of the video live broadcast method provided in an embodiment of the present application;

[0065] FIG3 is a structural diagram of a video live broadcast device provided in an embodiment of the present application;

[0066] FIG4 is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0068] 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, not all of the embodiments.

[0069] 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 advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant 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.

[0070] The live video broadcast method provided in the embodiment of the present application can periodically obtain the playback time length of the cached data of the live video broadcast at the original rate as the cache duration, and determine whether the live video broadcast has experienced any freezes within a first preset duration, and the cache duration obtained in the current period is less than a first threshold duration. When it is determined that the live video broadcast has experienced any freezes within the first preset duration and the cache duration obtained in the current period is less than the first threshold duration, the method obtains the discreteness of each cache duration obtained within a second preset duration, and sets the playback rate of the live video broadcast to a first rate less than the original rate if the discreteness is greater than a threshold discreteness. Because the embodiment of the present application further determines the discreteness of each cache duration obtained within the second preset duration when the cache duration obtained in the current period is less than the first threshold duration, 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 will the playback rate of the live video broadcast be set to the first rate less than the original rate, the embodiment of the present application can improve the accuracy of determining whether the network is stable, thereby improving the accuracy of speed change decisions.

[0071] The embodiment of the present application provides a method for live video broadcasting, which can be applied to any device that plays live video. Referring to FIG1 , the method for live video broadcasting includes the following steps S11 to S16:

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

[0073] The cache duration of any period is the length of time it takes to play the cached data of the live video obtained in the period at the original rate.

[0074] For example, the time interval between two consecutive acquisitions of the cache duration of the live video (the period for 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 cache duration sampling interval is [200ms, 5000ms]. For example, the cache duration of the live video can be acquired once every 1 second.

[0075] 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.

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

[0077] 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.

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

[0079] 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.

[0080] 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 acquired within the first preset duration.

[0081] In step a above, 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, then step b below is performed; 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, then step c below is performed:

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

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

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

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

[0086] 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:

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

[0088] 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 within the past 10 seconds is obtained.

[0089] Discreteness is a physical quantity used to measure the size of 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.

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

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

[0092] 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.

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

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

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

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

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

[0098] 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 a live video broadcast will cause audio distortion, a large difference between the first rate and the original rate can 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%, thereby avoiding a serious impact on the user experience.

[0099] For example, the first rate may be 0.9 times the original rate.

[0100] The live video broadcast method provided in the embodiment of the present application can periodically obtain the playback time length of the cached data of the live video broadcast at the original rate as the cache duration, and determine whether the live video broadcast has experienced any freezes within a first preset duration, and the cache duration obtained in the current period is less than a first threshold duration. When it is determined that the live video broadcast has experienced any freezes within the first preset duration and the cache duration obtained in the current period is less than the first threshold duration, the method obtains the discreteness of each cache duration obtained within a second preset duration, and sets the playback rate of the live video broadcast to a first rate less than the original rate if the discreteness is greater than a threshold discreteness. Because the embodiment of the present application further determines the discreteness of each cache duration obtained within the second preset duration when the cache duration obtained in the current period is less than the first threshold duration, 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 will the playback rate of the live video broadcast be set to the first rate less than the original rate, the embodiment of the present application can improve the accuracy of determining whether the network is stable, thereby improving the accuracy of speed change decisions.

[0101] 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.

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

[0103] As an extension and refinement of the above embodiment, the embodiment of the present application provides another video live broadcast method. As shown in FIG2 , the video live broadcast method includes the following steps S201 to S209:

[0104] S201: Periodically obtain the cache duration of the live video broadcast.

[0105] The cache duration of any period is the length of time it takes to play the cached data of the live video obtained in the period at the original rate.

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

[0107] In the above step S202, if the live video broadcast does not freeze within the first preset duration, the following step S203 is executed:

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

[0109] 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.

[0110] 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:

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

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

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

[0114] 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:

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

[0116] 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:

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

[0118] 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.

[0119] 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:

[0120] S207: Set the playback rate of the live video to the original rate.

[0121] 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 accelerated playback of the live video is stopped and the delay is stopped.

[0122] 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:

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

[0124] 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:

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

[0126] In the above embodiment, the delay is caught up by controlling 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.

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

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

[0129] 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.

[0130] 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 an embodiment of the present application, when the duration of the live video startup is 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.

[0131] 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 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.

[0132] 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, whether to reset the playback rate of the live video broadcast is determined. 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 times out. Compared to determining whether the duration of the live video broadcast is less than the fifth threshold duration each 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.

[0133] In some embodiments, the video live broadcast method provided by the embodiments of the present application further 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.

[0134] 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 less than two seconds have passed since the last adjustment of the playback rate of the live video, further changes to the playback rate of the live video are prohibited.

[0135] 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.

[0136] Adjusting the playback rate of live video too frequently will seriously affect the user experience. In the above embodiment, when the playback time of the live video at the current playback rate is less than the sixth threshold time, the playback rate of the live video is prohibited from being changed. Therefore, the above embodiment can avoid adjusting the playback rate of live video too frequently, thereby improving the user experience.

[0137] 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 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 and implement all the contents of the above method embodiment.

[0138] The embodiment of the present application provides a video live broadcast device. FIG3 is a schematic structural diagram of the video live broadcast device. As shown in FIG3 , the video live broadcast device 300 includes:

[0139] 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 it takes to play the cached data of the live video acquired in the period at the original rate;

[0140] The processing unit 32 is 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 a first threshold duration;

[0141] The playback unit 33 is configured 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.

[0142] As an optional implementation of the embodiment of the present application, the playback unit 33 is further configured 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.

[0143] 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.

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

[0145] The processing unit 32 is further configured to determine whether the cache duration obtained 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;

[0146] 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 period is greater than or equal to the second threshold duration; the second rate is greater than the original rate.

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

[0148] The processing unit 32 is further configured to, 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, determine whether the cache duration obtained in the current period is greater than a third threshold duration;

[0149] 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.

[0150] As an optional implementation of the embodiment of this application,

[0151] The processing unit 32 is further configured to, 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, determine whether the cache duration obtained in the current period is less than a third threshold duration;

[0152] 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.

[0153] As an optional implementation of an 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.

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

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

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

[0157] As an optional implementation of the embodiment of this application,

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

[0159] 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.

[0160] 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 effects are similar and will not be repeated here.

[0161] Based on the same inventive concept, an embodiment of the present application further provides an electronic device. Figure 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in Figure 4, the electronic device provided in this embodiment includes: a memory 41 and a processor 42. 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.

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

[0163] 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.

[0164] 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 a complete hardware embodiment, a complete 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 containing computer-usable program code.

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

[0166] 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.

[0167] Computer-readable media includes both permanent and non-permanent, removable and non-removable storage media. Storage media can implement any method or technology for storing information, which 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 transitory computer-readable media, such as modulated data signals and carrier waves.

[0168] 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 above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above 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, comprising: 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 less than the original rate.

2. The method according to claim 1, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: The method further comprises: If the cache duration obtained in the current cycle is less than the second threshold duration, and the current If the playback rate of the live video is the second rate, it is determined whether the cache duration obtained in the current period is less than a 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, wherein: 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, wherein: 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, wherein: 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, comprising: 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, 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 one of claims 1-9 when executing the computer program.

12. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a computing device, the computing device implements the video live broadcast method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Streaming media playing method and device

    CN105100876A

  • Network live method and device and memory medium

    CN107396171A

  • Method and apparatus for adaptively adjusting video cache size

    CN107529097A

  • Live streaming cache processing method and device, equipment and storage medium

    CN110248204A

  • Video playing method and system for real-time video call

    CN113727186A