Video file jump playing method and device, equipment and storage medium

The video keyframe index table search and parse the playback position of the audio frame, which solves the problem that the audio frame cannot be quickly positioned when the video file is dragged and played, and realizes the rapid start-up of the video file and the audio-visual synchronization.

CN119233010APending Publication Date: 2024-12-31BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310805345.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

When the video file is dragged to play progress bar, the video frame can be quickly positioned to the position that needs to be decoded, while the audio frame cannot be quickly positioned to the position that needs to be decoded, resulting in long-term silence and screen jamming during playback.

Method used

Search and parse the playback position of the audio frame through the video keyframe index table, start decoding the video file from the starting decoding position of the audio frame, and playback when decoding the target audio frame with the target timestamp, to solve the audio keyframe Problems with the play position position when the index table is abnormal.

Benefits of technology

It realizes the quick start of playback after dragging the playback progress bar in the video file, avoiding the problem of silent playback and screen jamming, and ensuring that the audio and video are synchronized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119233010A_ABST
    Figure CN119233010A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a video file jump playing method and device, equipment and a storage medium. The method comprises the following steps: determining a target timestamp indicated by a jump request in response to the jump request for a video file; determining an audio frame initial decoding position corresponding to the target timestamp through a video key frame index table; and starting to carry out audio frame decoding on the video file from the audio frame decoding starting position, and playing decoding data of a target audio frame under the condition that the target audio frame corresponding to the target timestamp is decoded. According to the technical scheme provided by the embodiment of the invention, when the audio key frame index table of the video file is abnormal, the playing position of the audio frame is searched and analyzed through the video key frame index table, and the purpose of quickly starting playing after dragging the playing progress bar is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of video playback technology, and in particular to a method, device, equipment and storage medium for jump playback of a video file. Background Art

[0002] Currently, when the progress bar of many video files is dragged, the video frame can be quickly positioned to the position that needs to be decoded, but the audio frame cannot be quickly positioned to the position that needs to be decoded. At this time, due to audio and video synchronization problems, the video frame will be silent for a long time and the picture will be stuck while waiting for the audio frame. Summary of the invention

[0003] The present disclosure provides a method, device, equipment and storage medium for jump playback of a video file, so as to realize searching and parsing the playback position of an audio frame through a video key frame index table when an abnormality occurs in the audio key frame index table of a video file.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for jumping and playing a video file, comprising:

[0005] In response to a jump request for a video file, determining a target timestamp indicated by the jump request;

[0006] Determine the audio frame start decoding position corresponding to the target timestamp through the video key frame index table;

[0007] The audio frame of the video file is decoded starting from the audio frame start decoding position, and when a target audio frame corresponding to the target timestamp is decoded, the decoded data of the target audio frame is played.

[0008] In a second aspect, the embodiment of the present disclosure further provides a jump playback device for a video file, comprising:

[0009] A request module, configured to determine, in response to a jump request for a video file, a target timestamp indicated by the jump request;

[0010] A determination module, used to determine the audio frame decoding start position corresponding to the target timestamp through a video key frame index table;

[0011] The decoding module is used to decode the audio frame of the video file starting from the audio frame start decoding position, and when the target audio frame corresponding to the target timestamp is decoded, the decoded data of the target audio frame is played.

[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0013] one or more processors;

[0014] a storage device for storing one or more programs,

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the jump playback method of the video file as described in the embodiment of the present disclosure.

[0016] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the jump playback method of the video file as described in the embodiments of the present disclosure.

[0017] The disclosed embodiment determines, in response to a jump request for a video file, a target timestamp indicated by the jump request; determines, through a video key frame index table, a starting decoding position of an audio frame corresponding to the target timestamp; decodes the audio frames of the video file starting from the starting decoding position of the audio frame, and plays the decoded data of the target audio frame when decoding to the target audio frame corresponding to the target timestamp, thereby solving the problem of silent playback and screen freezing when the video file is dragged with a playback progress bar, and realizing that when an abnormality occurs in the audio key frame index table of the video file, the playback position of the audio frame can be searched and parsed through the video key frame index table, thereby achieving the purpose of quickly starting playback after dragging the playback progress bar. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0019] Figure 1 It is a flowchart of a method for jumping and playing a video file provided by an embodiment of the present disclosure;

