Video playback method, device, electronic device and readable storage medium

By switching the video source played according to the network speed in the KTV singing device, the problem of video stuttering when the network speed is not ideal is solved, and a smoother video playback experience is achieved.

CN114007142BActive Publication Date: 2024-11-22BEIJING THUNDERSTONE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111296483.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-03
Publication Date
2024-11-22
Estimated Expiration
2041-11-03

AI Technical Summary

Technical Problem

When the network speed is not ideal, when using singing equipment to sing KTV, the played song video is prone to stuttering.

Method used

By obtaining the current network speed, determine the main film source and background film source, and play the main film source with high resolution at the first play position, and play the background film source with low resolution at the second play position, and detect the network speed change. When, switch between the two according to the video playback strategy to ensure smoothness of the picture.

Benefits of technology

It effectively avoids lag caused by changes in network speed, improves user experience, and ensures the smoothness of video playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114007142B_ABST
    Figure CN114007142B_ABST
Patent Text Reader

Abstract

The present invention is applicable to video playback, and provides a video playback method, including: in response to a video playback operation, obtaining a target video of the video playback operation; obtaining the current network speed, and determining the main film source and background film source of the target video according to the current network speed, wherein the resolution of the main film source is higher than the resolution of the background film source; playing the main film source at a first playback position, and playing the background film source at a second playback position; when a change in the network speed is detected, obtaining a replacement film source, and switching the playback film source at the first playback position and the second playback position according to a video playback strategy. The present application avoids freezes caused by changes in network speed by playing film sources with different resolutions at the first playback position and the second playback position, respectively, and switching the film sources played at the first playback position and the second playback position when the network speed changes, thereby improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of video playback, and in particular relates to a video playback method, device, electronic equipment and readable storage medium. Background Art

[0002] With the development of life and the progress of society, people have higher and higher requirements for the clarity of video viewing, and high-resolution HD videos such as 2K, 4K or 8K have also entered our lives.

[0003] When using singing equipment to sing in KTV, if the network speed to which the singing equipment is connected is not ideal, the played song video will be stuck. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a video playback method, device, electronic device and readable storage medium, aiming to solve the problem of freeze in the played song video when the network speed is not ideal.

[0005] The present invention is implemented in this way: a video playing method comprises:

[0006] In response to a video playback operation, obtaining a target video of the video playback operation;

[0007] Acquire the current network speed, and determine the main video source and the background video source of the target video according to the current network speed, wherein the resolution of the main video source is higher than the resolution of the background video source;

[0008] Play the main video source at a first playback position, and play the background video source at a second playback position;

[0009] When a change in network speed is detected, a replacement film source is obtained, and the playback sources of the first playback position and the second playback position are switched according to a video playback strategy.

[0010] Optionally, when a change in network speed is detected, obtaining a replacement film source and switching the playback sources of the first playback position and the second playback position according to a video playback strategy includes:

[0011] Get real-time network speed;

[0012] Comparing the real-time network speed with the playback network speed condition of the main film source, and determining a replacement film source according to the comparison result;

[0013] The playback sources of the first playback position and the second playback position are switched according to the video playback strategy.

[0014] Optionally, comparing the real-time network speed with the playback network speed condition of the primary film source and determining the replacement film source according to the comparison result includes:

[0015] When it is determined that the real-time network speed is higher than the playback network speed condition of the main film source, obtaining a first replacement film source with a higher resolution than the main film source;

[0016] When it is determined that the real-time network speed is lower than the playback network speed condition of the main film source, a second replacement film source with a lower resolution than the background film source is obtained;

[0017] Then, switching the playback source of the first playback position and the second playback position according to the video playback strategy includes:

[0018] When it is determined that the real-time network speed is higher than the playing network speed condition of the main film source, the first replacement film source is played at the first playing position, and the main film source is played at the second position;

[0019] When it is determined that the real-time network speed is lower than the playback network speed condition of the main film source, the background film source is played at the first playback position, and the second replacement film source is played at the second position.

[0020] Optionally, when a change in network speed is detected, obtaining a replacement film source and switching the playback sources of the first playback position and the second playback position according to a video playback strategy includes:

[0021] Get real-time network speed;

[0022] Obtaining a real-time video source corresponding to the real-time network speed;

[0023] The playback sources of the first playback position and the second playback position are switched according to the video playback strategy.

[0024] Optionally, switching the playback source of the first playback position and the second playback position according to the video playback strategy includes:

[0025] Comparing the real-time network speed with the playback network speed condition of the main film source;

[0026] If the real-time network speed is higher than the playback network speed condition of the main film source, the real-time film source is played at the first playback position, and the main film source is played at the second playback position;

[0027] If the real-time network speed is lower than the playback network speed condition of the main film source, the background film source is played at the first playback position, and the real-time film source is played at the second playback position.

[0028] Optionally, playing the background film source at the first play position and playing the real-time film source at the second play position further includes:

[0029] Comparing the real-time network speed with the playback network speed condition of the background film source;

[0030] If the real-time network speed is higher than the playback network speed condition of the background film source, the real-time film source is played at the first playback position, and the background film source is played at the second playback position;

[0031] If the real-time network speed is lower than the playback network speed condition of the background film source, the background film source is played at the first playback position, and the real-time film source is played at the second playback position.

[0032] Optionally, the first playback position is a display screen, and the second playback position is a background.

[0033] Optionally, the background film source includes a first background film source and a second background film source, and a resolution of the first background film source is higher than a resolution of the second background film source;

[0034] Playing the background source at the second playback position includes:

[0035] Play the first background film source at the second play position, and play the second background film source at the third play position;

[0036] Then, when a change in network speed is detected, obtaining a replacement source and switching the playback source of the first playback position and the second playback position according to the video playback strategy includes:

[0037] When a change in the network speed is detected, a replacement film source is obtained, and the playback sources of the first playback position, the second playback position, and the third playback position are switched according to a video playback strategy.

[0038] The embodiment of the present invention further provides a video playback device, comprising:

[0039] A target acquisition module, used for acquiring a target video of the video playback operation in response to the video playback operation;

[0040] A film source determination module, used to obtain the current network speed, and determine the main film source and background film source of the target video according to the current network speed, wherein the resolution of the main film source is higher than the resolution of the background film source;

[0041] A film source playing module, used for playing the main film source at a first playing position and playing the background film source at a second playing position;

[0042] The video source switching module is used to obtain a replacement video source when a change in network speed is detected, and switch the video sources of the first playback position and the second playback position according to the video playback strategy. An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, each step in the video playback method described above is implemented.

[0043] An embodiment of the present invention further provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step in the video playback method described above is implemented.

[0044] Compared with the prior art, the present invention has the following beneficial effects: when a video playback operation is detected, the video playback method provided by the present application will obtain the target video corresponding to the video playback operation, obtain the current network speed, determine the main film source and background film source of the target video according to the current network speed, wherein the resolution of the main film source is higher than the resolution of the background film source, play the main film source at the first playback position and play the background film source at the second playback position, and when a change in the network speed is detected, obtain a replacement film source, and switch the playback film source at the first playback position and the second playback position according to the playback strategy. The present application avoids the jamming caused by the change in network speed by playing film sources with different resolutions at the first playback position and the second playback position respectively, and switches the film sources played at the first playback position and the second playback position when the network speed changes, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is a flow chart of a video playback method provided by an embodiment of the present invention;

[0046] Figure 2 is a flow chart of a video playback method provided by another embodiment of the present invention;

[0047] Figure 3 It is a structural schematic diagram of a video playback device provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0049] In order to prevent the video from being stuck due to network speed problems during video playback and to make users feel that the video is playing smoothly, the technical solution provided by this application uses the method of playing video sources of different resolutions at the same time, allowing the video sources to be played in an overlay manner. At the same time, according to the network speed, a certain video channel is displayed on the monitor first, and the video is presented to the user, so that the user does not feel the video stuck, thereby improving the user experience. Based on this, this application provides the following Figure 1 The video playback method shown includes:

[0050] S100, in response to a video playback operation, obtaining a target video of the video playback operation.

[0051] In this step, when the video playback device detects a video playback operation, it will obtain the target video corresponding to the video playback operation. The video playback operation includes a song switching operation triggered by a user through a song ordering system. The song ordering system may include an operating system of a field device, or an application installed in a user's mobile terminal, etc. The video playback operation may also include the next video automatically switched after the previous video is played in the song ordering system. For example, after playing song A, the song ordering system automatically plays the user's preset song B, and the video playback operation device defaults to the operation of automatically playing song B as a video playback operation. When the video playback device detects a video playback operation, it will obtain the target video corresponding to the video playback operation. For example, when the video playback device detects that the user switches to song C using an application installed in the mobile terminal, the video playback device uses song C as the target video for subsequent steps.

