Video playing method and device, equipment, storage medium and program product

By querying the keyframes of the most recent normal data frame in the video file and skipping the error frame, the parsing failure caused by the error frame in the video playback is solved, and a smoother video playback experience is achieved.

CN120455764APending Publication Date: 2025-08-08AUTOCHIPS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510356506.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

When an error frame is encountered during playback of the video file, it will fail in parsing, affecting the smoothness of the playback and user experience.

Method used

By determining the location information of the data frame to be played, query the keyframes of the most recent normal data frame in the video file, skip the data frames that failed to parse, and directly parse and play the keyframes and their corresponding data frames.

Benefits of technology

Reduces processing time and resource consumption, ensures smooth video playback and improves user experience, especially on video playback devices with tight resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455764A_ABST
    Figure CN120455764A_ABST
Patent Text Reader

Abstract

The invention discloses a video playing method and device, equipment, a storage medium and a program product, and the method comprises the steps: determining the position information of a to-be-played data frame in a video file in response to the analysis failure of the to-be-played data frame of the video file; on the basis of the position information, in response to the fact that the to-be-played data frame is an error data frame, querying a key frame which is a normal data frame recently after the to-be-played data frame of the video file on the basis of the position information; and analyzing and playing the key frame. According to the invention, the processing of the wrong video data frame is shorter in time consumption and less in resource consumption, can be applied to various video playing environments, and can effectively ensure the user experience of video playing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video information technology, and in particular to a video playback method, apparatus, device, storage medium, and program product. Background Art

[0002] Today, digital multimedia information technology has become one of the core driving forces for people's lives, work and the development of various industries.

[0003] During the encoding, storage, transmission, and hardware or software decoding of video files, error frames may appear in the file due to various reasons. If an error frame is encountered during playback, parsing or decoding will fail and an error message will be displayed, which will affect video playback and even cause playback to terminate abnormally, greatly affecting the user experience. Summary of the Invention

[0004] The present application provides a video playback method, apparatus, device, storage medium and program product, which can effectively reduce the use of memory resources when playing video files, ensure the smoothness of video playback, and effectively improve the user experience.

[0005] To solve the above technical problems, the first aspect of the present application provides a video playback method. The video playback method includes: in response to a failure in parsing a data frame to be played in a video file, determining the location information of the data frame to be played in the video file; in response to the data frame to be played being an error data frame, querying the key frame of the video file that is the closest normal data frame after the data frame to be played based on the location information; skipping the data frame to be played that failed to be parsed, parsing the key frame and its corresponding data frame, taking the key frame as the current first frame, and playing the key frame and the data frame of the video file.

[0006] The step of searching for a key frame that is the nearest normal data frame after the data frame to be played of the video file based on the position information further includes: recording the position of the data frame to be played and the reason for the parsing failure.

[0007] The video playing method further includes: if no normal data frame is found in the data within a preset range after the data frame to be played of the video file, ending the playing of the video file.

[0008] Among them, based on the position information, the step of querying the key frame of the video file that is the nearest normal data frame after the data frame to be played includes: confirming that the data frame is a normal data frame based on the type of the data frame and the integrity information of the data frame conforming to the file type of the video file.

[0009] Among them, in response to the failure of parsing the data frame to be played of the video file, after the step of determining the position information of the data frame to be played in the video file, it includes: triggering a fixed-point playback request for the video file to execute the step of querying the key frame of the video file that is the nearest normal data frame after the data frame to be played based on the position information.

[0010] The video file includes audio data and video data, the data frame is an audio data frame, and the step of querying the normal data frame closest to the data frame to be played of the video file based on the position information includes: querying the video data frame to be played corresponding to the normal audio data frame of the video file based on the position information; and querying the video key frame closest to the video data frame to be played based on the video data frame to be played.

[0011] In which, in response to the failure of parsing the data frame to be played of the video file, the step of determining the position information of the data frame to be played in the video file includes: in response to the data frame to be played being a normal data frame, ending the playback of the video file.