[0020] Figure 2 It is a flowchart of another method for jumping and playing a video file provided by an embodiment of the present disclosure;

[0021] Figure 3 It is a schematic diagram of a process of jumping to play audio from a video file provided by an embodiment of the present disclosure;

[0022] Figure 4 It is a structural schematic diagram of a jump playback device for a video file provided by an embodiment of the present disclosure;

[0023] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0025] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0026] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0027] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0028] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0030] Figure 1 It is a flow chart of a method for jump playback of a video file provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation where the audio key frame index table of the video file is abnormal but the video key frame index table is normal, and the playback position of the audio frame is quickly located. The method can be executed by a jump playback device for the video file, and the device can be implemented in the form of software and / or hardware, and optionally, can be implemented by an electronic device, which can be a mobile terminal, a PC or a server, etc.

[0031] like Figure 1 As shown, the method includes:

[0032] S110 . In response to a jump request for a video file, determine a target timestamp indicated by the jump request.

[0033] In this embodiment, when playing a video file, the user can generate a jump request by dragging the play progress bar, and the jump request is used to request that the video file jump from the current play position to the position specified by the user. After receiving the jump request for the video file, the target timestamp indicated by the jump request is determined, that is, the play time point specified by the user. The target timestamp can be used to locate the play position of the video frame and the play position of the audio frame, that is, to determine the file offset position of the target video frame corresponding to the target timestamp, and to determine the file offset position of the target audio frame corresponding to the target timestamp.

[0034] It should be noted that this embodiment does not limit the method for locating the playback position of the video frame. The file offset position of the target video frame can be determined by searching the target timestamp in the video key frame index table, or by other methods.

[0035] In an optional embodiment, the video file is an MKV file. An MKV file is a multimedia container file that can accommodate a variety of different types of encoded video, audio and subtitle streams. In an MKV file, video key frames and audio key frames are interleaved and stored. Among them, key frames are frame data that affect picture image parameters.

[0036] S120: Determine the audio frame decoding start position corresponding to the target timestamp through the video key frame index table.

[0037] In this embodiment, before playing the video file, the video file may be scanned in advance at a first time interval to obtain key frame information such as the timestamp and file offset position of the video key frame, and generate a video key frame index table. When searching for the file offset position of the target audio frame corresponding to the target timestamp, the file offset position of the video key frame corresponding to the target timestamp may be found in the video key frame index table, and the starting decoding position of the audio frame may be determined according to the file offset position of the video key frame, so that the target audio frame corresponding to the target timestamp may be found later by decoding the audio frame in the video file.

[0038] Optionally, before determining the starting decoding position of the audio frame corresponding to the target timestamp through the video key frame index table, it also includes: judging whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table; if the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table, determining the starting decoding position of the audio frame corresponding to the target timestamp through the video key frame index table.

[0039] In this embodiment, the video file can be scanned in advance according to the second time interval to obtain key frame information such as the timestamp and file offset position of the audio key frame, and generate an audio key frame index table. Among them, the second time interval can be smaller than the first time interval, and the timestamps of the video key frame and the audio key frame are intertwined on the time axis. When the file offset position of the target audio frame corresponding to the target timestamp is to be determined, it can be first determined whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table. If the file offset position of the target audio frame can be determined according to the audio key frame index table, the file is directly jumped to the file offset position to achieve audio playback. If an abnormality occurs in the audio key frame index table, resulting in the inability to determine the file offset position of the target audio frame, in order to quickly locate the playback position of the audio frame, the file offset position of the video key frame adjacent to the target audio frame can be searched in the video key frame index table, and then the starting decoding position of the audio frame can be determined.