[0052] S200, obtaining a current network speed, and determining a main video source and a background video source of the target video according to the current network speed, wherein a resolution of the main video source is higher than a resolution of the background video source.

[0053] In this step, the video playback device obtains the current network speed, which indicates the network speed to which the video playback device is connected, and the video playback device can access the network by wired or wireless means. The video playback device is pre-set with a correspondence between the network speed and the film source, and the film source corresponding to each network speed can be obtained through the correspondence. In practical applications, each target video (such as song C) has a film source with multiple resolutions, and the resolution of the film source is 360P, 480P, 720P, 1080P, 2K, 4K or 8K. Because the resolution has a fixed value, a certain correspondence between the network speed threshold and the resolution can be set. For example, if the network speed is 1M / S~5M / S, the video playback device determines that the resolution of the main film source of the target video is 720P, and the background film source of the target video is 360P; if the network speed is 5M / S~10M / S, the video playback device determines that the resolution of the main film source of the target video is 2K, and the background film source of the target video is 1080P. In the specific implementation process, each source of the resolution corresponding to the target video can be stored in a local storage space, such as the storage hard disk of the video playback device, and the source of each resolution corresponding to the target video can also be in a cloud server. In this application, in order to achieve rapid switching of subsequent sources, the sources of each resolution of all videos are stored in the storage hard disk of the video playback device. It should be noted that the main source and background source of the target video represent videos of different resolutions, but videos of different resolutions correspond to the target video one by one. The resolution of the source refers to the number of pixels contained in a certain area of ​​the source. Specifically, the resolution of 720P is 1280x720 pixels, the resolution of 1080P is 1920*1080 pixels, the resolution of 2k is 2560*1440 pixels, the resolution of 4k is 3840*2160 pixels, and the resolution of 8K is 7680×4320 pixels. "P" is spelled as Progressive, which means line-by-line scanning. The number of P indicates how many rows of pixels there are in the vertical direction, for example: 720P means 720 rows of pixels in the vertical direction, and 1080P means 1080 rows of pixels in the vertical direction. As the resolution becomes larger and larger, it begins to be represented by the "k" value, for example: 2160P begins to be called 4k, but it can also be called 2160P. "k" indicates how many pixels are arranged horizontally. For example, 2k means that the video has approximately 2000 horizontal columns of pixels, and 4k means that the video has approximately 4000 horizontal columns of pixels.

[0054] S300, playing the main video source at a first play position, and playing the background video source at a second play position.

[0055] In this embodiment, the video playback device plays the main film source on the display screen and plays the background film source in the background, that is, the video playback device uses the display screen as the first playback position and the background as the second playback position. It should be noted that the display screen represents a display device presented in front of the user, and the user can visually watch the relevant video through the display screen, and the background represents a related video that is different from the display screen and cannot be visually seen by the user. In this application, the first playback position, that is, the display screen plays a film source with a higher resolution; the second playback position, that is, the background plays a film source with a lower resolution, and the film source switching is realized when the network speed decreases or increases through a dual-channel playback method to avoid the screen from being stuck.

[0056] S400: When a change in network speed is detected, a replacement video source is obtained, and the video sources of the first playback position and the second playback position are switched according to a video playback strategy.

[0057] In this step, when the video playback device detects that the network speed has changed, it will obtain a replacement source and switch the sources of the first playback position and the second playback position. Specifically, the resolution of the replacement source can be higher than the resolution of the main source, or lower than the resolution of the background source. The purpose of the video playback strategy is to ensure that the resolution of the source played at the first playback position is higher than the resolution of the source played at the second playback position.

[0058] The above-mentioned embodiment provided by the present application plays film sources with different resolutions at the first playback position and the second playback position respectively, and switches the film sources played at the first playback position and the second playback position when the network speed changes, thereby avoiding the freeze caused by the change in network speed and improving the user experience. At the same time, before switching the film source, a replacement film source is obtained first to achieve rapid switching of the film source after the subsequent network speed changes to avoid screen freeze.

[0059] Specifically, in other embodiments, step S400, i.e., when a change in network speed is detected, obtaining a replacement source, and switching the playback source of the first playback position and the second playback position according to the video playback strategy includes:

[0060] S411, obtain real-time network speed.

[0061] In this step, the video playback device obtains the real-time network speed of the access, and makes subsequent judgments based on the real-time network speed.