[0012] To solve the above-mentioned technical problems, the second aspect of the present application provides a video playback device, wherein the video playback device includes: a parser layer and a framework layer; the framework layer is used to determine the position information of the data frame to be played in the video file in response to the failure of parsing the data frame to be played of the video file; the parser layer is used to query the key frame that is the nearest normal data frame after the data frame to be played of the video file based on the position information in response to the request; the framework layer is also used to trigger a request to query the normal data frame in response to the information returned by the parser that the data frame to be played is an error data frame; the parser layer is also used to skip the data frame to be played that failed to be parsed, parse the key frame and its corresponding data frame, so that the framework layer triggers the request to play the key frame and the data frame of the video file with the key frame as the current first frame.

[0013] To solve the above technical problems, the third aspect of the present application provides a video playback device, wherein the video playback device includes: a memory and a processor, the memory stores program instructions, and the processor calls the program instructions from the memory to execute any of the above video playback methods.

[0014] To solve the above technical problems, the fourth aspect of the present application provides a computer-readable storage medium / computer program product, wherein the computer-readable storage medium stores computer program instructions, and the program instructions can be executed by a processor to implement any of the above-mentioned video playback methods; the computer program product includes computer program instructions, and when the program instructions are executed by the processor, any of the above-mentioned video playback methods is implemented.

[0015] Different from the existing technology, the video playback method, device, equipment, storage medium and program product provided by this application can take less time and consume fewer resources to process erroneous video data frames, can be applied in a variety of video playback environments, and can effectively ensure the user experience of video playback. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flowchart of the first embodiment of the video playback method of the present application;

[0017] Figure 2 This is a flow chart of the second embodiment of the video playback method of the present application;

[0018] Figure 3 This is a flowchart of the third embodiment of the video playback method of the present application;

[0019] Figure 4 This is a flowchart of the fourth embodiment of the video playback method of the present application;

[0020] Figure 5 This is a structural diagram of an embodiment of the video playback device of the present application;

[0021] Figure 6 This is a flow chart of the second embodiment of the video playback device of the present application;

[0022] Figure 7 This is a structural diagram of an embodiment of the video playback device of the present application;

[0023] Figure 8 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0024] The present application is described in detail below with reference to the accompanying drawings and implementation methods.

[0025] in, Figure 5 、 Figure 6 、 Figure 7 and Figure 8 The structural diagram is a logical structure diagram, and the specific connection structure is based on the actual production structure. In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are proposed to facilitate a thorough understanding of this application. As an aid to understanding the process within the proposed video playback device, it is an object that operates in collaboration with an executor, memory, or other hardware within the video playback device. Disk, page cache, and buffer are all types of physical memory of a memory.

[0026] The video playback method provided in the embodiments of the present application can be implemented on any video playback device, for example, a television, a laser projection device, a smart display, etc.

[0027] When playing, the video needs to be parsed, decoded and rendered before it can be played. Due to the encoding, storage, transmission and hardware or software decoder process of the video file, error frames may exist in the file for some reasons, which will cause the video to fail to parse during playback, resulting in blurred or stuck image quality, playback interruption, video playback failure and even file corruption.

[0028] Please refer to Figure 1 , Figure 1 It is a flowchart of the first embodiment of the video playback method of the present application.

[0029] In order to ensure smooth playback of video files, this application first proposes a video playback method for solving the problem of video parsing failure, wherein the video playback method includes:

[0030] S101: In response to a parsing failure of a data frame to be played in a video file, determining location information of the data frame to be played in the video file.

[0031] The location of the data frame to be played can be stored on disk, in a cache, or at the playback progress of the video file. The data frames are usually stored in the order of playback progress, taking into account the playback order of the video and the mutual reference between the images of consecutive data frames. This storage method can reduce parsing time and memory consumption.

[0032] S102: In response to the data frame to be played being an erroneous data frame, searching for a key frame of the video file that is the nearest normal data frame after the data frame to be played based on the position information.

[0033] By utilizing the storage method of data frames in video files, the data frames following the data frame to be played can be queried in a timely manner. If an error occurs in the current data frame to be played, the data frames following it may also be erroneous. Therefore, a normal data frame must be found before decoding and playback can be performed.

[0034] A key frame is an independently encoded frame that can be parsed to obtain a complete frame of image information. During general video playback, non-key frames are parsed based on previous key frames.