[0040] S130: Decode the audio frames of the video file starting from the audio frame decoding start position, and when a target audio frame corresponding to the target timestamp is decoded, play the decoded data of the target audio frame.

[0041] In this embodiment, starting from the start decoding position of the audio frame, the video file can be decoded backward frame by frame in chronological order to obtain the audio frame. If it is determined that the audio frame is before the target audio frame in time, the video file is continued to be decoded to obtain the next audio frame until the target audio frame is found.

[0042] Optionally, the audio frame decoding of the video file starts from the starting decoding position of the audio frame, and when the target audio frame corresponding to the target timestamp is decoded, the decoded data of the target audio frame is played, including: jumping to the starting decoding position of the audio frame in the video file to perform frame-by-frame decoding to obtain a fourth audio frame; if the timestamp of the fourth audio frame is less than or equal to the target timestamp, taking the fourth audio frame as a candidate audio frame, jumping to the file offset position of the fourth audio frame in the video file, and continuing frame-by-frame decoding; if the timestamp of the fourth audio frame is greater than the target timestamp, taking the candidate audio frame as the target audio frame, and playing the decoded data of the target audio frame.

[0043] The fourth audio frame is a general term for each audio frame obtained by decoding the video file frame by frame in chronological order. Figure 3As shown, jump to the audio frame decoding start position in the video file, decode the video file frame by frame to obtain an audio frame, and obtain the timestamp and file offset position of the audio frame. The audio frame is used as the fourth audio frame, and the timestamp of the fourth audio frame is compared with the target timestamp. If the timestamp of the fourth audio frame is less than the target timestamp, it means that the timestamp of the fourth audio frame is before the target timestamp on the timeline, and the fourth audio frame may become the target audio frame, so the fourth audio frame can be used as a candidate audio frame.

[0044] Jump to the file offset position of the fourth audio frame in the video file, continue to decode frame by frame backward in chronological order to obtain the next audio frame, and obtain the timestamp and file offset position of the audio frame. Re-use the audio frame as the fourth audio frame, and compare the timestamp of the fourth audio frame with the target timestamp. If the timestamp of the fourth audio frame is equal to the target timestamp, then the fourth audio frame is the target audio frame, and the file offset position of the fourth audio frame is the playback position of the audio frame, and jump to the file offset position of the fourth audio frame in the video file. Of course, at this time, the fourth audio frame can also continue to be used as a candidate audio frame, and jump to the file offset position of the fourth audio frame in the video file, continue to decode frame by frame backward to obtain the next audio frame, and obtain the timestamp and file offset position of the audio frame. Continue to use the audio frame as the fourth audio frame, and compare the timestamp of the fourth audio frame with the target timestamp. If the timestamp of the fourth audio frame is greater than the target timestamp, it means that the timestamp of the current fourth audio frame is after the target timestamp on the timeline. In order to avoid the target audio frame being ahead of the target video frame, the previous decoded audio frame, that is, the current candidate audio frame, can be used as the target audio frame, and the decoded data of the target audio frame can be played.

[0045] Optionally, after jumping to the starting decoding position of the audio frame in the video file for decoding to obtain the fourth audio frame, it also includes: generating an audio key frame index table entry corresponding to the fourth audio frame according to the timestamp and file offset position of the fourth audio frame, and saving it to the audio key frame index table.

[0046] In this embodiment, in order to facilitate the subsequent acceleration of the speed of locating the audio frame playback position, a corresponding audio key frame index table item can be generated based on the timestamp and file offset position of each audio frame obtained by decoding. If the audio key frame index table does not exist, the audio key frame index table is first created, and then the audio key frame index table item is saved in the audio key frame index table.

[0047] The technical solution of the disclosed embodiment determines the target timestamp indicated by the jump request for the video file in response to the jump request; determines the audio frame starting decoding position corresponding to the target timestamp through the video key frame index table; decodes the audio frame of the video file from the audio frame starting decoding position, and plays the decoded data of the target audio frame when the target audio frame corresponding to the target timestamp is decoded, thereby solving the problem of silent playback and screen freezing when the video file is dragged with the playback progress bar, and realizes that when an abnormality occurs in the audio key frame index table of the video file, the playback position of the audio frame is searched and parsed through the video key frame index table, thereby achieving the purpose of quickly starting playback after dragging the playback progress bar.