[0062] S412, comparing the real-time network speed with the playback network speed condition of the main film source, and determining a replacement film source based on the comparison result.

[0063] In this step, when the video playback device determines that the real-time network speed is higher than the playback network speed condition of the main film source, it obtains a first replacement film source with a higher resolution than the main film source; when the video playback device determines that the real-time network speed is lower than the playback network speed condition of the main film source, it obtains a second replacement film source with a lower resolution than the background film source. Specifically, in this embodiment, the video playback device is provided with film source resolutions corresponding to each network speed interval. When the amplitude of the network speed change exceeds the network speed interval, the resolution of the interval where the network speed is located will be obtained. For example, the network speed interval of the current main film source is 5.1M / S~10M / S, and the resolution of the main film source is 2K. If the real-time network speed becomes 13M / S, and the real-time network speed interval falls within the network speed interval of 10.1M / S~15M / S corresponding to the film source with a resolution of 4K, then the video playback device will Obtain a film source with a resolution greater than 2K, that is, a 4K film source; if the network speed range of the current main film source is 5.1M / S~10M / S, and the resolution of the main film source is 2K, if the real-time network speed becomes 4M / S, the real-time network speed range falls within the network speed range of 1M / S~4.9M / S corresponding to the film source with a resolution of 1080P. Because the resolution of the current background film source is 1080P, the video playback device will obtain a film source with a resolution smaller than 1080P, that is, a film source with a resolution of 720P.

[0064] S413: Switch the playback sources of the first playback position and the second playback position according to the video playback strategy.

[0065] In this step, when the video playback device determines that the real-time network speed is higher than the playback network speed condition of the main film source, the first replacement film source is played at the first playback position, and the main film source is played at the second position; when the real-time network speed is determined to be lower than the playback network speed condition of the main film source, the background film source is played at the first playback position, and the second replacement film source is played at the second position. Specifically, as described in step S412, if the video playback device determines that the real-time network speed of 13M / S is higher than the playback network speed interval of 5.1M / S to 10M / S of the main film source, the video playback network speed will play the first replacement film source with a resolution of 4K at the first playback position, and play the main film source with a resolution of 2K at the second playback position; if the video playback device determines that the real-time network speed of 4M / S is lower than the playback network speed interval of 5.1M / S to 10M / S of the main film source, the video playback network speed will play the background film source with a resolution of 1080P at the first playback position, and play the second replacement film source with a resolution of 720P at the second playback position.

[0066] In this embodiment, in order to quickly switch the film source, the video playback device is configured to obtain a replacement film source and switch the playback source of the first playback position and the second playback position when the network speed changes. The video playback strategy is to ensure that the resolution of the film source played at the first playback position is higher than the resolution of the film source played at the second playback position, and during the switching process, the film source originally played at the first playback position is switched to the second playback position, and the replacement film source is played at the first playback position; or the film source originally at the second playback position is switched to the first playback position, and the replacement source is switched at the second playback position to achieve fast switching.

[0067] In the above-mentioned embodiment provided in the present application, the video playback device obtains the real-time network speed, and determines the replacement film source according to the real-time network speed. The replacement film source can have a higher resolution than the main film source, or a lower resolution than the background film source. After obtaining the replacement film source, the video playback device switches the playback source of the first playback device and the second playback device to play the film source at the first playback position and the second playback position while meeting the real-time network speed requirement, thereby avoiding freezes in the picture displayed in front of the user by video overlay.

[0068] Specifically, in other embodiments, step S400, i.e., when a change in network speed is detected, obtaining a replacement source, and switching the playback source of the first playback position and the second playback position according to the video playback strategy includes:

[0069] S421, obtain real-time network speed.

[0070] In this step, the video playback device obtains the real-time network speed of the access, and makes subsequent judgments based on the real-time network speed.

[0071] S422, obtaining a real-time video source corresponding to the real-time network speed.

[0072] In this step, the video playback device will obtain the real-time video source corresponding to the real-time network speed. Specifically, in this embodiment, each network speed corresponds to a video source of a specific resolution.

[0073] S423: Switch the playback sources of the first playback position and the second playback position according to the video playback strategy.

