Video stream playback method and device, storage medium, and program product
By dynamically adjusting the clarity of the video stream according to the current screen brightness of the playback device, the problem of traffic waste and lagging during playback is solved, and the viewing experience of the video stream is improved.
Patent Information
- Application Number
- PCT/CN2024/080122
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-08
- Filing Date
- 2024-03-05
- Publication Date
- 2024-09-12
AI Technical Summary
When playing video streams such as live broadcasts, the default definition is usually used, resulting in wasted traffic and video freezes, affecting the viewing experience.
By obtaining the current screen brightness of the playback device, the clarity of the video stream is dynamically adjusted. When the brightness is low, a low resolution is used to avoid traffic waste and freezes. When the brightness is high, a high resolution is used to ensure the look and feel.
It can dynamically adjust the video stream definition according to the screen brightness, rationally use bandwidth, reduce lagging during video stream playback, and improve the viewing experience.
Smart Images

Figure CN2024080122_12092024_PF_FP_ABST
Abstract
Description
Video stream playback method, device, storage medium and program product
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on the application with CN application number 202310220622.4 and application date March 8, 2023, and claims its priority. The disclosed content of the CN application is hereby introduced as a whole into this application. Technical Field
[0003] The embodiments of the present disclosure relate to the field of computer and network communication technology, and more particularly to a video stream playback method, device, storage medium, and program product. Background Art
[0004] With the development of Internet technology, people may watch live broadcasts and other video streams in a variety of places.
[0005] When playing live broadcasts and other video streams, the default clarity is usually used, which leads to a certain amount of traffic waste and may also cause problems such as video freezes, affecting the viewing experience of the video stream.
[0006] Summary of the Invention
[0007] In a first aspect, an embodiment of the present disclosure provides a video stream playback method, comprising:
[0008] Get the current screen brightness of the playback device;
[0009] Determining a target definition of the video stream according to the current screen brightness;
[0010] The video stream of the target definition is acquired, and the video stream of the target definition is played.
[0011] In a second aspect, an embodiment of the present disclosure provides a video stream playback device, comprising:
[0012] A detection unit, used to obtain the current screen brightness of the playback device;
[0013] a definition determination unit, configured to determine a target definition of the video stream according to the current screen brightness;
[0014] The switching unit is configured to obtain the video stream of the target definition and play the video stream of the target definition.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
[0016] The memory stores computer-executable instructions;
[0017] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video stream playback method as described in any embodiment of the present disclosure.
[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video stream playback method as described in any embodiment of the present disclosure is implemented.
[0019] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, comprising computer-executable instructions. When a processor executes the computer-executable instructions, the video stream playback method as described in any embodiment of the present disclosure is implemented.
[0020] In a sixth aspect, according to one or more embodiments of the present disclosure, a computer program is provided, comprising instructions, which, when executed by a processor, enable the processor to implement the video stream playback method described in any embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] FIG1 is a diagram illustrating an example scenario of a video stream playback method provided by some embodiments of the present disclosure;
[0023] FIG2 is a flow chart of a video stream playback method provided by some embodiments of the present disclosure;
[0024] FIG3 is a flow chart of a video stream playback method provided by other embodiments of the present disclosure;
[0025] FIG4 is a flow chart of a video stream playback method provided by yet other embodiments of the present disclosure;
[0026] FIG5 is a flowchart of a video stream playback method provided by some further embodiments of the present disclosure;
[0027] FIG6 is a structural block diagram of a video stream playback device provided by some embodiments of the present disclosure;
[0028] FIG7 is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of the present disclosure. DETAILED DESCRIPTION
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0030] When playing live broadcasts and other video streams, the playback device usually uses the default definition for playback, resulting in a certain amount of traffic waste and possible problems such as video freezes, affecting the viewing experience of the video stream.
[0031] In order to solve the above technical problems, the present disclosure takes into account that when the current screen brightness of the playback device is low, the resolution of the video stream has little effect on the video viewing experience, and the video stream can be played at a low resolution (for example, the first resolution), which can avoid traffic waste and video freeze; and when the current screen brightness is high, the resolution of the video stream has a greater impact on the video viewing experience, and the video stream can be played at a high resolution (for example, the second resolution, which is higher than the first resolution) to ensure the viewing experience of the video stream. Therefore, an embodiment of the present disclosure provides a video stream playback method, which obtains the current screen brightness of the playback device; determines the target clarity of the video stream according to the current screen brightness; obtains the video stream of the target clarity, and plays the video stream of the target clarity. The method disclosed in the present disclosure can select a suitable clarity for the video stream according to the current screen brightness of the playback device, so as to dynamically adjust the clarity of the video stream according to the current screen brightness, reasonably use bandwidth costs, reduce freezes during video stream playback, and ensure the viewing experience of the video stream.
[0032] The video stream playback method disclosed herein is applicable to the application scenario shown in FIG1 . It can obtain the current screen brightness of a playback device 11; determine the target definition of the video stream based on the current screen brightness; and then playback device 11 obtains the target definition video stream from a server 12 and plays the target definition video stream. The video stream includes, but is not limited to, short video streams and live video streams.
[0033] It should be noted that the user information and data involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0034] In addition, a definition automatic switching control may be displayed, and the user may choose whether to trigger it. After triggering the definition automatic switching control, the video stream playback method provided by each embodiment of the present disclosure may be executed.
[0035] The video stream playback method disclosed herein will be described in detail below with reference to specific embodiments.
[0036] Referring to Figure 2, which is a flowchart of a video stream playback method provided by some embodiments of the present disclosure, the method of this embodiment can be applied to a playback device capable of playing video streams, and the video stream playback method includes steps S201 to S203.
[0037] S201: Obtain the current screen brightness of the playback device.
[0038] In some embodiments, for a playback device with a display, the current screen brightness may be expressed in brightness units, such as candela per square meter (cd / m 2 ) or Nits; for playback devices such as projectors or laser TVs, luminous flux units such as lumens or ANSI lumens can be used.
[0039] In some embodiments, the current screen brightness is normalized to be within the range [0, 1]. For example, the ratio of the current screen brightness to the maximum screen brightness is obtained as the normalized current screen brightness. Alternatively, the current screen brightness of the playback device may be obtained in response to a user's request to obtain the current screen brightness of the playback device.
[0040] S202: Determine a target definition of the video stream according to the current screen brightness.
[0041] In this embodiment, it is taken into account that when the current screen brightness is low, the resolution of the video stream has little effect on the video viewing experience; and when the current screen brightness is high, the resolution of the video stream has a greater impact on the video viewing experience. Therefore, when the current screen brightness is low, the video stream can be played at a low resolution (for example, the first resolution) to avoid traffic waste and video freezes, and when the current screen brightness is high, the video stream can be played at a high resolution (for example, the second resolution, which is higher than the first resolution) to ensure the viewing experience of the video stream. Therefore, in this embodiment, the mapping relationship between different preset screen brightness and preset clarity can be pre-configured, and then the preset clarity corresponding to the current screen brightness is determined according to the mapping relationship as the target clarity of the video stream.
[0042] In some embodiments, a mapping relationship between different preset screen brightnesses and preset clarity is pre-configured, and the screen brightness can be divided into at least two levels: if the screen brightness is greater than a preset brightness threshold, it is a high screen brightness level, corresponding to a first clarity (such as high definition); if the screen brightness is not greater than the preset brightness threshold, it is a low screen brightness level, corresponding to a second clarity (such as low definition), where the first clarity is higher than the second clarity; of course, the screen brightness can also be divided into more levels, which is only used as an example here.
[0043] In some embodiments, if the current screen brightness is greater than a preset brightness threshold, the target clarity is determined to be the first clarity (of course, other clarity values can also be used. If the default clarity of the playback device also belongs to the high-definition range, the target clarity can also be determined to be the default clarity), so that the video stream is played at a relatively high clarity under high screen brightness levels to ensure the viewing experience of the video stream; if the current screen brightness is not greater than the preset brightness threshold, the target clarity is determined to be the second clarity (of course, other clarity values can also be used. If the default clarity of the playback device also belongs to the low-definition range, the target clarity can also be determined to be the default clarity), so that the video stream is played at a relatively low clarity under low screen brightness levels to avoid traffic waste and video freezes.
[0044] In some embodiments, when the current screen brightness is normalized, the target clarity of the video stream can be determined based on the normalized current screen brightness, that is, the preset brightness threshold in the above example also belongs to the [0,1] interval, and then the normalized current screen brightness is compared with the preset brightness threshold to determine the corresponding target clarity.
[0045] S203: Acquire the video stream of the target definition, and play the video stream of the target definition.
[0046] In this embodiment, after determining the target definition of the video stream, the playback device may request the video stream data of the target definition from the server, and play the video stream data of the target definition.
[0047] The video stream playback method provided in this embodiment obtains the current screen brightness of the playback device; determines the target definition of the video stream based on the current screen brightness; obtains the video stream with the target definition; and plays the video stream with the target definition. This embodiment selects an appropriate definition for the video stream based on the current screen brightness of the playback device, thereby dynamically adjusting the video stream definition based on the current screen brightness, rationally utilizing bandwidth costs, reducing video playback lag, and ensuring a better viewing experience.
[0048] On the basis of any of the above embodiments, as shown in FIG3 , when determining the target definition of the video stream according to the current screen brightness in S202 , the process may further include: steps S301 to S301 .
[0049] S301: Determine whether the screen brightness has changed.
[0050] S302: If it is determined that the screen brightness has changed, the target clarity is determined according to the changed screen brightness and the clarity at that time (current).
[0051] In this embodiment, the change of screen brightness can be detected. When the change of screen brightness is detected, the changing trend of the target clarity can be determined. For example, when the screen brightness changes from low brightness to high brightness, the target clarity can be improved; when the screen brightness changes from high brightness to low brightness, the target clarity can be reduced. However, since the clarity at this time is different, for example, the clarity at this time may be relatively low clarity or relatively high clarity, it is necessary to determine the target clarity based on the changed screen brightness and the clarity at this time. That is, if the clarity at this time is suitable for the changed screen brightness, there is no need to adjust the clarity, that is, the target clarity is equal to the clarity at this time; if the clarity at this time is not suitable for the changed screen brightness, it is necessary to adjust the clarity, and select the corresponding target clarity according to the changed screen brightness.
[0052] In an optional embodiment, when determining the target clarity based on the changed screen brightness and the clarity at this time (current), one or more of the following situations may be specifically included.
[0053] The first case: if it is determined that the current screen brightness is greater than the preset brightness threshold, the changed screen brightness is not greater than the preset brightness threshold (that is, the screen brightness is reduced), and the clarity at this time is higher than the first preset clarity threshold (which can be the second clarity in the above embodiment, or other clarity), then the clarity at this time does not meet the changed screen brightness, and the target clarity can be determined as the third clarity according to the changed screen brightness. The third clarity is not higher than the first preset clarity threshold, that is, the clarity of the video stream is reduced from higher than the first preset clarity threshold to the first preset clarity threshold or lower than the first preset clarity threshold, that is, the clarity of the video stream is reduced from high clarity to low clarity.
[0054] The second case: if it is determined that the current screen brightness is not greater than the preset brightness threshold, the changed screen brightness is greater than the preset brightness threshold (that is, the screen brightness is increased), and the clarity at this time is lower than the second preset clarity threshold (the second preset clarity threshold is higher than the first preset clarity threshold, which can be the first clarity in the above embodiment, or other clarity), then the clarity at this time does not meet the changed screen brightness, and the target clarity can be determined as the fourth clarity according to the changed screen brightness. The fourth clarity is not lower than the second preset clarity threshold, that is, the clarity of the video stream is increased from lower than the second preset clarity threshold to the second preset clarity threshold or higher than the second preset clarity threshold, that is, the clarity of the video stream is increased from low clarity to high clarity.
[0055] The third case: If it is determined that the current screen brightness is greater than the preset brightness threshold, the changed screen brightness is not greater than the preset brightness threshold (that is, the screen brightness is reduced), and the clarity at this time is not higher than the first preset clarity threshold, then the clarity at this time can meet the changed screen brightness, and there is no need to adjust the clarity (the target clarity can be considered equal to the clarity at this time), and the video stream continues to be played at the clarity at this time.
[0056] The fourth case: If it is determined that the current screen brightness is not greater than the preset brightness threshold, and the changed screen brightness is greater than the preset brightness threshold (that is, the screen brightness is increased), and the clarity at this time is not lower than the second preset clarity threshold, then the clarity at this time can meet the changed screen brightness, and there is no need to adjust the clarity (the target clarity can be considered equal to the clarity at this time), and the video stream continues to be played at the clarity at this time.
[0057] When the screen brightness changes, it can be determined which of the above conditions is currently met, thereby determining whether the clarity needs to be switched. If the clarity needs to be switched, the target clarity is determined.
[0058] On the basis of any of the above embodiments, as shown in FIG4 , the step of obtaining the video stream of the target definition in S203 may include steps S401 to S402 .
[0059] S401: Determine whether a preset definition switching condition is met.
[0060] S402: If the preset definition switching condition is met, obtain the video stream of the target definition.
[0061] In this embodiment, when it is determined that the video stream needs to switch the clarity, it may not necessarily meet the conditions required for the clarity switching. In particular, when the video stream switches from low clarity to high clarity, it requires more network resources and device resources. Therefore, it is also necessary to determine whether the playback device meets the preset clarity switching conditions, where the preset clarity switching conditions include but are not limited to network conditions, device performance of the playback device, etc. Only when the preset clarity switching conditions are met can the clarity switching be continued, that is, the video stream of the target clarity is obtained and played. Otherwise, the clarity switching can be stopped and the video stream can be continued to be played at the original clarity.
[0062] Based on the above embodiment, the determination of whether the preset definition switching condition is met includes:
[0063] Determine whether the network status of the playback device meets the preset network conditions; and / or
[0064] Determine whether the performance status of the playback device meets the preset performance conditions.
[0065] In this embodiment, the network status of the playback device can be obtained, where the network status of the playback device can be a real-time network status, such as the current uplink and downlink rates, or a network status over a period of time, such as a comprehensive judgment of the uplink and downlink rates of all data over a period of time. In addition, the preset uplink and downlink rates can be used as the preset network conditions, and the uplink and downlink rates can be directly compared with the preset uplink and downlink rates to determine whether the network status of the playback device meets the preset network conditions. For example, the current network downlink rate DownloadBitRate of the playback device is compared with the preset downlink rate, where the preset downlink rate is a preset multiple of the average bit rate HighBitRate of the high-definition (such as the first definition) video stream, such as 1.1 times. That is, when DownloadBitRate ≥ 1.1 * HighBitRate, the network status of the playback device meets the preset network conditions. The network status of the playback device can also be divided into different levels (such as the first level, the second level, etc., where the first level is better than the second level). If the current network status of the playback device belongs to certain levels (such as the first level), it is determined that the network status of the playback device meets the preset network conditions.
[0066] In addition, in this embodiment, the performance status of the playback device can also be obtained, where the performance status of the playback device is used to reflect the load level of the playback device. It can be any parameter that can reflect the load level of the playback device. The performance status of the playback device can be a real-time performance status or a comprehensive judgment of the performance status over a period of time. In addition, a parameter value can be preset as a preset performance condition, and the parameter value of the performance status of the playback device can be directly compared with the preset parameter value to determine whether the performance status of the playback device meets the preset performance condition; the performance status of the playback device can also be divided into different levels (for example, divided into the first level, the second level, etc. according to the performance load level, where the first level is better than the second level). If the performance status of the current playback device belongs to certain levels (for example, the first level, etc.), it is determined that the performance status of the playback device meets the preset performance condition.
[0067] By determining the network status and / or performance status of the playback device, differentiated definition control and switching can be achieved based on changes in the playback device's screen brightness, network conditions, and performance changes. It should be noted that if the video stream requires a lower definition, the determination of the preset definition switching conditions does not need to be performed.
[0068] Based on the above embodiment, after determining that the playback device meets the preset definition switching conditions, if the playback device cannot smoothly switch the definition, especially if there is a pause when switching the definition, the definition of the video stream will not be switched, that is, the video stream will continue to be played at the original definition. Only if there is no pause when switching the definition, the definition will be switched again. Therefore, as shown in Figure 5, when obtaining the video stream of the target definition, it specifically includes: Steps S501 to S502.
[0069] S501: Determine, based on the playback buffer, whether the definition of the video stream can be switched without causing a freeze.
[0070] S502: If it is determined that the definition of the video stream can be switched without causing a freeze, a video stream of the target definition is obtained.
[0071] In this embodiment, after determining that the playback device meets the preset definition switching conditions, before actually executing the video stream definition switching, it can be determined whether the video stream can switch the definition without causing a freeze. Considering that after switching the video stream, a series of operations such as requesting the video stream data at the switched definition (the video stream address needs to be switched) and decoding the video stream data require a certain amount of time. During this period, the video stream can continue to be played at the original definition. After the video stream of the switched definition can be played normally, it can be seamlessly connected to avoid freezes when switching the definition. Therefore, the playback device needs to have sufficient playback cache for the video stream of the original definition to ensure that there is a sufficient length of the original definition video stream as a buffer during the switching process. Therefore, in this embodiment, it can be determined whether the video stream can switch the definition without causing a freeze based on the playback cache of the video stream by the playback device, that is, whether the playback device has sufficient playback cache for the video stream of the original definition and whether it can ensure that there is a sufficient length of the original definition video stream as a buffer during the switching process. The playback cache of the video stream can be determined by the playback device based on the cache.
[0072] In some embodiments, the current playback cache data volume of the video stream of the playback device at the time (current) clarity (clarity before switching) is determined; the target playback cache data volume of the video stream is determined, wherein the target playback cache data volume is the data volume that can ensure that the video stream with the original clarity is of sufficient length as a buffer during the switching process; and then the current playback cache data volume can be compared with the target playback cache data volume. If the current playback cache data volume is greater than or equal to the target playback cache data volume, it means that the video stream with the original clarity of the playback device has sufficient playback cache, which can ensure that the video stream with the original clarity is of sufficient length as a buffer during the switching process, and then it is determined that the video stream can switch clarity without any lag.
[0073] In some embodiments, the current playback cache data volume of the video stream at the current clarity (clarity before switching) of the playback device is recorded as PlayBuffer; the target playback cache data volume of the video stream is determined, including determining the target playback cache data volume of the video stream based on the average video bit rate of the video stream and the preset cache duration, as follows.
[0074] The product of the average video bit rate BitRate of the video stream and the preset cache duration N (how long the video stream data is currently cached, in seconds) is obtained to determine the target playback cache data volume N*BitRate of the video stream.
[0075] If PlayBuffer>=N*BitRate, it is determined that the video stream can switch the definition without causing any lag, and the definition switching can continue.
[0076] Of course, if it is determined that the current playback buffer data volume is continuously less than the target playback buffer data volume for a preset duration (e.g., 5 seconds), it is determined that the video stream cannot switch the definition without causing a freeze, and the execution of switching the video stream definition is stopped. That is, in this embodiment, the determination of whether the video can be played without a freeze is maintained for a maximum of a preset duration. If the current playback buffer data volume still does not reach the target playback buffer data volume when the preset duration is reached, the execution of switching the video stream definition is stopped, and the video stream continues to be played at the original definition.
[0077] Based on any of the above embodiments, after the video stream switches clarity, the video stream's stuttering or smoothness can be continuously detected. If the video stream's stuttering meets the preset stuttering judgment conditions, for example, the cumulative stuttering time reaches M seconds within N seconds during playback, the video stream needs to be switched back to the original clarity, and the video stream continues to be played at the original clarity to ensure the smoothness of the video stream playback.
[0078] Corresponding to the video stream playback method described in the preceding embodiment, FIG6 is a block diagram of the structure of a video stream playback device provided in an embodiment of the present disclosure. For ease of illustration, only the portions relevant to the embodiment of the present disclosure are shown. Referring to FIG6 , the video stream playback device 600 includes a detection unit 601, a clarity determination unit 602, and a switching unit 603.
[0079] The detection unit 601 is used to obtain the current screen brightness of the playback device.
[0080] The definition determination unit 602 is configured to determine a target definition of the video stream according to the current screen brightness.
[0081] The switching unit 603 is configured to obtain the video stream of the target definition and play the video stream of the target definition.
[0082] In one or more embodiments of the present disclosure, when determining the target definition of the video stream according to the current screen brightness, the definition determination unit 602 is configured to:
[0083] According to the current screen brightness and a mapping relationship between the preset screen brightness and the preset definition, the preset definition corresponding to the current screen brightness is determined as the target definition of the video stream.
[0084] In one or more embodiments of the present disclosure, when determining the target definition of the video stream according to the current screen brightness, the definition determination unit 602 is configured to:
[0085] If the current screen brightness is greater than a preset brightness threshold, determining the target definition to be the first definition; or
[0086] If the current screen brightness is not greater than a preset brightness threshold, the target definition is determined to be a second definition, wherein the first definition is higher than the second definition.
[0087] In one or more embodiments of the present disclosure, when determining the target definition of the video stream according to the current screen brightness, the definition determination unit 602 is configured to:
[0088] Determine whether the screen brightness changes;
[0089] If it is determined that the screen brightness has changed, the target clarity is determined according to the changed screen brightness and the current clarity.
[0090] In one or more embodiments of the present disclosure, when determining that the screen brightness has changed, the clarity determination unit 602 is configured to:
[0091] If it is determined that the current screen brightness is greater than the preset brightness threshold, the changed screen brightness is not greater than the preset brightness threshold, and the current definition is higher than the first preset definition threshold, then determining the target definition to be the third definition, wherein the third definition is not higher than the first preset definition threshold; or
[0092] If it is determined that the current screen brightness is not greater than the preset brightness threshold, the changed screen brightness is greater than the preset brightness threshold, and the current clarity is lower than the second preset clarity threshold, then the target clarity is determined to be the fourth clarity, and the fourth clarity is not lower than the second preset clarity threshold, wherein the first preset clarity threshold is lower than the second preset clarity threshold.
[0093] In one or more embodiments of the present disclosure, when acquiring the video stream of the target definition, the switching unit 603 is configured to:
[0094] Determine whether the preset definition switching condition is met;
[0095] If the preset definition switching condition is met, the video stream of the target definition is obtained.
[0096] In one or more embodiments of the present disclosure, when determining whether a preset definition switching condition is met, the switching unit 603 is configured to:
[0097] Determine whether the network status of the playback device meets the preset network conditions; and / or
[0098] Determine whether the performance status of the playback device meets the preset performance conditions.
[0099] In one or more embodiments of the present disclosure, when acquiring the video stream of the target definition, the switching unit 603 is configured to:
[0100] Determine whether the video stream definition can be switched without causing lag based on the playback cache.
[0101] If it is determined that the definition of the video stream can be switched without causing a freeze, a video stream of the target definition is obtained.
[0102] In one or more embodiments of the present disclosure, when determining, based on the playback buffer, whether the definition of the video stream can be switched without causing a freeze, the switching unit 603 is configured to:
[0103] Determining a current playback buffer data amount of the video stream of the current definition in the playback buffer;
[0104] Determine the target playback buffer size for the video stream;
[0105] The current playback cache data volume is compared with the target playback cache data volume. If the current playback cache data volume is greater than or equal to the target playback cache data volume, it is determined that the clarity of the video stream can be switched without causing a freeze.
[0106] In one or more embodiments of the present disclosure, when determining the target playback buffer data amount of the video stream, the switching unit 603 is configured to:
[0107] A target playback buffer data volume of the video stream is determined according to an average video bit rate of the video stream and a preset buffering duration.
[0108] In one or more embodiments of the present disclosure, when determining, based on the playback buffer, whether the definition of the video stream can be switched without causing a freeze, the switching unit 603 is further configured to:
[0109] If it is determined that the current playback cache data volume is continuously less than the target playback cache data volume within the preset time length, it is determined that the clarity of the video stream cannot be switched without causing a freeze, and the execution of switching the clarity of the video stream is stopped.
[0110] In one or more embodiments of the present disclosure, when determining the target definition of the video stream according to the current screen brightness, the definition determination unit 602 is configured to:
[0111] The current screen brightness is normalized, and a target definition of the video stream is determined according to the normalized current screen brightness.
[0112] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.
[0113] Referring to FIG7 , a schematic diagram of the structure of an electronic device 700 suitable for implementing an embodiment of the present disclosure is shown. The electronic device 700 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG7 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0114] As shown in FIG7 , the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the electronic device 700 are also stored in the RAM 703. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0115] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 7 shows an electronic device 700 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0116] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0117] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0118] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0119] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0120] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0122] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0123] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0124] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0125] In a first aspect, according to one or more embodiments of the present disclosure, a video stream playback method is provided, comprising:
[0126] Get the current screen brightness of the playback device;
[0127] Determining a target definition of the video stream according to the current screen brightness;
[0128] The video stream of the target definition is acquired, and the video stream of the target definition is played.
[0129] According to one or more embodiments of the present disclosure, determining the target definition of the video stream according to the current screen brightness includes:
[0130] According to the current screen brightness and a mapping relationship between the preset screen brightness and the preset definition, the preset definition corresponding to the current screen brightness is determined as the target definition of the video stream.
[0131] According to one or more embodiments of the present disclosure, determining the target definition of the video stream according to the current screen brightness includes:
[0132] If the current screen brightness is greater than a preset brightness threshold, determining the target definition to be the first definition; or
[0133] If the current screen brightness is not greater than the preset brightness threshold, the target definition is determined to be a second definition, wherein the first definition is higher than the second definition.
[0134] According to one or more embodiments of the present disclosure, determining the target definition of the video stream according to the current screen brightness includes:
[0135] Determine whether the screen brightness changes;
[0136] If it is determined that the screen brightness has changed, the target clarity is determined according to the changed screen brightness and the current clarity.
[0137] According to one or more embodiments of the present disclosure, if it is determined that the screen brightness has changed, determining the target clarity according to the changed screen brightness and the current clarity includes:
[0138] If it is determined that the current screen brightness is greater than the preset brightness threshold, the changed screen brightness is not greater than the preset brightness threshold, and the current definition is higher than the first preset definition threshold, then determining the target definition to be the third definition, wherein the third definition is not higher than the first preset definition threshold; or
[0139] If it is determined that the current screen brightness is not greater than the preset brightness threshold, the changed screen brightness is greater than the preset brightness threshold, and the current clarity is lower than the second preset clarity threshold, then the target clarity is determined to be the fourth clarity, and the fourth clarity is not lower than the second preset clarity threshold, wherein the first preset clarity threshold is lower than the second preset clarity threshold.
[0140] According to one or more embodiments of the present disclosure, obtaining the video stream of the target definition includes:
[0141] Determine whether the preset definition switching condition is met;
[0142] If the preset definition switching condition is met, the video stream of the target definition is obtained.
[0143] According to one or more embodiments of the present disclosure, determining whether a preset definition switching condition is met includes:
[0144] Determine whether the network status of the playback device meets the preset network conditions; and / or
[0145] Determine whether the performance status of the playback device meets the preset performance conditions.
[0146] According to one or more embodiments of the present disclosure, obtaining the video stream of the target definition includes:
[0147] Determine whether the video stream definition can be switched without causing lag based on the playback cache.
[0148] If it is determined that the definition of the video stream can be switched without causing a freeze, a video stream of the target definition is obtained.
[0149] According to one or more embodiments of the present disclosure, determining whether the definition of the video stream can be switched without causing a freeze based on the playback buffer includes:
[0150] Determining a current playback buffer data amount of the video stream of the current definition in the playback buffer;
[0151] Determine the target playback buffer size for the video stream;
[0152] The current playback cache data volume is compared with the target playback cache data volume. If the current playback cache data volume is greater than or equal to the target playback cache data volume, it is determined that the clarity of the video stream can be switched without causing a freeze.
[0153] According to one or more embodiments of the present disclosure, determining a target playback buffer data amount of a video stream includes:
[0154] A target playback buffer data volume of the video stream is determined according to an average video bit rate of the video stream and a preset buffering duration.
[0155] According to one or more embodiments of the present disclosure, determining whether the definition of the video stream can be switched without causing a freeze based on the playback buffer further includes:
[0156] If it is determined that the current playback cache data volume is continuously less than the target playback cache data volume within the preset time length, it is determined that the clarity of the video stream cannot be switched without causing a freeze, and the execution of switching the clarity of the video stream is stopped.
[0157] According to one or more embodiments of the present disclosure, determining the target definition of the video stream according to the current screen brightness includes:
[0158] The current screen brightness is normalized, and a target definition of the video stream is determined according to the normalized current screen brightness.
[0159] In a second aspect, according to one or more embodiments of the present disclosure, a video stream playback device is provided, comprising:
[0160] A detection unit, used to obtain the current screen brightness of the playback device;
[0161] a definition determination unit, configured to determine a target definition of the video stream according to the current screen brightness;
[0162] The switching unit is configured to obtain the video stream of the target definition and play the video stream of the target definition.
[0163] According to one or more embodiments of the present disclosure, when determining the target definition of the video stream according to the current screen brightness, the definition determination unit is configured to:
[0164] According to the current screen brightness and a mapping relationship between the preset screen brightness and the preset definition, the preset definition corresponding to the current screen brightness is determined as the target definition of the video stream.
[0165] According to one or more embodiments of the present disclosure, when determining the target definition of the video stream according to the current screen brightness, the definition determination unit is configured to:
[0166] If the current screen brightness is greater than a preset brightness threshold, determining the target definition to be the first definition; or
[0167] If the current screen brightness is not greater than a preset brightness threshold, the target definition is determined to be a second definition, wherein the first definition is higher than the second definition.
[0168] According to one or more embodiments of the present disclosure, when determining the target definition of the video stream according to the current screen brightness, the definition determination unit is configured to:
[0169] Determine whether the screen brightness changes;
[0170] If it is determined that the screen brightness has changed, the target clarity is determined according to the changed screen brightness and the current clarity.
[0171] According to one or more embodiments of the present disclosure, when determining that the screen brightness has changed, the clarity determination unit is configured to:
[0172] If it is determined that the current screen brightness is greater than the preset brightness threshold, the changed screen brightness is not greater than the preset brightness threshold, and the current definition is higher than the first preset definition threshold, then the target definition is determined to be the third definition, and the third definition is not higher than the first preset definition threshold; or
[0173] If it is determined that the current screen brightness is not greater than the preset brightness threshold, the changed screen brightness is greater than the preset brightness threshold, and the current clarity is lower than the second preset clarity threshold, then the target clarity is determined to be the fourth clarity, and the fourth clarity is not lower than the second preset clarity threshold; wherein the first preset clarity threshold is lower than the second preset clarity threshold.
[0174] According to one or more embodiments of the present disclosure, when acquiring the video stream of the target definition, the switching unit is configured to:
[0175] Determine whether the preset definition switching condition is met;
[0176] If the preset definition switching condition is met, the video stream of the target definition is obtained.
[0177] According to one or more embodiments of the present disclosure, when determining whether a preset definition switching condition is met, the switching unit is configured to:
[0178] Determine whether the network status of the playback device meets the preset network conditions; and / or
[0179] Determine whether the performance status of the playback device meets the preset performance conditions.
[0180] According to one or more embodiments of the present disclosure, when acquiring the video stream of the target definition, the switching unit is configured to:
[0181] Determine whether the video stream definition can be switched without causing lag based on the playback cache.
[0182] If it is determined that the definition of the video stream can be switched without causing a freeze, a video stream of the target definition is obtained.
[0183] According to one or more embodiments of the present disclosure, when the switching unit determines whether the definition of the video stream can be switched without causing a freeze based on the playback buffer, it is configured to:
[0184] Determining a current playback buffer data amount of the video stream of the current definition in the playback buffer;
[0185] Determine the target playback buffer size for the video stream;
[0186] The current playback cache data volume is compared with the target playback cache data volume. If the current playback cache data volume is greater than or equal to the target playback cache data volume, it is determined that the clarity of the video stream can be switched without causing a freeze.
[0187] According to one or more embodiments of the present disclosure, when determining the target playback buffer data amount of the video stream, the switching unit is configured to:
[0188] A target playback buffer data volume of the video stream is determined according to an average video bit rate of the video stream and a preset buffering duration.
[0189] According to one or more embodiments of the present disclosure, when the switching unit determines whether the definition of the video stream can be switched without causing a freeze based on the playback buffer, it is further configured to:
[0190] If it is determined that the current playback cache data volume is continuously less than the target playback cache data volume within the preset time length, it is determined that the clarity of the video stream cannot be switched without causing a freeze, and the execution of switching the clarity of the video stream is stopped.
[0191] According to one or more embodiments of the present disclosure, when determining the target definition of the video stream according to the current screen brightness, the definition determination unit is configured to:
[0192] The current screen brightness is normalized, and a target definition of the video stream is determined according to the normalized current screen brightness.
[0193] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0194] The memory stores computer-executable instructions;
[0195] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video stream playback method described in any embodiment of the present disclosure.
[0196] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video stream playback method described in any embodiment of the present disclosure is implemented.
[0197] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising computer-executable instructions. When a processor executes the computer-executable instructions, the video stream playback method described in any embodiment of the present disclosure is implemented.
[0198] In a sixth aspect, according to one or more embodiments of the present disclosure, a computer program is provided, comprising instructions, which, when executed by a processor, enable the processor to implement the video stream playback method described in any embodiment of the present disclosure.
[0199] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0200] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0201] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video stream playback method, include: Get the current screen brightness of the playback device; Determining a target definition of the video stream according to the current screen brightness; The video stream of the target definition is acquired, and the video stream of the target definition is played.
2. The video stream playback method according to claim 1, in, Determining the target definition of the video stream according to the current screen brightness includes: According to the current screen brightness and a mapping relationship between the preset screen brightness and the preset definition, the preset definition corresponding to the current screen brightness is determined as the target definition of the video stream.
3. The video stream playing method according to claim 1 or 2, in, Determining the target definition of the video stream according to the current screen brightness includes: If the current screen brightness is greater than a preset brightness threshold, determining the target definition to be the first definition; or If the current screen brightness is not greater than a preset brightness threshold, the target definition is determined to be a second definition, wherein the first definition is higher than the second definition.
4. The video stream playback method according to any one of claims 1 to 3, in, Determining the target definition of the video stream according to the current screen brightness includes: Determine whether the screen brightness changes; If it is determined that the screen brightness has changed, the target clarity is determined according to the changed screen brightness and the current clarity.
5. The video stream playing method according to claim 4, in, If it is determined that the screen brightness has changed, determining the target clarity according to the changed screen brightness and the current clarity includes: If it is determined that the current screen brightness is greater than a preset brightness threshold, the changed screen brightness is not greater than the preset brightness threshold, and the current definition is higher than a first preset definition threshold, then the target definition is determined to be a third definition, wherein the third definition is not higher than the first preset definition threshold; or If it is determined that the current screen brightness is not greater than the preset brightness threshold, the changed screen brightness is greater than the preset brightness threshold, and the current clarity is lower than the second preset clarity threshold, then the target clarity is determined to be the fourth clarity, and the fourth clarity is not lower than the second preset clarity threshold, wherein the first preset clarity threshold is lower than the second preset clarity threshold.
6. The video stream playing method according to claim 4 or 5, in, The step of obtaining the video stream of the target definition comprises: Determine whether a preset definition switching condition is met; If the preset definition switching condition is met, the video stream of the target definition is obtained.
7. The video stream playing method according to claim 6, in, The determining whether the preset definition switching condition is met includes: Determine whether the network status of the playback device meets the preset network conditions; and / or Determine whether the performance status of the playback device meets the preset performance conditions.
8. The video stream playing method according to any one of claims 1 to 7, in, The step of obtaining the video stream of the target definition comprises: Determine whether the clarity of the video stream can be switched without causing lag based on the playback cache; If it is determined that the definition of the video stream can be switched without causing a freeze, a video stream of the target definition is obtained.
9. The video stream playing method according to claim 8, in, The determining whether the definition of the video stream can be switched without causing a freeze based on the playback buffer includes: Determine the current playback buffer data amount of the video stream of the current definition in the playback buffer; Determine the target playback buffer data volume of the video stream; The current playback cache data volume is compared with the target playback cache data volume. If the current playback cache data volume is greater than or equal to the target playback cache data volume, it is determined that the definition of the video stream can be switched without causing a freeze.
10. The video stream playing method according to claim 9, in, Determining the target playback buffer data amount of the video stream includes: A target playback cache data volume of the video stream is determined according to an average video bit rate of the video stream and a preset cache duration.
11. The video stream playing method according to claim 9 or 10, in, The determining whether the definition of the video stream can be switched without causing a freeze based on the playback buffer also includes: If it is determined that the current playback cache data volume is continuously less than the target playback cache data volume within a preset time period, it is determined that the definition of the video stream cannot be switched without causing a freeze, and the execution of switching the definition of the video stream is stopped.
12. The video stream playing method according to any one of claims 1 to 11, in, Determining the target definition of the video stream according to the current screen brightness includes: The current screen brightness is normalized, and a target definition of the video stream is determined according to the normalized current screen brightness.
13. A video streaming device, include: A detection unit, used to obtain the current screen brightness of the playback device; A definition determination unit, configured to determine a target definition of a video stream according to the current screen brightness; The switching unit is used to obtain the video stream of the target definition and play the video stream of the target definition.
14. An electronic device, include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video stream playback method according to any one of claims 1 to 12.
15. A computer-readable storage medium, in, The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 12 is implemented.
16. A computer program product, comprising computer executable instructions, wherein when a processor executes the computer executable instructions, the video stream playing method according to any one of claims 1 to 12 is implemented.
17. A computer program, comprising instructions, which, when executed by a processor, enable the processor to implement the video stream playback method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Television energy-saving method and device
CN101115166A
Screen luminance regulation method and electronic equipment
CN105807909A
Video definition and brightness detection method based on data annotation learning mechanism
CN114399487A
Method and electronic device for video definition switching
US20160365123A1
Method and device for enhancing video details, mobile terminal, and storage medium
WO2022111269A1