[0048] Figure 2 This is a flow chart of another method for jumping and playing a video file provided by an embodiment of the present disclosure. Based on the above embodiment, this embodiment further provides specific steps for determining whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table, and specific steps for determining the start decoding position of the audio frame corresponding to the target timestamp through the video key frame index table. Figure 2 As shown, the method includes:

[0049] S210: In response to a jump request for a video file, determine a target timestamp indicated by the jump request.

[0050] S220: Determine whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table.

[0051] In an optional embodiment, if the audio key frame index table satisfies any of the following conditions, the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table: the audio key frame index table does not exist; the audio key frame index table exists, and the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid.

[0052] In this embodiment, if the audio key frame index table does not exist, the file offset position of the target audio frame cannot be determined according to the audio key frame index table. Figure 3As shown, the target timestamp X is searched from the audio key frame index table to obtain the timestamp T and file offset position P of the first audio key frame whose timestamp is located before the target timestamp on the time axis and is closest to the target timestamp. It is determined whether the difference between the target timestamp X and the timestamp T of the first audio key frame is less than or equal to the preset threshold threshold. If so, it is considered that the timestamp of the first audio key frame is valid, the file offset position of the first audio key frame is also valid, and the first audio key frame is close enough to the target audio frame. Therefore, the first audio key frame can be used as the target audio frame, and the file offset position P of the first audio key frame can be jumped to in the video file to achieve audio playback. If the difference between the target timestamp X and the timestamp T of the first audio key frame is greater than the preset threshold threshold, it is considered that the timestamp of the first audio key frame is invalid, so the first audio key frame cannot be used as the target audio frame, and the file offset position of the target audio frame cannot be determined according to the audio key frame index table.

[0053] S230: If the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table, determine the audio frame decoding start position corresponding to the target timestamp through the video key frame index table.

[0054] In this embodiment, when the audio key frame index table does not exist, or when the audio key frame index table exists but the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid, the file offset position of the target audio frame cannot be determined according to the audio key frame index table. Therefore, in order to quickly locate the playback position of the audio frame, the starting decoding position of the audio frame can be determined by searching the file offset position of the video key frame adjacent to the target audio frame in the video key frame index table, so as to find the target audio frame corresponding to the target timestamp by decoding the audio frame.

[0055] Optionally, determining the audio frame starting decoding position corresponding to the target timestamp through the video key frame index table includes: if the audio key frame index table does not exist, obtaining the file offset position of the second video key frame that is earlier than and closest to the target timestamp in time according to the video key frame index table; and using the file offset position as the audio frame starting decoding position.

[0056] In this embodiment, Figure 3As shown, in the case where the audio key frame index table does not exist, the target timestamp X is searched from the video key frame index table to obtain the file offset position P1 of the second video key frame whose timestamp is before the target timestamp on the time axis and is closest to the target timestamp. Since there is no file offset position P of the audio key frame closest to the target timestamp at this time, that is, P is invalid, the file offset position P1 is used as the starting decoding position of the audio frame.

[0057] Optionally, determining the audio frame starting decoding position corresponding to the target timestamp through the video key frame index table includes: if the audio key frame index table exists and the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid, then obtaining the file offset position of the third video key frame that is earlier than and closest to the target timestamp according to the video key frame index table; judging whether the file offset position of the first audio key frame is greater than the file offset position of the third video key frame; if so, using the file offset position of the first audio key frame as the audio frame starting decoding position; if not, using the file offset position of the third video key frame as the audio frame starting decoding position.