[0074] In this step, the video playback device compares the real-time network speed with the playback network speed condition of the main film source; if the real-time network speed is higher than the playback network speed condition of the main film source, the real-time film source is played at the first playback position, and the main film source is played at the second playback position; if the real-time network speed is lower than the playback network speed condition of the main film source, the background film source is played at the first playback position, and the real-time film source is played at the second playback position. Optionally, playing the background film source at the first playback position and playing the real-time film source at the second playback position also includes: comparing the real-time network speed with the playback network speed condition of the background film source; if the real-time network speed is higher than the playback network speed condition of the background film source, the real-time film source is played at the first playback position, and the background film source is played at the second playback position; if the real-time network speed is lower than the playback network speed condition of the background film source, the background film source is played at the first playback position, and the real-time film source is played at the second playback position. In this step, the video playback device switches the playback source of the first playback position and the second playback position according to the acquired real-time video source, and satisfies the resolution of the playback source of the first playback position higher than the resolution of the playback source of the second playback position under the real-time network speed. The playback network speed condition of the main video source and the background video source refers to the playback network speed of the respective resolutions set in advance.

[0075] In this embodiment, the video playback device obtains a real-time film source, and switches the playback sources at the first playback position and the second playback position according to the playback network speed requirements of the real-time film source, the main film source, and the background film source to meet different network speed requirements, avoid freezes in the video displayed in front of the user, and improve the user experience.

[0076] Figure 2 The video playback method provided by the present application and the embodiment is shown, including:

[0077] S201, the video playback device detects a video playback operation, determines a target video, and starts playing preparations;

[0078] S202, the video playback device detects the network access status and obtains the current network speed Speed1;

[0079] S203, the video playback device obtains two sources Vcur and Vback that can be played at the current network speed Speed1, wherein the contents played by the sources Vcur and Vback are completely identical, that is, the sources Vcur and Vback are both sources corresponding to the target video, and the resolution of the source Vcur is higher than that of the source Vback, and the current network speed Speed1 indicates the network speed that can play the source Vcur;

[0080] S204, the video playback device plays the film source Vcur at a first playback position, and plays the film source Vback at a second playback position, wherein the first playback position is a display screen, and the second playback position is a background. When the video playback device plays the film source Vcur and the film source Vback, the film source Vcur is blocked in front of the film source Vback.

[0081] S205, the video playback device detects the real-time network speed Speed2, and determines whether the real-time network speed Speed2 is higher than the current network speed Speed1;

[0082] S206, the video playback device determines that the real-time network speed Speed2 is lower than the network speed Speed1 of the film source Vcur, and then plays the film source Vback at the first playback position, and obtains a film source Vback1 with a lower resolution than the film source Vback, and plays the film source Vback1 at the second playback position;

[0083] S207, the video playback device determines that the real-time network speed Speed2 is higher than the network speed Speed1 of the film source Vcur, then stops playing the film source Vback at the second playback position, obtains a film source Vcur1 with a higher resolution than the film source Vcur, plays the film source Vcur1 at the first playback position, and plays the film source Vcur at the second playback position;

[0084] S208, the video playback device sets the source played by the first playback device as Vcur, sets the source played by the second playback device as Vback, and returns to step S205.

[0085] In this embodiment, when the video playback device starts to play the target video, it first obtains the film source Vcur and the film source Vback that can meet the current network speed under the current network speed, and plays the film source Vcur on the display screen and plays the film source Vback in the background. During the playback process, the real-time network speed is obtained, and the source played is adjusted according to the real-time network speed to avoid the problem of screen freeze when the source is switched due to the network speed. It should be noted that in this embodiment, the source played on the display screen is defined as Vcur, and the source played in the background is defined as Vback. After the network speed changes and the source switching is completed, the video playback device continues to use the source played on the display screen as Vcur, and the source played in the background as Vback for subsequent network speed detection and judgment steps. At the same time, the above expression is only for the convenience of expression. Different parameters are defined by Vcur, Vcur1, Vback, Vback1, Speed1, and Speed2, and should not be understood as only being protected by them.

[0086] In other embodiments provided in the present application, in addition to a method for realizing convenient switching between simultaneous playback of two-channel videos on a display screen and in the background, a three-channel video playback method can also be used to realize fast switching playback of videos. For example, in step S200, the current network speed is obtained, and in the step of determining the main film source and background film source of the target video according to the current network speed, the background film source includes a first background film source and a second background film source, and the resolution of the first background film source is higher than the resolution of the second background film source; then in step S300, the step of playing the background film source at the second playback position includes: playing the second background film source at the second playback position, and playing the third background film source at the third playback position; when step S300 includes the second playback position and the third playback position, in step S400, when a change in the network speed is detected, a replacement film source will be obtained, and the playback sources of the first playback position, the second playback position, and the third playback position will be switched according to the video playback strategy.