[0035] In a specific embodiment, when the parsing of the data frame to be played fails, the data frame to be played is a key frame at a certain moment, then the non-key frame decoded by the device after it cannot be played even if there is no error in itself. At this time, it is necessary to query the subsequent key frame and parse and play from the queried key frame.

[0036] In another specific embodiment, when the parsing of the data frame to be played fails, the data frame to be played is a non-key frame at a certain moment. If a new supplementary frame is generated at this time to ensure the continuity of the video picture, it is equivalent to a re-encoding, which not only consumes additional processing and memory resources, but also is very time-consuming. If the system idle resources are insufficient or the video file itself has a large resolution, the time taken to re-encode and generate the supplementary frame will be long, which will manifest as playback jamming; if you go back and look for a key frame to replace the erroneous data frame, you also need to query the previous frames, which will also consume additional processing and memory resources. Therefore, the key frame after the query can be parsed and played from the queried key frame, which can consume less resources and time.

[0037] S103: Skip the data frames to be played that failed to be parsed, parse the key frames and their corresponding data frames, take the key frames as the current first frame, and play the key frames and the data frames of the video file.

[0038] During the data frame query process, the previously parsed data frame to be played has not yet been decoded, rendered and played. Therefore, playing the queried data frame after parsing and rendering will not cause the video to be stuck during playback. Instead, the rendered frame will continue to be played directly, which is equivalent to actively skipping the segment where the error frame is located. Resource decoding and rendering are no longer consumed for the data frame that cannot be played. A fixed-point playback operation is performed, and the video continues to be played with the data frame as the current first frame of fixed-point playback. This can be processed without the user's perception.

[0039] Please refer to Figure 2 , Figure 2 It is a flow chart of the second embodiment of the video playback method of the present application.

[0040] S201: In response to a failure in parsing a data frame to be played in a video file, determining location information of the data frame to be played in the video file.

[0041] The specific content of step S201 is the same as that of the above step S101, so it will not be repeated here.

[0042] In an optional embodiment, S202: recording the position of the data frame to be played and the reason for the parsing failure.

[0043] By parsing the position records of failed playback frames, applications or technical personnel can quickly locate the specific location of the problem when performing file troubleshooting, thereby reducing the time for troubleshooting, helping to quickly identify the root cause of the problem, and facilitating the optimization of video file storage and decoding processes. It can also reduce memory consumption when attempting to repair or re-parse the data frames at the video file location when the video file is played repeatedly.

[0044] In an optional implementation, S203: in response to the data frame to be played being an erroneous data frame, query the key frame of the video file that is the nearest normal data frame after the data frame to be played based on the position information.

[0045] S204: Skip the data frames to be played that failed to be parsed, parse the key frames and their corresponding data frames, take the key frames as the current first frame, and play the key frames and the data frames of the video file.

[0046] The specific contents of steps S203 and S204 are the same as those of steps S102 and S103 above, and therefore will not be repeated here.

[0047] Please refer to Figure 3 , Figure 3 It is a flowchart of the third embodiment of the video playback method of the present application.

[0048] S301: In response to a parsing failure of a data frame to be played in a video file, determining location information of the data frame to be played in the video file.

[0049] The specific content of step S301 is the same as that of the above step S101, so it will not be repeated here.

[0050] In an optional embodiment, based on whether the reason for the current parsing failure is an error frame, if so, processing for this type of error is started; if not, this error is classified as a general unexpected error, and the current playback process is subsequently terminated.

[0051] S302: In response to the data frame to be played being an error data frame, triggering a request for fixed-point playback of the video file.

[0052] In the normal playback process, data frame parsing is basically carried out step by step from front to back in the playback order. Only when fixed-point playback is triggered will the frame-seeking mode be set. Upon receiving a request indicating that the user has selected fixed-point playback, or other fixed-point playback requests, the frame-seeking state generally executed is to forward query the key frame, and then parse, decode, and play according to the normal playback method. When the reason for the parsing failure is an error frame, S303 is executed: in response to the data frame to be played being an error data frame, based on the position information, the key frame that is the closest normal data frame after the data frame to be played of the video file is searched. In other embodiments, the backward frame-seeking mode can also be executed after other fixed-point playback requests.