[0058] In this embodiment, Figure 3 As shown, in the case where the audio key frame index table exists but the timestamp of the first audio key frame determined according to the audio key frame index table is invalid, the target timestamp X is searched from the video key frame index table to obtain the file offset position P1 of the third video key frame whose timestamp is located before the target timestamp on the time axis and is closest to the target timestamp. Since there is also a file offset position P of the first audio key frame that is also located before the target timestamp in time, the file offset positions P and P1 are compared. If P is greater than P1, the first audio key frame is closer to the target audio frame than the third video key frame, and since the timestamp T of the first audio key frame is before the target timestamp X, the file offset position of the first audio key frame is valid, and therefore, the file offset position of the first audio key frame is used as the audio frame start decoding position. If P is less than or equal to P1, the third video key frame is closer to the target audio frame than the first audio key frame, and since the timestamp of the third video key frame is before the target timestamp, the file offset position of the third video key frame is valid, and therefore, the file offset position of the third video key frame is used as the audio frame start decoding position.

[0059] S240: Decode the audio frames of the video file starting from the audio frame decoding start position, and when a target audio frame corresponding to the target timestamp is decoded, play the decoded data of the target audio frame.

[0060] In this embodiment, Figure 3 As shown, jump to the audio frame start decoding position in the file, decode the video file frame by frame to obtain an audio frame, and obtain the timestamp T2 and file offset position P2 of the audio frame. Compare the timestamp T2 with the target timestamp X. If the timestamp T2 is less than or equal to the target timestamp X, further determine whether the audio key frame index table exists. If it does not exist, first create an audio key frame index table. If it does exist, generate a corresponding audio key frame index table entry based on the timestamp T2 and file offset position P2 of the audio frame, and save it in the audio key frame index table. Then jump to the file offset position P2 in the video file. At this time, if you want to speed up the positioning of the audio frame playback position, you can use the file offset position P2 as the file offset position of the target audio frame. If you want to accurately locate the playback position of the audio frame, repeat the above process, continue to decode frame by frame backward in chronological order to obtain the next audio frame, and obtain the timestamp T2 and file offset position P2 of the audio frame until the timestamp T2 is greater than the target timestamp X. At this time, since T2 is greater than X, the file offset position P2 is invalid, so the jump position of the video file remains at the file offset position of the last decoded audio frame.

[0061] It should be noted that Figure 3 The process of decoding frame by frame to obtain audio frames and generating audio key frame index entries after the video file jumps to the file offset position P of the first audio key frame is not shown.

[0062] When the timestamp T2 of the decoded audio frame is greater than the target timestamp X, a corresponding audio key frame index table entry can still be generated according to the timestamp and file offset position of the audio frame and saved in the audio key frame index table.

[0063] The technical solution of the disclosed embodiment determines the target timestamp indicated by the jump request for the video file in response to the jump request; determines the audio frame starting decoding position corresponding to the target timestamp through the video key frame index table; decodes the audio frame of the video file from the audio frame starting decoding position, and plays the decoded data of the target audio frame when the target audio frame corresponding to the target timestamp is decoded, thereby solving the problem of silent playback and screen freezing when the video file is dragged with the playback progress bar, and realizes that when an abnormality occurs in the audio key frame index table of the video file but the video key frame index table is normal, the file offset position of the video key frame adjacent to the target timestamp is searched through the video key frame index table, the playback position of the audio frame is quickly parsed, and the audio key frame index table cache is rebuilt based on this, so as to achieve the purpose of quickly starting playback after dragging the playback progress bar.

[0064] Figure 4 FIG. 1 is a schematic diagram of a structure of a jump playback device for a video file provided by an embodiment of the present disclosure. Figure 4 As shown, the device includes: a request module 410, a determination module 420 and a decoding module 430.

[0065] The request module 410 is used to determine the target timestamp indicated by the jump request in response to the jump request for the video file;

[0066] A determination module 420, configured to determine the audio frame decoding start position corresponding to the target timestamp through a video key frame index table;

[0067] The decoding module 430 is used to decode the audio frame of the video file starting from the audio frame start decoding position, and when the target audio frame corresponding to the target timestamp is decoded, play the decoded data of the target audio frame.