[0087] Specifically, in the above embodiment, the second playback position and the third playback position are both in the background. In actual application, when the main source is played on the display screen (i.e., the first playback position), two videos are played simultaneously in the background, that is, the first background source is played in the first background, and the second background source is played in the second background. During playback, the first background source played in the first background blocks the front of the second background source played in the second background. When the network speed changes, a replacement source is obtained, and the playback sources of the display screen, the first background, and the second background are switched according to the video playback strategy. Below, taking the source played on the display screen (i.e., the first playback position) as AA, the source played on the first background (i.e., the second playback position) as BB, and the source played on the second background (i.e., the third playback position) as CC as an example, this embodiment is further explained:

[0088] 1. Under the current network speed Speed-A, if the playback conditions of playing source AA on the display screen, playing video BB in the first background, and playing CC in the third background are met, the source is played according to the video playback strategy, wherein the resolution is sorted from high to low, source AA>source BB>source CC; 2. If it is detected that the current network speed changes from Speed-A to Speed-B, and the network speed of Speed-B is higher than Speed-A, a replacement source DD is obtained, and the resolution of the replacement source DD is higher than the resolution of the source AA, that is, according to the source resolution from high to low, source DD>source AA>source BB>source CC, then according to the video playback strategy, the source played on the display screen (i.e., the first playback position) is DD, the source played on the first background (i.e., the second playback position) is AA, and the source played on the second background (i.e., the third playback position) is BB;

[0089] 3. If it is detected that the current network speed changes from Speed-A to Speed-C, and the network speed of Speed-C is lower than that of Speed-A, obtain a replacement source EE, the resolution of which is lower than the resolution of source CC, that is, sort the sources from high to low in terms of resolution, source AA>source BB>source CC>source EE. Then, according to the video playback strategy, at this time, the source played on the display screen (i.e., the first playback position) is BB, the source played on the first background (i.e., the second playback position) is CC, and the source played on the second background (i.e., the third playback position) is EE.

[0090] Figure 3 The video playback device provided in the embodiment of the present application is shown, comprising:

[0091] A target acquisition module 301 is used to acquire a target video of the video playback operation in response to the video playback operation;

[0092] The video source determination module 302 is used to obtain the current network speed, and determine the main video source and the background video source of the target video according to the current network speed, wherein the resolution of the main video source is higher than the resolution of the background video source;

[0093] The film source playing module 303 is used to play the main film source at a first playing position and play the background film source at a second playing position;

[0094] The film source switching module 304 is used to obtain a replacement film source when a change in network speed is detected, and switch the playback sources of the first playback position and the second playback position according to the video playback strategy.

[0095] In this embodiment, the modules in the video playback device cooperate with each other to complete the following video playback method: when playing a new content video, find two video sources with the same content and can be played at the current network speed, use two players, and play the two videos at the same time, with the video with higher resolution in front and the video with lower resolution in the back, set the video displayed on the screen as VCur, and set the video played in the background as VBack, monitor the network speed during the video playback, if the network speed is too low for the current video, switch to VBack (that is, put the video VBack in front), set VBack to VCur, stop the original VCur, open a video with a lower resolution than the current VCur, set it to VBack, if the network speed is higher than the speed of the video with a higher resolution than VCur (this video exists), stop playing VBack, open a video with a higher resolution, set it to Vback. Then put VBack at the latest end of the screen, and put VCur at the back end of the screen, that is, swap VCur with VBack, after the video switching is completed, return to the network monitoring process, and the playback process repeats itself. The embodiment of the present application solves the problem of video stuttering caused by poor network conditions by using two players and multiple videos. According to changes in the network, multiple videos are effectively switched to avoid network stuttering. The embodiment provided by the present application solves some problems of the prior art, namely, the solution to video stuttering due to network problems is to switch videos on one player. In this case, on the one hand, the old video must be closed and the new video opened, which is a time-consuming operation in between. The embodiment provided by the present application can switch directly, which is relatively faster and imperceptible to users, so this solution is currently the best solution;

[0096] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, each step in the video playback method described above is implemented.

[0097] The embodiment of the present application further provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step in the video playback method described above is implemented.

[0098] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0099] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0100] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.