[0053] The specific content of step S303 can refer to the above-mentioned step S102 or step S203, so it is not repeated here.

[0054] In an optional embodiment, the data frame is confirmed to be a normal data frame based on the type of the data frame and the integrity information of the data frame being consistent with the file type of the video file.

[0055] Validity is one of the important bases for verifying whether a data frame is normal. When parsing the frame data of a video file, the data frames of different types of video files will have their own specific formats of content to identify the validity of the frame. For example, in a specific embodiment, in order to find valid frame data, the data frame will have a frame header, which is usually a fixed-format data and frame size information. The file type of the video file is verified by performing frame type check, data integrity check, timestamp check, data format check, etc., so as to identify whether a valid data frame has been extracted from the video file data.

[0056] When the parsing of the data frame to be played fails, the legitimacy check may be used to verify the reason for the parsing failure of the data frame to be played.

[0057] S304: Skip the data frames to be played that failed to be parsed, parse the key frames and their corresponding data frames, take the key frames as the current first frame, and play the key frames and the data frames of the video file.

[0058] The specific content of step S304 can refer to the above-mentioned step S103 or step S204, so it is not repeated here.

[0059] S305: If no normal data frame is found in the data within the preset range after the data frame to be played of the video file, the playing of the video file is terminated.

[0060] In order to reduce resource consumption, a preset playback progress can be set. For example, when there is no normal data frame in a video file within 5 seconds or 10 seconds, the playback can be ended. The specific range of the preset playback progress can be determined according to the video size or video playback length.

[0061] In other embodiments, if no correct data frame is found from the position where the error frame is found to the end of the file, it is considered that the data frame of the current file is playable, and the current playback process is terminated.

[0062] S306: In response to the data frame to be played being a normal data frame, ending the playback of the video file.

[0063] If the parsing failure is not due to data frame errors, it may be due to hardware or software problems such as codec support, file format or stream information errors, memory or resource problems, protocol or path problems, player configuration problems, audio and video stream synchronization problems, permissions or file access problems, etc. You can issue a reminder, end the playback, or try to re-encode the playback to try to solve the problem.

[0064] When video playback and parsing fails, it can be effectively processed without relying on external hardware, and has high portability.

[0065] Please refer to Figure 4 , Figure 4 It is a flowchart of the fourth embodiment of the video playback method of the present application.

[0066] In an optional implementation, the data frame is an audio data frame. The audio data frame is a continuous audio data segment that needs to be parsed, decoded, and played from the beginning of an audio frame to ensure normal sound playback during video playback.

[0067] S401: In response to a parsing failure of a data frame to be played in a video file, determining location information of the data frame to be played in the video file.

[0068] The position of the audio data frame to be played can be the position stored in the disk, can be stored in a slow position, or can be the video file playing progress position. In an optional embodiment, the position of the data frame to be played and the reason for parsing failure can be recorded.

[0069] S402: Based on the position information, query the video data frame to be played corresponding to the normal audio data frame of the video file.

[0070] To ensure audio and video synchronization, and to minimize resource consumption, the parsing of the video data frames corresponding to the failed audio data frames is skipped, and the parsing of the corresponding data frames of the normal audio data frames is performed directly. In other embodiments, if the most recent audio data corresponding to the played video data frame is not a key frame, the search continues backwards to find the nearest normal key frame.

[0071] S403: Skip the data frames to be played that failed to be parsed, parse the key frames and their corresponding data frames, take the key frames as the current first frame, and play the key frames and the data frames of the video file.

[0072] The specific content of step S203 can refer to the above step S103, so it will not be repeated here.

[0073] A second aspect of the present application provides a video playback device 101 .

[0074] See also Figure 5 , Figure 5 It is a structural diagram of an embodiment of the video playback device of the present application.

[0075] The video playback device includes: a parser layer 102 and a framework layer 103;

[0076] The framework layer 102 is configured to determine location information of the data frame to be played in the video file in response to a parsing failure of the data frame to be played in the video file.

[0077] The parser layer 102 is configured to query, in response to the request, the key frame of the video file that is the nearest normal data frame after the to-be-played data frame based on the position information.