[0068] The technical solution of the disclosed embodiment determines the target timestamp indicated by the jump request for the video file in response to the jump request; determines the audio frame starting decoding position corresponding to the target timestamp through the video key frame index table; decodes the audio frame of the video file from the audio frame starting decoding position, and plays the decoded data of the target audio frame when the target audio frame corresponding to the target timestamp is decoded, thereby solving the problem of silent playback and screen freezing when the video file is dragged with the playback progress bar, and realizes that when an abnormality occurs in the audio key frame index table of the video file, the playback position of the audio frame is searched and parsed through the video key frame index table, thereby achieving the purpose of quickly starting playback after dragging the playback progress bar.

[0069] Optionally, also include:

[0070] A judgment module, used for judging whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table before determining the start decoding position of the audio frame corresponding to the target timestamp through the video key frame index table;

[0071] If the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table, the audio frame decoding start position corresponding to the target timestamp is determined through the video key frame index table.

[0072] Optional, judgment module, used to:

[0073] If the audio key frame index table satisfies any of the following conditions, the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table:

[0074] The audio keyframe index table does not exist;

[0075] The audio key frame index table exists, and the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid.

[0076] Optionally, the determination module 420 includes:

[0077] A first determining unit is configured to obtain, according to the video key frame index table, a file offset position of a second video key frame that is earlier than and closest to the target timestamp in time if the audio key frame index table does not exist;

[0078] The file offset position is used as the audio frame start decoding position.

[0079] Optionally, the determination module 420 includes:

[0080] A second determining unit is configured to obtain, according to the video key frame index table, a file offset position of a third video key frame that is earlier than and closest to the target timestamp in time, if the audio key frame index table exists and the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid;

[0081] Determining whether the file offset position of the first audio key frame is greater than the file offset position of the third video key frame;

[0082] If yes, taking the file offset position of the first audio key frame as the audio frame start decoding position;

[0083] If not, the file offset position of the third video key frame is used as the audio frame decoding start position.

[0084] Optionally, the decoding module 430 is used to:

[0085] Jump to the audio frame decoding start position in the video file and perform frame-by-frame decoding to obtain a fourth audio frame;

[0086] If the timestamp of the fourth audio frame is less than or equal to the target timestamp, taking the fourth audio frame as a candidate audio frame, jumping to the file offset position of the fourth audio frame in the video file, and continuing frame-by-frame decoding;

[0087] If the timestamp of the fourth audio frame is greater than the target timestamp, the candidate audio frame is used as a target audio frame, and the decoded data of the target audio frame is played.

[0088] Optionally, the decoding module 430 is further configured to: jump to the audio frame decoding start position in the video file for decoding, and after obtaining the fourth audio frame,

[0089] An audio key frame index table entry corresponding to the fourth audio frame is generated according to the timestamp and the file offset position of the fourth audio frame, and is saved in the audio key frame index table.

[0090] Optionally, the video file is a MKV file.

[0091] The jump playback device for video files provided in the embodiments of the present disclosure can execute the jump playback method for video files provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0092] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.

[0093] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 5 , which shows an electronic device (eg, Figure 5 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0094] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.

[0095] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0096] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0097] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0098] The electronic device provided by the embodiment of the present disclosure and the jump playback method of the video file provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0099] The embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the jump playback method of the video file provided in the above embodiment is implemented.

[0100] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0101] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperTextTransferProtocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an adhoc peer-to-peer network), as well as any currently known or future developed network.

[0102] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0103] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: determines the target timestamp indicated by the jump request for the video file in response to the jump request; determines the audio frame starting decoding position corresponding to the target timestamp through the video key frame index table; decodes the audio frame of the video file from the audio frame starting decoding position, and when the target audio frame corresponding to the target timestamp is decoded, plays the decoded data of the target audio frame.

[0104] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or combinations thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0107] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0108] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0109] According to one or more embodiments of the present disclosure, Example 1 provides a method for jumping and playing a video file, including:

[0110] In response to a jump request for a video file, determining a target timestamp indicated by the jump request;

[0111] Determine the audio frame start decoding position corresponding to the target timestamp through the video key frame index table;

[0112] The audio frame of the video file is decoded starting from the audio frame start decoding position, and when a target audio frame corresponding to the target timestamp is decoded, the decoded data of the target audio frame is played.

[0113] According to one or more embodiments of the present disclosure, Example 2 is a method according to Example 1, and before determining the audio frame start decoding position corresponding to the target timestamp through the video key frame index table, it also includes:

[0114] Determine whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table;

[0115] If the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table, the audio frame decoding start position corresponding to the target timestamp is determined through the video key frame index table.

[0116] According to one or more embodiments of the present disclosure, Example 3, according to the method described in Example 2, determines whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table, including:

[0117] If the audio key frame index table satisfies any of the following conditions, the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table:

[0118] The audio keyframe index table does not exist;

[0119] The audio key frame index table exists, and the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid.

[0120] According to one or more embodiments of the present disclosure, Example 4 is the method according to Example 3, wherein determining the audio frame start decoding position corresponding to the target timestamp through the video key frame index table includes:

[0121] If the audio key frame index table does not exist, obtaining the file offset position of the second video key frame that is earlier than and closest to the target timestamp in time according to the video key frame index table;

[0122] The file offset position is used as the audio frame start decoding position.

[0123] According to one or more embodiments of the present disclosure, Example 5 is a method according to Example 3, wherein determining the audio frame start decoding position corresponding to the target timestamp through the video key frame index table includes:

[0124] If the audio key frame index table exists, and the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid, then according to the video key frame index table, the file offset position of the third video key frame that is earlier than and closest to the target timestamp is obtained;

[0125] Determining whether the file offset position of the first audio key frame is greater than the file offset position of the third video key frame;

[0126] If yes, taking the file offset position of the first audio key frame as the audio frame start decoding position;

[0127] If not, the file offset position of the third video key frame is used as the audio frame decoding start position.

[0128] According to one or more embodiments of the present disclosure, Example 6 is the method according to Example 1, wherein the step of decoding the audio frame of the video file from the audio frame start decoding position, and when the target audio frame corresponding to the target timestamp is decoded, playing the decoded data of the target audio frame includes:

[0129] Jump to the audio frame decoding start position in the video file and perform frame-by-frame decoding to obtain a fourth audio frame;

[0130] If the timestamp of the fourth audio frame is less than or equal to the target timestamp, taking the fourth audio frame as a candidate audio frame, jumping to the file offset position of the fourth audio frame in the video file, and continuing frame-by-frame decoding;

[0131] If the timestamp of the fourth audio frame is greater than the target timestamp, the candidate audio frame is used as a target audio frame, and the decoded data of the target audio frame is played.

[0132] According to one or more embodiments of the present disclosure, Example 7, according to the method described in Example 6, after jumping to the audio frame start decoding position in the video file for decoding to obtain the fourth audio frame, further includes:

[0133] An audio key frame index table entry corresponding to the fourth audio frame is generated according to the timestamp and the file offset position of the fourth audio frame, and is saved in the audio key frame index table.

[0134] According to one or more embodiments of the present disclosure, Example 8 is based on the method described in any one of Examples 1-7, and the video file is an MKV file.

[0135] According to one or more embodiments of the present disclosure, Example 9 provides a jump playback device for a video file, including:

[0136] A request module, configured to determine, in response to a jump request for a video file, a target timestamp indicated by the jump request;

[0137] A determination module, configured to determine the audio frame decoding start position corresponding to the target timestamp through a video key frame index table if the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table;

[0138] The decoding module is used to decode the audio frame of the video file starting from the audio frame start decoding position, and when the target audio frame corresponding to the target timestamp is decoded, the decoded data of the target audio frame is played.

[0139] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, the electronic device comprising:

[0140] one or more processors;

[0141] a storage device for storing one or more programs,