[0101] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0102] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0103] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0104] The above is a description of a video playback method and device provided by the present invention. For those skilled in the art, according to the ideas of the embodiments of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A video playback method, characterized in that: The video playing method comprises: In response to a video playback operation, obtaining a target video of the video playback operation; Acquire the current network speed, and determine the main video source and the background video source of the target video according to the current network speed, wherein the resolution of the main video source is higher than the resolution of the background video source; Play the main video source at a first playback position, and play the background video source at a second playback position; When a change in network speed is detected, a replacement video source is obtained, and the video sources of the first playback position and the second playback position are switched according to a video playback strategy; The first playback position is the display screen, and the second playback position is the background.

2. The video playback method according to claim 1, wherein: The step of acquiring a replacement video source and switching the video sources of the first playback position and the second playback position according to the video playback strategy when a change in the network speed is detected includes: Get real-time network speed; Comparing the real-time network speed with the playback network speed condition of the main film source, and determining a replacement film source according to the comparison result; The playback sources of the first playback position and the second playback position are switched according to the video playback strategy.

3. The video playback method according to claim 2, wherein: The comparing the real-time network speed with the playback network speed condition of the primary film source and determining the replacement film source according to the comparison result comprises: When it is determined that the real-time network speed is higher than the playback network speed condition of the main film source, obtaining a first replacement film source with a higher resolution than the main film source; When it is determined that the real-time network speed is lower than the playback network speed condition of the main film source, a second replacement film source with a lower resolution than the background film source is obtained; Then, switching the playback source of the first playback position and the second playback position according to the video playback strategy includes: When it is determined that the real-time network speed is higher than the playback network speed condition of the main film source, the first replacement film source is played at the first playback position, and the main film source is played at the second playback position; When it is determined that the real-time network speed is lower than the playback network speed condition of the main film source, the background film source is played at the first playback position, and the second replacement film source is played at the second playback position.

4. The video playback method according to claim 1, wherein: The step of acquiring a replacement video source and switching the video sources of the first playback position and the second playback position according to the video playback strategy when a change in the network speed is detected includes: Get real-time network speed; Obtaining a real-time video source corresponding to the real-time network speed; The playback sources of the first playback position and the second playback position are switched according to the video playback strategy.

5. The video playback method according to claim 4, characterized in that: The switching of the playback source between the first playback position and the second playback position according to the video playback strategy includes: Comparing the real-time network speed with the playback network speed condition of the main film source; If the real-time network speed is higher than the playback network speed condition of the main film source, the real-time film source is played at the first playback position, and the main film source is played at the second playback position; If the real-time network speed is lower than the playback network speed condition of the main film source, the background film source is played at the first playback position, and the real-time film source is played at the second playback position.

6. The video playback method according to claim 5, characterized in that: Playing the background source at the first play position and playing the real-time source at the second play position further comprises: Comparing the real-time network speed with the playback network speed condition of the background film source; If the real-time network speed is higher than the playback network speed condition of the background film source, the real-time film source is played at the first playback position, and the background film source is played at the second playback position; If the real-time network speed is lower than the playback network speed condition of the background film source, the background film source is played at the first playback position, and the real-time film source is played at the second playback position.

7. The video playback method according to any one of claims 1 to 6, characterized in that: The background film source includes a first background film source and a second background film source, and the resolution of the first background film source is higher than the resolution of the second background film source; Playing the background source at the second playback position includes: Play the first background film source at the second play position, and play the second background film source at the third play position; Then, when a change in network speed is detected, obtaining a replacement source and switching the playback source of the first playback position and the second playback position according to the video playback strategy includes: When a change in the network speed is detected, a replacement film source is obtained, and the playback sources of the first playback position, the second playback position, and the third playback position are switched according to a video playback strategy.

8. A video playback device, characterized in that: include: A target acquisition module, used for acquiring a target video of the video playback operation in response to the video playback operation; A film source determination module, used to obtain the current network speed, and determine the main film source and background film source of the target video according to the current network speed, wherein the resolution of the main film source is higher than the resolution of the background film source; A film source playing module, used for playing the main film source at a first playing position and playing the background film source at a second playing position; A film source switching module, configured to obtain a replacement film source when a change in network speed is detected, and switch the playback sources of the first playback position and the second playback position according to a video playback strategy; The first playback position is the display screen, and the second playback position is the background.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, each step in the video playback method according to any one of claims 1 to 7 is implemented.