Video playback method, apparatus and device, and storage medium
By setting up backup cache areas in online video playback devices and alternating between multiple cache areas, the problem of stuttering during online video playback was solved, resulting in a smoother playback experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHENZHEN TCL NEW-TECH CO LTD
- Filing Date
- 2025-11-24
- Publication Date
- 2026-07-23
AI Technical Summary
In existing online video playback processes, due to limitations in the user's network environment and playback interaction, frequent disconnections and network requests can easily occur, causing video playback to stutter and affecting the user experience.
A first cache area is added as a backup cache area in addition to the regular cache area. The target cache data is read alternately by the first cache area and the second cache area to reduce the probability of frequent disconnection and reconnection between the cache area and the server. The target cache data is then played by the target player.
Without increasing resource consumption, it reduces video playback stuttering, improves the smoothness and stability of online video playback, and optimizes the user experience.
Smart Images

Figure CN2025137166_23072026_PF_FP_ABST
Abstract
Description
Video playback methods, devices, equipment and storage media
[0001] This application claims priority to Chinese Patent Application No. 202510068530.8, filed on January 15, 2025, entitled "Video Playback Method, Apparatus, Device and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of computer technology, specifically to a video playback method, apparatus, device, and storage medium. Background Technology
[0003] Currently, with the rapid development of internet and digital media technologies, more and more users are accustomed to playing video data via online streaming media, thus enabling them to watch video content directly without downloading the entire video file, saving viewing time. However, in existing online video playback processes, due to limitations in the user's network environment and the possibility of users using playback speed adjustments, fast forward, and rewind during playback, frequent disconnections and network requests can easily occur when dealing with high bitrate video streams with uneven audio and video distribution, leading to video playback stuttering and affecting the user's online video viewing experience. Technical solutions
[0004] This application provides a video playback method, apparatus, device, and storage medium, aiming to solve the technical problem of video playback stuttering that easily occurs during online video playback in the prior art.
[0005] On one hand, embodiments of this application provide a video playback method, which includes the following steps:
[0006] In response to a video playback request, determine the playback control command corresponding to the video playback request;
[0007] The target cache data is determined based on the first cache region and / or the second cache region, as well as the playback control instructions;
[0008] The target player corresponding to the video playback request outputs the target audiovisual content corresponding to the target cache data.
[0009] In one possible implementation of this application, determining the target cache data based on the first cache region and / or the second cache region, and the playback control instruction, includes:
[0010] Obtain the target jump position corresponding to the playback control command, and the video bitstream data corresponding to the video playback request;
[0011] The target request data corresponding to the video playback request is determined based on the video stream data and the target jump position;
[0012] The target cache data to be played is determined based on the target request data, the first cache area, and / or the second cache area.
[0013] In one possible implementation of this application, obtaining the target jump position corresponding to the playback control command includes:
[0014] Parse the playback control command to determine the playback control type corresponding to the playback control command;
[0015] If the playback control type is the start-up control type, then the starting playback position or breakpoint playback position of the video stream data is determined as the target jump position;
[0016] If the playback control type is a jump control type, the target jump position of the playback control instruction is determined according to the jump timestamp and / or target jump parameters of the playback control instruction.
[0017] In one possible implementation of this application, determining the target cache data to be played based on the target request data, the first cache region, and / or the second cache region includes:
[0018] Retrieve backup cache data from the first cache area;
[0019] If the target request data and the backup cache data have overlapping data areas, then the target cache data in the first cache area is obtained;
[0020] If the target request data and the backup cache data are different, then the target cache data to be played is obtained based on the target request data and the second cache area.
[0021] In one possible implementation of this application, obtaining the target cache data to be played based on the target request data and the second cache region includes:
[0022] Obtain the first request parameter and the second request parameter from the target request data, and generate a data cache request based on the first request parameter and the second request parameter;
[0023] The second cache area is updated according to the data caching request and the preset bitstream server to obtain the updated second cache area;
[0024] Read the target cache data associated with the target request data in the updated second cache area.
[0025] In one possible implementation of this application, after determining the target cache data based on the first cache region and / or the second cache region and the playback control instruction, the method further includes:
[0026] Count the number of backup cache hits in the first cache region and obtain the cache hit threshold corresponding to the first cache region;
[0027] If the number of backup cache hits is less than the cache hit threshold, then the first cache area is released;
[0028] The first cache area is replaced by the second cache area to obtain the updated first cache area.
[0029] In one possible implementation of this application, the step of outputting the target audiovisual content corresponding to the target cached data using the target player corresponding to the video playback request includes:
[0030] The target cached data is parsed using the playback demultiplexing module in the target player to obtain the target video data and the target audio data;
[0031] The target video data and the target audio data are decoded to obtain decoded video data and decoded audio data;
[0032] The decoded video data and the decoded audio data are subjected to data synchronization processing to obtain synchronized playback data;
[0033] The target audiovisual content corresponding to the synchronized playback data is output using the target player.
[0034] On the other hand, this application provides a video playback device, the video playback device comprising:
[0035] The instruction acquisition module is configured to respond to a video playback request and determine the playback control instruction corresponding to the video playback request.
[0036] The cache acquisition module is configured to determine target cache data based on a first cache region and / or a second cache region, as well as the playback control instructions;
[0037] The video playback module is configured to output the target audiovisual content corresponding to the target cached data using the target player corresponding to the video playback request.
[0038] On the other hand, this application also provides a video playback device, the video playback device comprising:
[0039] One or more processors;
[0040] Memory; and
[0041] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the video playback method.
[0042] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in the video playback method.
[0043] This application determines the playback control command corresponding to the video playback request in response to the video playback request; determines target cache data based on a first cache area and / or a second cache area, as well as the playback control command; and outputs the target audiovisual content corresponding to the target cache data using the target player corresponding to the video playback request. This achieves the following when playing streaming video data online: In addition to the regular cache area, a first cache area is added as a backup cache area. The target cache data is read alternately based on the playback control command and the first and / or second cache areas, thereby reducing the probability of frequent cache area disconnections and server connections. The target player then plays the target audiovisual content corresponding to the target cache data. This reduces video playback stuttering caused by frequent network cache requests during playback without increasing additional resource consumption, improving online video playback smoothness and optimizing the online video playback experience. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 is a schematic diagram of a video playback method according to an embodiment of this application;
[0046] Figure 2 is a flowchart illustrating one embodiment of the video playback method in this application.
[0047] Figure 3 is a schematic diagram of a scenario of online video playback in the video playback method provided in this application;
[0048] Figure 4 is a flowchart illustrating an embodiment of the video playback method provided in this application for obtaining target cache data from a first cache region.
[0049] Figure 5a is a schematic diagram of a scenario in an embodiment of the video playback method for determining overlapping data regions provided in this application.
[0050] Figure 5b is a schematic diagram of a scenario in which the first buffer region of the video playback method provided in this application does not have overlapping data regions.
[0051] Figure 6 is a flowchart illustrating an embodiment of the video playback method for updating the first cache region provided in this application.
[0052] Figure 7 is a structural schematic diagram of an embodiment of the video playback device provided in this application;
[0053] Figure 8 is a structural schematic diagram of an embodiment of the video playback device provided in this application.
[0054] Implementation methods of this application
[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0056] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0057] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0058] Currently, with the rapid development of internet and digital media technologies, more and more users are accustomed to playing video data via online streaming media, thus enabling them to watch video content directly without downloading the entire video file, saving viewing time. However, in existing online video playback processes, due to limitations in the user's network environment and the possibility of users using playback speed adjustments, fast forward, and rewind during playback, frequent disconnections and network requests can easily occur when dealing with high bitrate video streams with uneven audio and video distribution, leading to video playback stuttering and affecting the user's online video viewing experience.
[0059] Based on this, this application proposes a video playback method, apparatus, device, and computer-readable storage medium to solve the technical problem of video playback stuttering that easily occurs during online video playback in the prior art.
[0060] The video playback method in this embodiment is applied to a video playback device, which is provided in a video playback equipment. The video playback equipment includes one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the video playback method. The video playback equipment can be a smart terminal capable of online audio and video playback, such as a mobile phone, tablet computer, smart TV, virtual reality device, and smart computer. Optionally, the video playback equipment can also be a server or a service cluster composed of multiple servers.
[0061] As shown in Figure 1, Figure 1 is a schematic diagram of a video playback method according to an embodiment of this application. The video playback scenario in this embodiment includes a video playback device 100 (the video playback device 100 integrates a video playback unit), and the video playback device 100 is equipped with a computer-readable storage medium corresponding to the video playback method to execute the steps of the video playback method.
[0062] It is understood that the video playback device in the video playback method scenario shown in Figure 1, or the device included in the video playback device, does not constitute a limitation on the embodiments of this application. That is, the number or type of the video playback device included in the video playback method scenario, or the number or type of the device included in each device, does not affect the overall implementation of the technical solution in the embodiments of this application, and can all be considered as equivalent substitutions or derivatives of the technical solutions claimed in the embodiments of this application.
[0063] In this embodiment of the application, the video playback device 100 is mainly used to: respond to a video playback request and determine the playback control command corresponding to the video playback request;
[0064] The target cache data is determined based on the first cache region and / or the second cache region, as well as the playback control instructions;
[0065] The target player corresponding to the video playback request outputs the target audiovisual content corresponding to the target cache data.
[0066] The video playback device 100 in this application embodiment can be an independent video playback device, such as a mobile phone, tablet computer, smart TV and smart computer, or a video playback network or video playback cluster composed of multiple video playback devices.
[0067] This application provides a video playback method, apparatus, device, and computer-readable storage medium, which will be described in detail below.
[0068] Those skilled in the art will understand that the application environment shown in Figure 1 is only one application scenario related to the solution of this application, and does not constitute a limitation on the application scenario of the solution of this application. Other application environments may include more or fewer video playback devices or video playback network connections than those shown in Figure 1. For example, only one video playback device is shown in Figure 1. It is understood that the scenario of this video playback method may also include one or more video playback devices, which is not specifically limited here. The video playback device 100 may also include a memory for storing the data to be played and other data.
[0069] It should be noted that the scenario diagram of the video playback method shown in Figure 1 is merely an example. The scenario of the video playback method described in the embodiments of this application is for the purpose of more clearly illustrating the technical solution of the embodiments of this application, and does not constitute a limitation on the technical solution provided in the embodiments of this application.
[0070] Based on the scenarios described above for video playback methods, various embodiments of the video playback method disclosed in this application are proposed.
[0071] As shown in Figure 2, Figure 2 is a flowchart of an embodiment of the video playback method in this application. The video playback method includes the following steps 201 to 203:
[0072] 201. Respond to the video playback request and determine the playback control command corresponding to the video playback request;
[0073] The video playback method in this embodiment is applied to a video playback device. The type and number of video playback devices are not specifically limited. That is, the video playback device can be one or more smart display terminals that support online audio and video playback. In a specific embodiment, the video playback device can be a smart computer, smartphone, tablet computer, smart TV, or other smart display terminal that can watch online audio and video streaming media.
[0074] Specifically, the video playback device plays audio and video online as follows: When connected to the network, the video playback device sends a connection request to the stream server pointed to by the specified link address through the online network. After receiving the response information from the stream server based on the sent request, it establishes a network connection with the stream server, receives the video stream data transmitted by the stream server, caches the video stream data in a specified cache area, and drives the target player to periodically read the audio and video cache data to be played from the specified cache area for playback.
[0075] Specifically, during operation, the video playback device responds to video playback requests. These requests are operational requests that drive the video playback device to read target audiovisual content from a specified cache area for online playback. The triggering method for these video playback requests is not specifically limited here; that is, the video playback request can be triggered when a user starts playing an online video—that is, when a user requests to play video content in a specified target player, and the target player begins playing the corresponding video content, the video playback request is triggered. Furthermore, the video playback request can also be triggered when the target player is playing the corresponding video content due to a user performing a corresponding interactive operation (such as adjusting playback speed, fast forward, rewind, or jumping to a specified playback node).
[0076] Specifically, after receiving a playback control request from the target player, the video playback device parses the request and reads the playback control instructions carried within it. These playback control instructions are operation commands that control the target player to perform playback control during the online playback of target audio and video data. Optionally, in one specific embodiment, the playback control instructions may include playback interaction control instructions such as start playback control instructions, speed control instructions, fast forward playback control instructions, rewind playback control instructions, and skip playback control instructions.
[0077] Among them, the start-up control command is the interactive control command that drives the target player to start playing the online video content it points to.
[0078] Among them, the speed control command is an interactive control command that drives the target player to play the online video content at a specified playback speed.
[0079] Among them, the fast-forward playback control command is a playback interaction control command that drives the target player to jump to the specified video content position for online playback according to the fast-forward control parameters.
[0080] Among them, the rewind control command is a playback interaction control command that drives the target player to jump to the specified video content position for online playback according to the rewind control parameters.
[0081] Among them, the jump playback control command is a playback interaction control command that drives the target player to jump to the specified video content for online playback according to the jump control parameters.
[0082] 202. Determine the target cache data based on the first cache area and / or the second cache area, and the playback control instructions;
[0083] Specifically, after obtaining the playback control instruction corresponding to the video playback request, the video playback device also determines the target cache data to be played based on the playback control instruction and the first cache area and / or the second cache area.
[0084] Specifically, as shown in Figure 3, which is a schematic diagram of an embodiment of online video playback in the video playback method provided in this application, to avoid stuttering during online video playback of high-bitrate videos due to insufficient input data and frequent disconnections and reconnections between the target player's corresponding buffer area and the stream server caused by frequent triggering of playback control commands, the video playback device pre-sets a first buffer area and a second buffer area during the online playback process of the target player. It then alternately reads the target buffer data to be played through the first buffer area and / or the second buffer area, thereby increasing the input data volume and reducing the frequency of reconnection between the second buffer area and the stream server, thus effectively improving the stability and smoothness of online video playback.
[0085] The first cache area is a backup cache area for the target player to pre-cache the video data to be played when playing videos online. Each cache area within this backup cache area stores backup cache data, and each cache area is linked together by a linked list. The backup cache data in each cache area includes a first backup cache parameter and a second backup cache parameter. The first backup cache parameter is a parameter representing the backup cache data and the starting position of the corresponding cache area. The second backup cache parameter is a parameter representing the backup cache data and the length of the corresponding cache area.
[0086] The second cache area is the video cache area that pre-caches the video data to be played when the target player plays videos online.
[0087] Specifically, after receiving a video playback request, the video playback device obtains the video address identifier corresponding to the video playback request, accesses the designated bitstream server according to the video address identifier, and caches the corresponding video bitstream data from the bitstream server into a first cache area or a second cache area. Based on the playback control instruction and the first cache area and / or the second cache area, it performs cache hit identification to obtain the target cache data that has been hit in the first cache area and / or the second cache area, so as to realize the alternating reading of the target cache data to be played through the first cache area and / or the second cache area.
[0088] Optionally, in one specific embodiment, after obtaining the playback control instruction in the video playback request, the video playback device also obtains the target jump position corresponding to the playback control instruction and the video stream data pointed to by the video playback request. The target jump position is a parameter representing the progress jump position corresponding to the video data to be played by the target player. The video stream data represents the complete video stream data corresponding to the online playback process of the target player.
[0089] The video stream data refers to the streaming video data obtained by the video playback device when it is connected to the network, after sending a connection request to the stream server pointed to by the specified link address through the online network, receiving the response information from the stream server based on the sent request, establishing a network connection with the stream server, sending online video identification information to the stream server, and obtaining streaming video data from the stream server.
[0090] Optionally, in one specific embodiment, the video stream data can be streaming video data with a resolution of 2K, a video bitrate of 80Mbps average bitrate, and an MP4 format, containing one video data, one audio data, one subtitle data, and evenly distributed audio and video subtitles.
[0091] Optionally, in another specific embodiment, the video stream data can be online streaming video data with a resolution of 4K, a video bitrate of 130Mbps average bitrate, a data format of MP4, and containing 1 video data, 1 audio data, 1 subtitle data, and audio and video subtitles evenly distributed.
[0092] Optionally, in another specific embodiment, the video stream data may also be online streaming video data with a resolution of 4K, a video bitrate of 130Mbps average bitrate, a data format of FMP4, containing 1 video data, 2 audio data, no subtitles, uneven audio distribution, and distributed in blocks.
[0093] Optionally, in one specific embodiment, after obtaining the playback control instruction, the video playback device further determines the target jump position corresponding to the playback control request based on the playback control type. Optionally, the video playback device can classify the playback control instruction into different playback control types based on the different control types of the playback control instruction. In one specific embodiment, the playback control type includes a start-up control type and a jump control type.
[0094] Optionally, the video playback device may define the playback control type corresponding to the start-up control command as the start-up control type. The video playback device may also define the playback control type of video control commands such as speed-up control commands, fast-forward control commands, rewind control commands, and skip-to-play control commands as the skip-to-play control type.
[0095] Specifically, after obtaining the playback control type corresponding to the playback control instruction, the video playback device determines the target jump position of the playback control instruction based on the playback control type and / or the jump timestamp and / or target jump parameters corresponding to the playback control instruction.
[0096] Optionally, in one embodiment, after obtaining the playback control type corresponding to the playback control instruction, the video playback device determines that the playback control type is a start-up control type, and then determines the start playback position or breakpoint playback position of the video stream data as the target jump position.
[0097] That is, after determining that the playback control type is start-up control, the video playback device accesses the historical playback records in the target browser. If there is no historical playback record for the video stream data in the historical playback records, the video playback device determines the starting playback position of the video stream data as the target jump position. If there is a historical playback record for the video stream data in the historical playback records, the historical playback position in the historical playback records is determined as the breakpoint playback position, and the breakpoint playback position is determined as the target jump position.
[0098] Optionally, in another embodiment, after obtaining the playback control type corresponding to the playback control instruction, the video playback device determines that the playback control type is a jump control type, and then determines the target jump position of the playback control instruction based on the jump timestamp and / or target jump parameters of the playback control instruction. The target jump parameters are progress parameters that point to the corresponding video content (e.g., actor, character highlights) and drive the target player to jump to the corresponding video content. For example, in one specific embodiment, the user can select to watch only a certain character / actor during the online playback of a video by the target player, and the progress parameter corresponding to the appearance of that character / actor is determined as the target jump parameter. Furthermore, in another specific embodiment, the target player can pre-annotate a portion of the exciting content in the video content corresponding to the video stream data, and generate target jump parameters for jumping to that portion of exciting content.
[0099] That is, after determining that the playback control type is a jump control type, the video playback device reads the jump timestamp and / or target jump parameter in the playback control instruction, and determines the playback progress position corresponding to the jump timestamp and / or target jump parameter as the target jump position of the playback control instruction.
[0100] Specifically, after obtaining the target jump position of the playback control command, the video playback device determines the target request data corresponding to the video playback request based on the target jump position and the video stream data. This target request data consists of request data parameters that characterize the portion of the video stream data to be cached and played by the video playback device.
[0101] That is, after the video playback device obtains the target jump position, it locates the data in the video stream data that the target player is to request to play through the target jump position. In other words, the part of the video stream data corresponding to the target jump position and subsequent progress is determined as the target request data that the target player requests to be played online.
[0102] Specifically, after obtaining the target request data, the video playback device also determines the target cache data to be played based on the target request data and the first cache area and / or the second cache area. That is, after determining the target request data to be requested, the video playback device compares the target request data with the cache data in the first cache area and / or the second cache area to determine whether there is any matched target cache data in the first cache area and / or the second cache area.
[0103] Specifically, after obtaining the target request data, the video playback device searches for the target backup cache data associated with the target request data from the backup cache data cached in the first cache area. That is, the video playback device matches the target request data with each backup cache data to determine whether the target backup cache data to be played is cached in the first cache area.
[0104] Optionally, if the first cache area in the video playback device does not cache the target cache data corresponding to the target request data, the video playback device obtains the target cache data to be played based on the target request data and the second cache area.
[0105] That is, after determining that there is no target cache data corresponding to the target request data in the first cache area, the video playback device controls the target player to disconnect the communication connection with the bitstream server, and establishes a new data cache request with the bitstream server according to the target request data. Then, it caches part of the video bitstream data associated with the target request data from the bitstream server to the second cache area, so that the video playback device can read the target cache data associated with the target request data in the second cache area.
[0106] Optionally, in one specific embodiment, after determining that there is no target cache data corresponding to the target requested data in the first cache area, the video playback device clears the initial cache data in each cache area of the target player. Furthermore, the video playback device also obtains the first request parameter and the second request parameter from the initial target request, and generates a data caching request based on the first request parameter and the second request parameter. The first request parameter is a parameter representing the starting position of the video stream data to be cached. The second request parameter is a parameter representing the data length of the video stream data to be cached. The video playback device generates a data caching request requesting the stream server to send the corresponding video stream data based on the first request parameter and the second request parameter.
[0107] Specifically, the video playback device establishes a connection with the bitstream server based on the data caching request, obtains the video bitstream data sent by the bitstream server based on the data caching request, caches the video bitstream data in the second cache area to update the data in the second cache area, and obtains the updated second cache area.
[0108] Specifically, after obtaining the updated second cache area, the video playback device reads the video cache data associated with the target requested data in the updated second cache area and identifies the video cache data as the target cache data. This reduces the number of times the video playback device requests reconstruction with the bitstream server, reduces the time loss caused by frequent disconnections and reconnections to the bitstream server, increases the caching of downloaded data, and improves the smoothness of online playback.
[0109] Optionally, in other embodiments, the video playback device may further update and replace the first cache area according to the second cache area to obtain an updated first cache area.
[0110] 203. Utilize the target player corresponding to the video playback request to output the target audiovisual content corresponding to the target cache data.
[0111] Specifically, after obtaining the target cache data, the video playback device uses the target player to output the target video content corresponding to the target cache data.
[0112] Optionally, in the specific embodiment shown in Figure 3, the target player in the video playback device further includes a playback demultiplexing module, a target decoding module, a data synchronization module, and an audiovisual playback module.
[0113] Specifically, after acquiring the target cache data to be played, the video playback device uses the playback demultiplexing module in the target player to parse the target cache data to obtain the target video data and target audio data corresponding to the target cache data. In one specific embodiment, the playback demultiplexing module is a Demux module.
[0114] Specifically, after acquiring the target video data and target audio data, the video playback device inputs the target video data and target audio data into the target decoding module for decoding processing to obtain decoded video data and decoded audio data.
[0115] Specifically, after acquiring the decoded video data and decoded audio data, in order to avoid audio-visual asynchrony, the video playback device also inputs the decoded video data and decoded audio data into the data synchronization module of the target player. The data synchronization module then performs data synchronization processing on the decoded video data and decoded audio data to obtain synchronized playback data.
[0116] Specifically, after acquiring the synchronized playback data, the video playback device inputs the synchronized playback data into the audiovisual playback module of the target player, and uses the audiovisual playback module of the target player to output the target audiovisual content corresponding to the synchronized playback data.
[0117] In this embodiment, the video playback device responds to a video playback request and determines the playback control instruction corresponding to the video playback request; it determines target cache data based on a first cache area and / or a second cache area, as well as the playback control instruction; and it outputs the target audiovisual content corresponding to the target cache data using the target player corresponding to the video playback request. This achieves the following: when playing streaming media video data online, a first cache area is added as a backup cache area in addition to the regular cache area. The target cache data is read alternately according to the playback control instruction and the first and / or second cache areas, thereby reducing the probability of frequent cache area disconnections and server connections. The target player then plays the target audiovisual content corresponding to the target cache data. This reduces video playback stuttering caused by frequent network cache requests during playback without increasing additional resource consumption, improving the smoothness of online video playback and optimizing the online video playback experience.
[0118] As shown in Figure 4, Figure 4 is a flowchart illustrating an embodiment of the video playback method provided in this application for obtaining target cache data from a first cache region. Specifically, based on the above embodiment, in this embodiment, the video playback method further includes steps 301 to 303:
[0119] 301. Obtain the backup cache data in the first cache area;
[0120] 302. If the target request data and the backup cache data have overlapping data areas, then obtain the target cache data in the first cache area;
[0121] 303. If the target request data and the backup cache data are different, then the target cache data to be played is obtained based on the target request data and the second cache area.
[0122] Based on the above embodiments, in this embodiment, after receiving a video playback request, the video playback device obtains the video address identifier corresponding to the video playback request, accesses the specified bitstream server according to the video address identifier, caches the corresponding video bitstream data from the bitstream server into a first cache area or a second cache area, and performs cache hit identification according to the playback control instruction and the first cache area and / or the second cache area, thereby obtaining the target cache data that has been hit in the first cache area, so as to realize the alternating reading of the target cache data to be played through the first cache area and / or the second cache area.
[0123] The first cache area is a backup cache area for the target player to pre-cache the video data to be played when playing videos online. Each cache area within this backup cache area stores backup cache data, and each cache area is linked together by a linked list. The backup cache data in each cache area includes a first backup cache parameter and a second backup cache parameter. The first backup cache parameter is a parameter representing the backup cache data and the starting position of the corresponding cache area. The second backup cache parameter is a parameter representing the backup cache data and the length of the corresponding cache area.
[0124] Specifically, after obtaining the target request data, the video playback device further obtains the backup cache data cached in the first cache area, and obtains the first cache parameter and the second cache parameter from the backup cache data. The first cache parameter is a data parameter representing the starting position of each backup cache data. The second cache parameter is a data parameter representing the length of each backup cache data.
[0125] Specifically, after acquiring the target request data and the backup cache data, the video playback device compares the target request data and the backup cache data to determine whether there is an overlapping data area between them, and then hits the target cache data in the first cache area based on the overlapping data area. This overlapping data area includes partially overlapping areas and completely overlapping areas.
[0126] That is, the video playback device determines the request data region corresponding to the target request data based on the first request parameter and the second request parameter in the target request data, and determines the cache data region corresponding to the backup cache data based on the first cache parameter and the second cache parameter. By comparing the request data region and the cache data region, it determines whether there is an overlapping data region between the target request data and the backup cache data.
[0127] As shown in Figure 5a, which is a schematic diagram of a scenario of determining an overlapping data region in the video playback method provided in this application, in the embodiment shown in Figure 5a, if the requested data region and the cached data region partially overlap or completely overlap (that is, when the cached data region is larger than the requested data region), it is determined that the target requested data and the backup cached data have an overlapping data region, and the backup cached data in the first cache region corresponding to the overlapping data region is determined as the target cached data.
[0128] Optionally, as shown in Figure 5b, which is a schematic diagram of an embodiment of the video playback method provided in this application where the first cache region does not have overlapping data regions. In the embodiment shown in Figure 5b, if the first cache region and the requested data region do not overlap at all, it is determined that the target requested data and the backup cache data are different. In this case, the video playback device determines that the first cache region does not cache the target cache data corresponding to the target requested data, and the video playback device obtains the target cache data to be played based on the target requested data and the second cache region.
[0129] In other words, after determining that there is no target cache data corresponding to the target requested data in the first cache area, the video playback device controls the target player to disconnect from the bitstream server and establishes a new data cache request with the bitstream server based on the target requested data. Then, it caches part of the video bitstream data associated with the target requested data from the bitstream server into the second cache area, so that the video playback device can read the target cache data associated with the target requested data in the second cache area. This realizes the alternating reading of target cache data based on the first cache area and the second cache area, thereby reducing the number of requests for reconstruction between the video playback device and the bitstream server, reducing the time loss caused by frequent disconnection and reconnection to the bitstream server, increasing the caching of downloaded data, and improving the smoothness of online playback.
[0130] In this embodiment, the video playback device obtains backup cache data from the first cache area; if the target request data and the backup cache data have overlapping data areas, the target cache data from the first cache area is obtained; if the target request data and the backup cache data are not the same, the target cache data to be played is obtained based on the target request data and the second cache area. This allows the use of the backup cache area to read the video data to be played, thereby improving the smoothness of online video playback and reducing the online playback stuttering rate without adding extra resources.
[0131] As shown in Figure 6, Figure 6 is a flowchart illustrating an embodiment of the video playback method for updating the first buffer region provided in this application. Specifically, in this embodiment, the video playback method further includes steps 401 to 403:
[0132] 401. Count the number of backup cache hits in the first cache region and obtain the cache hit threshold corresponding to the first cache region;
[0133] 402. If the number of backup cache hits is less than the cache hit threshold, then the first cache area is released;
[0134] 403. Replace the first cache area with the second cache area to obtain the updated first cache area.
[0135] Based on the above embodiments, in this embodiment, the video playback device further updates and replaces the first cache region according to the number of backup cache hits corresponding to the target cache data in the first cache region, to obtain an updated first cache region. That is, when the video playback device obtains the target cache data from the second cache region multiple times, it determines that the cache hit rate of the first cache region is low, and replaces the first cache region with the second cache region to obtain an updated first cache region.
[0136] Specifically, the video playback device also obtains the cache hit threshold associated with the first cache area, and compares the number of backup cache hits of the first cache area during online playback with the number of cache hits, thereby determining the cache hit rate of the first cache area, and then judging whether the first cache area needs to be updated based on the cache hit rate.
[0137] Optionally, if the number of backup cache hits is less than the cache hit threshold, the video playback device determines that the cache hit rate of the first cache area is low. The video playback device then releases the first cache area, that is, the video playback device clears the first cache area and replaces it with the second cache area to obtain an updated first cache area, thereby improving the cache hit rate of the first cache area.
[0138] In this embodiment, the video playback device obtains a cache hit threshold corresponding to the first cache region by counting the number of backup cache hits in the first cache region. If the number of backup cache hits is less than the cache hit threshold, the first cache region is released. The first cache region is then replaced with the second cache region to obtain an updated first cache region. This achieves the goal of replacing the backup cache region with the second cache region when the cache hit probability of the backup cache region is low, thereby improving the cache hit rate of the backup cache region and thus improving the smoothness of online video playback.
[0139] To better implement the video playback method in this application embodiment, based on the video playback method, this application embodiment also provides a video playback device, as shown in FIG7. FIG7 is a structural schematic diagram of an embodiment of the video playback device provided in this application embodiment. Specifically, the video playback device 500 includes:
[0140] The instruction acquisition module 501 is configured to respond to a video playback request and determine the playback control instruction corresponding to the video playback request.
[0141] The cache acquisition module 502 is configured to determine target cache data based on a first cache region and / or a second cache region, and the playback control instruction;
[0142] The video playback module 503 is configured to output the target audiovisual content corresponding to the target cache data using the target player corresponding to the video playback request.
[0143] In one possible implementation of this embodiment, the video playback device determines the target cache data based on a first buffer region and / or a second buffer region, and the playback control instruction, including:
[0144] Obtain the target jump position corresponding to the playback control command, and the video bitstream data corresponding to the video playback request;
[0145] The target request data corresponding to the video playback request is determined based on the video stream data and the target jump position;
[0146] The target cache data to be played is determined based on the target request data, the first cache area, and / or the second cache area.
[0147] In one possible implementation of this embodiment, the video playback device obtains the target jump position corresponding to the playback control command and the video stream data corresponding to the video playback request, including:
[0148] Parse the playback control command to determine the playback control type corresponding to the playback control command;
[0149] If the playback control type is the start-up control type, then the starting playback position or breakpoint playback position of the video stream data is determined as the target jump position;
[0150] If the playback control type is a jump control type, the target jump position of the playback control instruction is determined according to the jump timestamp and / or target jump parameters of the playback control instruction.
[0151] In one possible implementation of this embodiment, the video playback device determines the target cache data to be played based on the target request data, the first cache area, and / or the second cache area, including:
[0152] Retrieve backup cache data from the first cache area;
[0153] If the target request data and the backup cache data have overlapping data areas, then the target cache data in the first cache area is obtained;
[0154] If the target request data and the backup cache data are different, then the target cache data to be played is obtained based on the target request data and the second cache area.
[0155] In one possible implementation of this embodiment, the video playback device obtains target cache data to be played based on the target request data and the second cache region, including:
[0156] Obtain the first request parameter and the second request parameter from the target request data, and generate a data cache request based on the first request parameter and the second request parameter;
[0157] The second cache area is updated according to the data caching request and the preset bitstream server to obtain the updated second cache area;
[0158] Read the target cache data associated with the target request data in the updated second cache area.
[0159] In one possible implementation of this embodiment, after the video playback device determines the target cache data based on the first buffer area and / or the second buffer area and the playback control instruction, it further includes:
[0160] Count the number of backup cache hits in the first cache region and obtain the cache hit threshold corresponding to the first cache region;
[0161] If the number of backup cache hits is less than the cache hit threshold, then the first cache area is released;
[0162] The first cache area is replaced by the second cache area to obtain the updated first cache area.
[0163] In one possible implementation of this embodiment, the video playback device outputs the target audiovisual content corresponding to the target cached data using the target player corresponding to the video playback request, including:
[0164] The target cached data is parsed using the playback demultiplexing module in the target player to obtain the target video data and the target audio data;
[0165] The target video data and the target audio data are decoded to obtain decoded video data and decoded audio data;
[0166] The decoded video data and the decoded audio data are subjected to data synchronization processing to obtain synchronized playback data;
[0167] The target audiovisual content corresponding to the synchronized playback data is output using the target player.
[0168] In this embodiment, the video playback device responds to a video playback request and determines the playback control instruction corresponding to the video playback request; it determines target cache data based on a first cache area and / or a second cache area, as well as the playback control instruction; and it outputs the target audiovisual content corresponding to the target cache data using the target player corresponding to the video playback request. This achieves the following: when playing streaming media video data online, a first cache area is added as a backup cache area in addition to the regular cache area. The target cache data is read alternately according to the playback control instruction and the first and / or second cache areas, thereby reducing the probability of frequent cache area disconnections and server connections. The target player then plays the target audiovisual content corresponding to the target cache data. This reduces video playback stuttering caused by frequent network cache requests during playback without increasing additional resource consumption, improving the smoothness of online video playback and optimizing the online video playback experience.
[0169] This application also provides a video playback device, as shown in FIG8, which is a schematic diagram of an embodiment of the video playback device provided in this application.
[0170] The video playback device integrates any of the video playback apparatuses provided in the embodiments of this application, and the video playback device includes:
[0171] One or more processors;
[0172] Memory; and
[0173] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor of the steps in the video playback method described in any of the above embodiments of the video playback method.
[0174] Specifically, a video playback device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that the structure of the video playback device shown in Figure 8 does not constitute a limitation on the video playback device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0175] The processor 601 is the control center of the video playback device. It connects various parts of the device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, thereby providing overall monitoring of the video playback device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.
[0176] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the video playback device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0177] The video playback device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0178] The video playback device may also include an input unit 604, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0179] Although not shown, the video playback device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the video playback device loads the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 runs the applications stored in the memory 602 to realize various functions, as follows:
[0180] In response to a video playback request, determine the playback control command corresponding to the video playback request;
[0181] The target cache data is determined based on the first cache region and / or the second cache region, as well as the playback control instructions;
[0182] The target player corresponding to the video playback request outputs the target audiovisual content corresponding to the target cache data.
[0183] In this embodiment, the video playback device responds to a video playback request and determines the playback control instruction corresponding to the video playback request; it determines target cache data based on a first cache area and / or a second cache area, as well as the playback control instruction; and it outputs the target audiovisual content corresponding to the target cache data using the target player corresponding to the video playback request. This achieves the following: when playing streaming media video data online, a first cache area is added as a backup cache area in addition to the regular cache area. The target cache data is read alternately according to the playback control instruction and the first and / or second cache areas, thereby reducing the probability of frequent cache area disconnections and server connections. The target player then plays the target audiovisual content corresponding to the target cache data. This reduces video playback stuttering caused by frequent network cache requests during playback without increasing additional resource consumption, improving the smoothness of online video playback and optimizing the online video playback experience.
[0184] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, which is loaded by a processor to execute the steps in any of the video playback methods provided in embodiments of this application. For example, the computer program loaded by the processor can execute the following steps:
[0185] In response to a video playback request, determine the playback control command corresponding to the video playback request;
[0186] The target cache data is determined based on the first cache region and / or the second cache region, as well as the playback control instructions;
[0187] The target player corresponding to the video playback request outputs the target audiovisual content corresponding to the target cache data.
[0188] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0189] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0190] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0191] The above provides a detailed description of a video playback method provided by the embodiments of this application. Specific embodiments have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A video playback method, wherein, The video playback method includes: In response to a video playback request, determine the playback control command corresponding to the video playback request; The target cache data is determined based on the first cache region and / or the second cache region, as well as the playback control instructions; The target player corresponding to the video playback request outputs the target audiovisual content corresponding to the target cache data.
2. The video playback method according to claim 1, wherein, Determining the target cache data based on the first cache region and / or the second cache region, and the playback control instruction, includes: Obtain the video address identifier corresponding to the video playback request, access the specified bitstream server according to the video address identifier, and cache the corresponding video bitstream data from the bitstream server to the first cache area or the second cache area. Based on the playback control command and the first cache area and / or the second cache area, cache hit identification is performed to obtain the target cache data that is hit in the first cache area and / or the second cache area.
3. The video playback method according to claim 1, wherein, Determining the target cache data based on the first cache region and / or the second cache region, and the playback control instruction, includes: Obtain the target jump position corresponding to the playback control command, and the video bitstream data corresponding to the video playback request; The target request data corresponding to the video playback request is determined based on the video stream data and the target jump position; The target cache data to be played is determined based on the target request data, the first cache area, and / or the second cache area.
4. The video playback method according to claim 3, wherein, The step of obtaining the target jump position corresponding to the playback control command includes: Parse the playback control command to determine the playback control type corresponding to the playback control command; If the playback control type is the start-up control type, then the starting playback position or breakpoint playback position of the video stream data is determined as the target jump position; If the playback control type is a jump control type, then the target jump position of the playback control instruction is determined according to the jump timestamp and / or target jump parameters of the playback control instruction.
5. The video playback method according to claim 4, wherein, Determining the starting playback position or breakpoint playback position of the video stream data as the target jump position includes: Access the playback history in the target browser; If there is no historical playback record of the video stream data in the historical playback record, the video playback device determines the starting playback position of the video stream data as the target jump position; If the historical playback record contains a historical playback record of the video stream data, then the historical playback position in the historical playback record is determined as the breakpoint playback position, and the breakpoint playback position is determined as the target jump position.
6. The video playback method according to claim 3, wherein, The step of determining the target cache data to be played based on the target request data, the first cache region, and / or the second cache region includes: Retrieve backup cache data from the first cache area; If the target request data and the backup cache data have overlapping data areas, then the target cache data in the first cache area is obtained; If the target request data and the backup cache data are different, then the target cache data to be played is obtained based on the target request data and the second cache area.
7. The video playback method according to claim 6, wherein, The step of obtaining the target cache data to be played based on the target request data and the second cache region includes: Obtain the first request parameter and the second request parameter from the target request data, and generate a data cache request based on the first request parameter and the second request parameter; The second cache area is updated according to the data caching request and the preset bitstream server to obtain the updated second cache area; Read the target cache data associated with the target request data in the updated second cache area.
8. The video playback method according to claim 1, wherein, After determining the target cache data based on the first cache region and / or the second cache region, and the playback control instruction, the method further includes: Count the number of backup cache hits in the first cache region and obtain the cache hit threshold corresponding to the first cache region; If the number of backup cache hits is less than the cache hit threshold, then the first cache area is released; The first cache area is replaced by the second cache area to obtain the updated first cache area.
9. The video playback method according to claim 1, wherein, The step of using the target player corresponding to the video playback request to output the target audiovisual content corresponding to the target cached data includes: The target cached data is parsed using the playback demultiplexing module in the target player to obtain the target video data and the target audio data; The target video data and the target audio data are decoded to obtain decoded video data and decoded audio data; The decoded video data and the decoded audio data are subjected to data synchronization processing to obtain synchronized playback data; The target audiovisual content corresponding to the synchronized playback data is output using the target player.
10. A video playback device, wherein, The video playback device includes: The instruction acquisition module is configured to respond to a video playback request and determine the playback control instruction corresponding to the video playback request. The cache acquisition module is configured to determine target cache data based on a first cache region and / or a second cache region, as well as the playback control instructions; The video playback module is configured to output the target audiovisual content corresponding to the target cached data using the target player corresponding to the video playback request.
11. The video playback device according to claim 10, wherein, The cache acquisition module is further configured to determine target cache data based on the first cache region and / or the second cache region, and the playback control instruction, including: Obtain the video address identifier corresponding to the video playback request, access the specified bitstream server according to the video address identifier, and cache the corresponding video bitstream data from the bitstream server to the first cache area or the second cache area. Based on the playback control command and the first cache area and / or the second cache area, cache hit identification is performed to obtain the target cache data that is hit in the first cache area and / or the second cache area.
12. The video playback device according to claim 10, wherein, The cache acquisition module is further configured to determine target cache data based on the first cache region and / or the second cache region, and the playback control instruction, including: Obtain the target jump position corresponding to the playback control command, and the video bitstream data corresponding to the video playback request; The target request data corresponding to the video playback request is determined based on the video stream data and the target jump position; The target cache data to be played is determined based on the target request data, the first cache area, and / or the second cache area.
13. The video playback device according to claim 12, wherein, The cache acquisition module is further configured to acquire the target jump position corresponding to the playback control command, including: Parse the playback control command to determine the playback control type corresponding to the playback control command; If the playback control type is the start-up control type, then the starting playback position or breakpoint playback position of the video stream data is determined as the target jump position; If the playback control type is a jump control type, then the target jump position of the playback control instruction is determined according to the jump timestamp and / or target jump parameters of the playback control instruction.
14. The video playback device according to claim 13, wherein, Determining the starting playback position or breakpoint playback position of the video stream data as the target jump position includes: Access the playback history in the target browser; If there is no historical playback record of the video stream data in the historical playback record, the video playback device determines the starting playback position of the video stream data as the target jump position; If the historical playback record contains a historical playback record of the video stream data, then the historical playback position in the historical playback record is determined as the breakpoint playback position, and the breakpoint playback position is determined as the target jump position.
15. The video playback device according to claim 12, wherein, The cache acquisition module is further configured to determine the target cache data to be played based on the target request data, the first cache region, and / or the second cache region, including: Retrieve backup cache data from the first cache area; If the target request data and the backup cache data have overlapping data areas, then the target cache data in the first cache area is obtained; If the target request data and the backup cache data are different, then the target cache data to be played is obtained based on the target request data and the second cache area.
16. The video playback device according to claim 15, wherein, The cache acquisition module is further configured to acquire target cache data to be played based on the target request data and the second cache region, including: Obtain the first request parameter and the second request parameter from the target request data, and generate a data cache request based on the first request parameter and the second request parameter; The second cache area is updated according to the data caching request and the preset bitstream server to obtain the updated second cache area; Read the target cache data associated with the target request data in the updated second cache area.
17. The video playback device according to claim 10, wherein, The cache acquisition module is further configured to, after determining the target cache data based on the first cache region and / or the second cache region and the playback control instruction, also include: Count the number of backup cache hits in the first cache region and obtain the cache hit threshold corresponding to the first cache region; If the number of backup cache hits is less than the cache hit threshold, then the first cache area is released; The first cache area is replaced by the second cache area to obtain the updated first cache area.
18. The video playback device according to claim 10, wherein, The video playback module is further configured to output the target audiovisual content corresponding to the target cached data using the target player corresponding to the video playback request, including: The target cached data is parsed using the playback demultiplexing module in the target player to obtain the target video data and the target audio data; The target video data and the target audio data are decoded to obtain decoded video data and decoded audio data; The decoded video data and the decoded audio data are subjected to data synchronization processing to obtain synchronized playback data; The target audiovisual content corresponding to the synchronized playback data is output using the target player.
19. A video playback device, wherein, The video playback device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the video playback method according to any one of claims 1 to 9.
20. A computer-readable storage medium, wherein, It stores a computer program, which is loaded by a processor to execute the steps of the video playback method according to any one of claims 1 to 9.