[0078] The framework layer 102 is further configured to trigger a request for querying a normal data frame in response to the information returned by the parser layer 102 that the data frame to be played is an error data frame.

[0079] The parser layer 102 is also used to skip the data frames to be played that failed to be parsed, and parse the key frames and their corresponding data frames, so that the framework layer 102 triggers a request to play the key frames and the data frames of the video file with the key frames as the current first frame.

[0080] The data interaction and operation between the framework layer 102 and the parser layer 103 of the video playback device 101 in this embodiment can be found in Figure 1 This is to be understood with reference to the flowchart of the first embodiment of the video playback method of the present application.

[0081] In other embodiments, reference may be made to Figure 2 、 Figure 3 or Figure 4 It is understood based on the flow chart of the second embodiment, the third embodiment or the fourth embodiment of the video playback method of the present application, and the video playback device 101 of the present application can implement part or all of the implementation steps of the above-mentioned single embodiment, or the implementation steps of part or all of the combination of multiple embodiments, as well as implement all other implementation examples that can be obtained by those skilled in the art without making any creative work.

[0082] Please refer to Figure 6 , Figure 6 It is a flowchart of the fifth embodiment of the video playback method of the present application.

[0083] like Figure 6 As shown, in an optional implementation manner, the framework layer 102 and the parser layer 103 of the video playback device 101 can implement data interaction and operation display between the layers of the second embodiment of the video playback device 101 of the present application.

[0084] The video playback device 101 comprises a framework layer 102, a parser layer 103, a decoder layer (not shown), and a display module (not shown). The framework layer 102 is the core architecture of the playback device 101, providing the fundamental organizational structure and operating environment for the entire playback process. It manages module processes, resource management, and interface definitions. Applications can access system resources and services through these interfaces during execution. The parser layer 103 is responsible for processing audio and video data, including decapsulation, decoding, and rendering.

[0085] The framework layer 102 and the parser layer 103 interact with each other through the application interface to exchange original media data, identify file formats, extract data frames, etc., and wait for other layers to decode and render audio frames and video frames for final display and playback.

[0086] During a video file playback, the playback device 101 receives a signal from the user clicking on an audio or video file to start playback. It then passes the local path of the user-selected audio or video file to the multimedia playback framework layer 102. Framework layer 102 converts the passed path into a file handle and passes it to the parser layer 103, waiting for parser layer 103 to complete the parsing and return the corresponding data. During this period, framework layer 102 continuously requests pre-decoded data from parser layer 103. Framework layer 102 first calls the data read interface to request data, and this request is then passed down to parser layer 103.

[0087] After receiving the data reading request from the framework layer 102, the parser layer 103 enters the data reading process inside the parser layer 103, and then reads a certain amount of source data from the multimedia file for subsequent parsing and use.

[0088] The parser layer 103 parses the corresponding file according to the file handle to obtain the required code stream data of the video frame.

[0089] If a normal data frame is found, the parser layer 103 can return the data frame to the framework layer 102, and then the framework layer 102 will proceed to the next step. However, if there is an error frame in the file, the parser layer 103 may not be able to find a valid data frame. In this case, an error of the error frame parsing failure type will be returned to the framework layer 102 to identify the current situation and record the current location where the parsing failed.

[0090] Legality is one of the important bases for verifying whether a data frame is normal. When parsing the data frames of video files, the data frames of different types of video files will have their own specific formats of content to identify the legality of the frames. For example, in a specific embodiment, in order to find legal data frames, the characteristics of the data frames having a frame header, which is usually a fixed-format data and frame size information, are used to perform frame type checks, data integrity checks, timestamp checks, data format checks, etc. on the file type of the video file. Only in this way can it be determined whether a legal frame of data has been extracted from the video file data.

[0091] When the parsing of the data frame to be played fails, the legitimacy check may be used to verify the reason for the parsing failure of the data frame to be played.

[0092] The framework layer 102 then determines the result of the current data read request. If the result indicates that a correct frame of data has been obtained, the frame of data will be sent to the decoder layer for decoding and subsequent display. If the result of the return is that an error has been received, it will determine whether the error type currently received is an error frame parsing failure. If not, the error is classified as a general unexpected error and the current playback process will be terminated. If so, the error processing will begin.