[0142] When the one or more programs are executed by the one or more processors, the one or more processors implement the jump playback method of the video file as described in any one of Examples 1-8.

[0143] According to one or more embodiments of the present disclosure, Example 11 provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute the jump playback method of a video file as described in any one of Examples 1-8.

[0144] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0145] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0146] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for jumping and playing a video file, characterized in that: include: In response to a jump request for a video file, determining a target timestamp indicated by the jump request; Determine the audio frame start decoding position corresponding to the target timestamp through the video key frame index table; The audio frame of the video file is decoded starting from the audio frame start decoding position, and when a target audio frame corresponding to the target timestamp is decoded, the decoded data of the target audio frame is played.

2. The method according to claim 1, characterized in that Before determining the audio frame start decoding position corresponding to the target timestamp through the video key frame index table, the method further includes: Determine whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table; If the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table, the audio frame decoding start position corresponding to the target timestamp is determined through the video key frame index table.

3. The method according to claim 2, characterized in that Determining whether the file offset position of the target audio frame corresponding to the target timestamp can be determined according to the audio key frame index table includes: If the audio key frame index table satisfies any of the following conditions, the file offset position of the target audio frame corresponding to the target timestamp cannot be determined according to the audio key frame index table: The audio keyframe index table does not exist; The audio key frame index table exists, and the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid.

4. The method according to claim 3, characterized in that Determining the audio frame start decoding position corresponding to the target timestamp through the video key frame index table includes: If the audio key frame index table does not exist, obtaining the file offset position of the second video key frame that is earlier than and closest to the target timestamp in time according to the video key frame index table; The file offset position is used as the audio frame start decoding position.

5. The method according to claim 3, characterized in that: The step of determining the audio frame start decoding position corresponding to the target timestamp through the video key frame index table includes: If the audio key frame index table exists, and the timestamp of the first audio key frame that is earlier than and closest to the target timestamp determined according to the audio key frame index table is invalid, then according to the video key frame index table, the file offset position of the third video key frame that is earlier than and closest to the target timestamp is obtained; Determining whether the file offset position of the first audio key frame is greater than the file offset position of the third video key frame; If yes, taking the file offset position of the first audio key frame as the audio frame start decoding position; If not, the file offset position of the third video key frame is used as the audio frame decoding start position.

6. The method according to claim 1, characterized in that The step of decoding the audio frame of the video file from the audio frame start decoding position, and playing the decoded data of the target audio frame when the target audio frame corresponding to the target timestamp is decoded, includes: Jump to the audio frame decoding start position in the video file and perform frame-by-frame decoding to obtain a fourth audio frame; If the timestamp of the fourth audio frame is less than or equal to the target timestamp, taking the fourth audio frame as a candidate audio frame, jumping to the file offset position of the fourth audio frame in the video file, and continuing frame-by-frame decoding; If the timestamp of the fourth audio frame is greater than the target timestamp, the candidate audio frame is used as a target audio frame, and the decoded data of the target audio frame is played.

7. The method according to claim 6, characterized in that After jumping to the audio frame start decoding position in the video file to decode and obtain the fourth audio frame, the method further includes: An audio key frame index table entry corresponding to the fourth audio frame is generated according to the timestamp and the file offset position of the fourth audio frame, and is saved in the audio key frame index table.

8. The method according to any one of claims 1 to 7, characterized in that The video file is a MKV file.

9. A jump playback device for a video file, characterized in that: include: A request module, configured to determine, in response to a jump request for a video file, a target timestamp indicated by the jump request; A determination module, used to determine the audio frame decoding start position corresponding to the target timestamp through a video key frame index table; The decoding module is used to decode the audio frame of the video file starting from the audio frame start decoding position, and when the target audio frame corresponding to the target timestamp is decoded, the decoded data of the target audio frame is played.

10. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the jump playback method for the video file as described in any one of claims 1-8.

11. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the jump playback method of the video file according to any one of claims 1 to 8 when executed by a computer processor.