[0093] The processing flow is as follows:

[0094] First, the framework layer 102 calls the fixed-point playback interface to notify the parser layer 103 to perform the fixed-point playback process, and simultaneously sets a flag to indicate that the fixed-point playback is currently triggered due to the parser layer 103 encountering an error frame parsing failure.

[0095] After receiving the fixed-point playback request from the framework layer 102, the parser layer 103 identifies that the fixed-point playback is triggered by a parsing failure of an error frame based on the flag set by the framework layer 102. Therefore, the parser layer 103 sets the frame search mode for the current fixed-point playback to a backward search for a key frame. The parser layer 103 then begins searching for a key frame backward from the location where the parsing of the recorded data frame failed.

[0096] If the key frame is found within the range of the predetermined playback progress, the frame search process is considered successful, and the key frame is returned to the framework layer 102; if the key frame cannot be found, such as the current file has no correct data frames from the position where the error frame is found to the end of the file or within a certain number of seconds of the video playback progress, the parser layer 103 returns an error of the fixed-point playback frame search failure type.

[0097] The framework layer 102 will then again determine the return value of the current fixed-point playback request. If a correct frame of data is obtained at this time, the key frame data found will be sent to the decoder layer for decoding and subsequent display according to the playback process; if a normal data frame is not obtained, the error type returned by the parser layer 103 at this time is a fixed-point playback frame search failure, and the framework layer 102 will believe that the current file has no normal data frame available for playback, so it will end the current playback process.

[0098] The third aspect of the present application provides a video playback device 110, please refer to Figure 7 , Figure 7 It is a structural diagram of an embodiment of the video playback device of the present application.

[0099] The video playback device 110 of this embodiment includes: a multimedia module 201, a memory 203 and a processor 202. The multimedia module 201 can display processed video files, such as playing audio and / or displaying video, etc. The memory 203 stores program instructions 301, and the processor 202 calls the program instructions 301 from the memory 203 to execute any of the above-mentioned video playback methods. In a specific embodiment, the processor can be integrated into a processor hardware to run a file parser, video decoder, display module, etc., or multiple processor hardware can implement parsing, decoding, rendering, etc. respectively. In resource-constrained video playback devices, the use of memory resources is effectively reduced and the smoothness of video playback is guaranteed.

[0100] A fourth aspect of the present application provides a computer-readable storage medium 300. Figure 8 , Figure 8 It is a structural diagram of an embodiment of the computer-readable storage medium 300 of the present application.

[0101] The computer-readable storage medium 300 of this embodiment stores computer program instructions 301, which can execute any of the above-mentioned video playback methods. The computer-readable storage medium 300 can be a hard disk, memory chip, SD card, optical disk, or other readable and writable storage medium in the video playback device 110.

[0102] Based on the above embodiments, the technical solution of the present application, in essence, 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 computer software product stored in a computer storage medium 500 .

[0103] The computer program product (not shown) of this embodiment includes computer program instructions 301. When executed by a processor, computer program instructions 501 implement any of the above-described video playback methods. When sold or used as a standalone product, the computer program product is stored in a computer-readable storage medium, enabling execution of a portion of the computer program product, or one or more computer program instructions 501.

[0104] Different from the existing technology, the video playback method, device, equipment, storage medium and program product provided by the present application can query the nearest key frame after the data frame to be played of the video file for processing the occurrence of erroneous video data frames, skip the data frame to be played that failed to be parsed, parse the key frame and its corresponding data frame, use the data frame as the current first frame for fixed-point playback, play the data frame and the data frame of the video file, and take shorter processing time, effectively reduce the use of memory resources, and can be applied in a variety of video playback environments to effectively improve the user experience, so as to effectively guarantee the playback frame rate of ultra-high-definition resolution video on resource-constrained video playback devices, especially embedded video playback devices, and effectively improve the user experience.

[0105] In the several embodiments provided in this application, it should be understood that the disclosed systems and devices can be implemented in other ways. For the technical solutions in the embodiments of this application, it is obvious that the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. For example, the device implementation methods described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, 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 units, which can be electrical, mechanical or other forms.

[0106] In the specification and claims of this application and the accompanying drawings, the terms "first," "second," and "third," etc. are used to distinguish similar or similar objects or entities, and are not necessarily intended to limit a particular order or sequence, unless otherwise noted. It should be understood that the terms used in this manner are interchangeable under appropriate circumstances.

[0107] In the claims and description of the present invention, all "including..." should be understood as open-ended, that is, its meaning is equivalent to "at least including...", and should not be understood as closed-ended, that is, its meaning should not be understood as "only including...".

[0108] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.

[0109] In the description of this application, it should be noted that, unless otherwise expressly specified or limited, the terms "coupled," "connected," "connected," "set," and "installed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in this application based on the specific circumstances.

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

[0111] In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0112] The above description is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A video playback method, characterized in that: The video playback method includes: In response to a failure in parsing the to-be-played data frame of the video file, determining position information of the to-be-played data frame in the video file; In response to the data frame to be played being an error data frame, querying, based on the position information, a key frame of the video file that is a nearest normal data frame after the data frame to be played; The to-be-played data frame that fails to be parsed is skipped, the key frame and its corresponding data frame are parsed, the key frame is used as the current first frame, and the key frame and the data frame of the video file are played.

2. The video playback method according to claim 1, wherein: The step of searching for a key frame that is a nearest normal data frame after the to-be-played data frame of the video file based on the position information further includes: The position of the data frame to be played and the reason for the parsing failure are recorded.

3. The video playback method according to claim 1, wherein: The video playback method further includes: If no normal data frame is found in the data within a preset range after the data frame to be played of the video file, the playing of the video file is terminated.

4. The video playback method according to claim 1, wherein: The step of searching for a key frame that is the nearest normal data frame after the to-be-played data frame of the video file based on the position information includes: Based on the fact that the type of the data frame and the integrity information of the data frame comply with the file type of the video file, it is confirmed that the data frame is a normal data frame.

5. The video playback method according to claim 1 or 2, characterized in that: In response to the data frame to be played being an error data frame, the step of searching for a key frame of the video file that is a nearest normal data frame after the data frame to be played based on the position information includes: In response to the data frame to be played being an erroneous data frame, a fixed-point play request for the video file is triggered to execute the step of querying the key frame of the video file that is the nearest normal data frame after the data frame to be played based on the position information.

6. The video playback method according to claim 1, wherein: The video file includes audio data and video data, and the data frame is an audio data frame; the step of searching for a key frame that is the nearest normal data frame after the to-be-played data frame of the video file based on the position information comprises: Based on the position information, query the video data frame to be played corresponding to the normal audio data frame of the video file; Based on the to-be-played video data frame, a video key frame closest to the to-be-played video data frame is queried.

7. The video playback method according to claim 1, wherein: In response to a failure in parsing a data frame to be played in a video file, the step of determining position information of the data frame to be played in the video file includes: In response to the data frame to be played being a normal data frame, the playing of the video file is ended.

8. A video playback device, characterized in that: The video playback device includes: a parser and a framework layer; The framework layer is used for determining the position information of the data frame to be played in the video file in response to the parsing failure of the data frame to be played in the video file; The parser layer is configured to query, in response to the request, a key frame of the video file that is a nearest normal data frame after the to-be-played data frame based on the position information; The framework layer is further configured to trigger a request to query a normal data frame in response to information returned by the parser layer indicating that the data frame to be played is an error data frame; The parser layer is also used to skip the data frame to be played that fails to be parsed, and parse the key frame and its corresponding data frame, so that the framework layer triggers a request to play the key frame and the data frame of the video file with the key frame as the current first frame.

9. A video playback device, characterized in that: The video playback device includes: a memory and a processor, the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the video playback method according to any one of claims 1 to 8.

10. A computer-readable storage medium / computer program product, characterized in that: The computer-readable storage medium stores computer program instructions, and the program instructions can be executed by a processor to implement the video playback method according to any one of claims 1 to 8; The computer program product includes computer program instructions, and when the program instructions are executed by a processor, the video playback method according to any one of claims 1 to 8 is implemented.