Methods, apparatus, storage media and devices for generating video thumbnails

By dividing the video into several groups and decoding the video frames in parallel, and by utilizing caching technology and parallel task processing, the problem of long video thumbnail generation time in existing technologies is solved, and more efficient video thumbnail generation is achieved.

CN119854574BActive Publication Date: 2025-11-14GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311345967.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-11-14
Estimated Expiration
2043-10-17

AI Technical Summary

Technical Problem

Existing video thumbnail generation methods require repeated decoding steps, resulting in high computational resource consumption and long generation time, especially when generating multiple video thumbnails, which is inefficient.

Method used

By dividing the target video into several groups, each group containing at least one target time point, decoding video frames in a preset order, obtaining frame data of the first and second video frames, and using caching technology to reduce repeated decoding, video thumbnails are generated by executing multiple decoding tasks in parallel.

Benefits of technology

It effectively reduces the consumption of computing resources, improves the speed and efficiency of video thumbnail generation, and reduces generation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854574B_ABST
    Figure CN119854574B_ABST
Patent Text Reader

Abstract

This invention relates to a video thumbnail generation method, apparatus, storage medium, and device. Based on the image group length information of the target video and the target time point of the video thumbnail to be generated in the target video, the target video is divided into several groups, with each group including at least one target time point. When the current group includes a first target time point and a second target time point, each video frame of the current group is first decoded in a preset order to obtain the frame data of the first video frame. Then, the frame data of the second video frame is obtained by decoding the video frames after the first video frame. This avoids having to start decoding from the first video frame every time, reducing the consumption of computing resources and improving the generation speed and efficiency of video thumbnails.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video thumbnails, and in particular to a method, apparatus, storage medium, and device for generating video thumbnails. Background Technology

[0002] Video thumbnails can be used to preview video content, making it easier for users to find and edit videos.

[0003] Existing methods for generating video thumbnails first search for the keyframe closest to a specified time point. Starting from that keyframe, the next video frame is decoded until the video frame at the specified time point is decoded. Then, the video thumbnail is generated based on the frame data of that video frame. However, in the above method, the above steps need to be repeated for each video thumbnail generated. When multiple video thumbnails need to be generated, a lot of computing resources are required, and the video thumbnail generation time is relatively long. Summary of the Invention

[0004] This application provides a video thumbnail generation method, apparatus, storage medium, and device that can improve the efficiency of video thumbnail generation.

[0005] In a first aspect, embodiments of this application provide a method for generating video thumbnails, comprising the following steps:

[0006] Obtain target time point information and image group length information of target video; wherein, the target time point information includes at least one target time point, the target time point being the time point of the video thumbnail to be generated in the target video;

[0007] Based on the at least one target time point and the image group length information, the target video is divided into several groups; wherein each group includes at least one target time point;

[0008] If the current group includes a first target time point and a second target time point, each video frame of the current group is decoded in a preset order until the first video frame is decoded, and the frame data of the first video frame is obtained. Then, the video frames after the first video frame are decoded until the second video frame is decoded, and the frame data of the second video frame is obtained. Wherein, the first video frame is the video frame closest to the time point of the first target time point; the second video frame is the video frame closest to the time point of the second target time point.

[0009] Acquire several frames of data from the aforementioned groups, and generate video thumbnails based on the aforementioned frames of data.

[0010] Secondly, embodiments of this application provide a video thumbnail generation apparatus, the apparatus comprising:

[0011] The information acquisition module is used to acquire target time point information and image group length information of the target video; wherein, the target time point information includes at least one target time point, and the target time point is the time point of the video thumbnail to be generated in the target video;

[0012] A grouping module is used to divide the target video into several groups based on the at least one target time point and the image group length information; wherein each group includes at least one target time point;

[0013] The decoding module is configured to, if the current group includes a first target time point and a second target time point, decode each video frame of the current group in a preset order until the first video frame is decoded, obtain the frame data of the first video frame, and decode the video frames after the first video frame until the second video frame is decoded, obtain the frame data of the second video frame; wherein, the first video frame is the video frame closest to the time point of the first target time point; and the second video frame is the video frame closest to the time point of the second target time point.

[0014] The decoding module is used to acquire several frames of data from the several groups and generate video thumbnails based on the several frames of data.

[0015] Thirdly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the video thumbnail generation method as described in any of the preceding claims.

[0016] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor;

[0017] When the processor executes the computer program, it implements the steps of the video thumbnail generation method as described in any of the above.

[0018] In this embodiment, the target video is divided into several groups based on the image group length information of the target video and the target time point of the video thumbnail to be generated in the target video. Each group includes at least one target time point. When the current group includes a first target time point and a second target time point, each video frame of the current group is first decoded in a preset order to obtain the frame data of the first video frame. Then, the frame data of the second video frame is obtained by decoding the video frames after the first video frame. This avoids having to start decoding from the first video frame every time, reduces the consumption of computing resources, and improves the generation speed and efficiency of the video thumbnail.

[0019] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description

[0020] Figure 1 This is a flowchart of a video thumbnail generation method in one embodiment of the present invention;

[0021] Figure 2 This is a schematic diagram of the grouping of target videos in one embodiment of the present invention;

[0022] Figure 3 This is a flowchart of step S130 in one embodiment of the present invention;

[0023] Figure 4 This is a flowchart of step S140 in another embodiment of the present invention;

[0024] Figure 5 This is a schematic diagram of the structure of a video thumbnail generation device in one embodiment of the present invention;

[0025] Figure 6 This is a schematic diagram of the structure of an electronic device according to one embodiment of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0027] It should be understood that the described embodiments are merely some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.

[0028] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0029] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0030] Furthermore, in the description of this application, unless otherwise stated, "several" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0031] This application provides a method for generating video thumbnails, which can be applied to electronic devices. Please refer to [link / reference]. Figure 1 The video thumbnail generation method of this application specifically includes the following steps:

[0032] S110: Obtain target time point information and image group length information of target video; the target time point information includes at least one target time point, which is the time point of the video thumbnail to be generated in the target video;

[0033] In this embodiment of the application, at least one video thumbnail needs to be generated for the target video, and each video thumbnail corresponds to a different target time point in the target video.

[0034] A group of pictures (GOP) is a set of consecutive video frames. A group of pictures typically consists of a set of consecutive video frames that start from a keyframe and end at the next keyframe.

[0035] Image group length information is used to determine the length of an image group, which can be the number of frames between two keyframes.

[0036] S120: Based on the at least one target time point and the image group length information, the target video is divided into several groups; wherein each group includes at least one target time point;

[0037] Specifically, during grouping, the target video can be grouped according to the image group length, or, in another embodiment, the target video can be grouped according to at least one target time point and the image group length, such that each group includes at least one target time point.

[0038] In this embodiment, the target video duration is 25 seconds, the image group length is 5 seconds, and the target time points are 1, 4, 7, 12, 13, 14, 16, 18, 19, 20, 21, and 24. Therefore, the target video can be divided into 5 groups, and the correspondence between each group and the target time points is as follows: Figure 2 As shown: the first group includes target time points 1 and 4, the second group includes target time point 7, the third group includes 12, 13, and 14, the fourth group includes target time points 16, 18, and 19, and the fifth group includes target time points 20, 21, and 24.

[0039] S130: If the current group includes a first target time point and a second target time point, decode each video frame of the current group in a preset order to obtain the frame data of the first video frame, and decode the video frames after the first video frame until the frame data of the second video frame is obtained; wherein, the first video frame is the video frame closest to the time point of the first target time point; the second video frame is the video frame closest to the time point of the second target time point;

[0040] In this application, each group includes at least one target time point. When a group includes only one target time point, each video frame of the current group is decoded in a preset order to obtain the frame data of the decoded video frame. If the time point of the current video frame is closest to the target time point, the current video frame is determined to be the target video frame, the frame data of the target video frame is obtained, and the decoding ends.

[0041] When a group includes a first target time point and a second target time point, each video frame in the current group is first decoded according to a preset order to obtain the frame data of the decoded video frames. If the time point of the current video frame is closest to the first target time point, the current video frame is determined to be the first video frame, and then the decoding of video frames after the first video frame continues, instead of starting decoding from the first video frame again, thereby reducing unnecessary decoding overhead. For video frames that have already been decoded, the previously decoded data is directly reused, which can effectively reduce decoding time. When the time point of a video frame is decoded to be closest to the second target time point, the video frame is determined to be the second video frame; wherein, the first target time point is before the second target time point.

[0042] The time point of a video frame can be obtained by reading information such as the timestamp of the video frame.

[0043] The first and second video frames of this application can be regarded as video frames corresponding to the first target time point and the second target time point, that is, video frames corresponding to the video thumbnails.

[0044] S140: Obtain several frames of data from the several groups, and generate a video thumbnail based on the several frames of data.

[0045] Specifically, by decoding the video frames at the target time point of each group, the frame data of each group is obtained. The decoded frame data can be directly used to generate video thumbnails, thereby rendering and drawing multiple video thumbnails based on the frame data of all groups of the target video. The acquisition of frame data for each group can be referred to the description of step S130 of this application above.

[0046] In this embodiment, the target video is divided into several groups based on the image group length information of the target video and the target time point of the video thumbnail to be generated in the target video. Each group includes at least one target time point. When the current group includes a first target time point and a second target time point, each video frame of the current group is first decoded in a preset order to obtain the frame data of the first video frame. Then, the frame data of the second video frame is obtained by decoding the video frames after the first video frame. This avoids the need to start decoding from the first video frame every time frame data is obtained, reduces the consumption of computing resources, and improves the generation speed and efficiency of video thumbnails.

[0047] In step S130, when obtaining the frame data of the first video frame and the frame data of the second video frame, it is possible to start from the key frame of the current group and decode the key frame and each subsequent video frame in sequence to obtain the frame data of each video frame. The frame data can be edited and rendered, so that the corresponding video thumbnail can be generated based on the frame data.

[0048] Specifically, such as Figure 3 As shown, in one embodiment, obtaining the frame data of the first video frame specifically includes:

[0049] S131: Obtain the keyframe of the current group;

[0050] S132: Decode the key frame to obtain the frame data of the key frame;

[0051] S133: Based on the frame data of the key frame, decode the video frames after the key frame in a preset order until the first video frame is decoded.

[0052] A keyframe is the most important frame in a video. It is usually used to represent the start or end frame of a shot in a video. Keyframes typically contain the most representative content in the video, such as the turning point or climax of an action. Keyframes can be used as editing points to insert, delete, or modify video content. Keyframes can be video frames that users have pre-marked for the video content.

[0053] Keyframes are typically complete encoded frames that can be decoded without referencing other frame data. However, when decoding other video frames using a decoding algorithm, it is usually necessary to refer to the complete data of the previous frame. Therefore, in this embodiment, when decoding a group of video frames, the keyframe of the group is first found, and then each video frame after the keyframe is decoded until the first video frame is decoded.

[0054] The preset order is used to determine the next video frame to be decoded. In this application, the preset order can be to decode the video frames sequentially.

[0055] When decoding video frames of a target video, existing decoding algorithms or existing decoding tools such as Webcodecs and MP4box can be used to obtain the frame data of the video frames. The encoding algorithm can be determined according to the encoding and decoding protocol of the target video. For example, if the target video is encoded using the h264 protocol, the corresponding h264 protocol decoding algorithm can be used to decode it.

[0056] Preferably, the keyframe in this application can be the keyframe in the group that is closest to the time point of the first target time point. Specifically, the group can be searched by calling the MP4box seek method or other existing search algorithms to obtain the keyframe that is closest to the time point of the first target time point, and then the keyframe can be decoded, thereby reducing the amount of data to be decoded and improving the decoding efficiency.

[0057] The steps of decoding each video frame of the current group in a preset order specifically include:

[0058] Obtain the decoding component built into the electronic device;

[0059] Using the decoding component, each video frame of the current group is decoded in a preset order.

[0060] The decoding component can be a video codec built into the electronic device. This application utilizes the built-in decoding component of the electronic device to decode video frames, eliminating the need to load an additional decoding program, which can effectively save space and computing resources of the electronic device.

[0061] Preferably, in this embodiment of the application, Webcodecs can be used to decode the target video. Webcodecs is a browser-based video codec that can decode and encode video in the browser. The frame data of the video frame can be obtained by calling the decode method of videoDecoder in Webcodecs. Webcodecs is a built-in component of the browser, and the electronic device does not need to load a decoding program, which can effectively save the computing resources of the electronic device.

[0062] It should be noted that the process of obtaining the frame data of the second video frame is similar to the process of obtaining the frame data of the first video frame. Please refer to the above description of the steps in this application, and it will not be repeated here.

[0063] In this application, the first video frame is the video frame closest to the first target time point; the second video frame is the video frame closest to the second target time point. When determining the first video frame and the second video frame, the time difference between the current video frame's time point and the target time point can be used to determine whether the video frame is the video frame corresponding to the target time point.

[0064] Specifically, the steps for obtaining the frame data of the first video frame include:

[0065] If the time difference between the current video frame and the first target time point is less than or equal to the time difference threshold, the current video frame is taken as the first video frame, and the frame data of the first video frame is obtained.

[0066] The specific steps for obtaining the frame data of the second video frame include:

[0067] If the time difference between the current video frame and the second target time point is less than or equal to the time difference threshold, the current video frame is used as the second video frame, and the frame data of the second video frame is obtained.

[0068] The time difference threshold is used to determine whether the current video frame is the video frame corresponding to the target time point. The time difference threshold can be determined according to the frame rate of the video frame. Alternatively, in one embodiment, the time difference threshold can be 1 / fps, where fps is the number of frames transmitted per second. For example, when the frame rate of the target video is 30fps, the time difference threshold can be set to 33 milliseconds.

[0069] If the time difference between the current video frame and the first target time point is greater than the time difference threshold, it is determined that the current video frame is not the first video frame, and the decoding of the next video frame continues until the first video frame is decoded. Similarly, if the current group has a second target time point, after decoding the first video frame, the decoding of the video frames after the first video frame continues. If the time difference between the current video frame and the second target time point is greater than the time difference threshold, it is determined that the current video frame is not the second video frame, and the decoding of the next video frame continues until the second video frame is decoded.

[0070] In step S130, the decoded frame data can be stored in a user-preset buffer. When the video frame needs to be decoded again, the frame data of the video frame in the buffer can be directly called, thus eliminating the need to decode the video frame again, reducing the consumption of computing resources and improving decoding efficiency.

[0071] Specifically, after decoding each video frame of the current group in a preset order, the following steps are also included:

[0072] The decoded frame data is cached in the target area;

[0073] The specific steps for decoding video frames following the first video frame include:

[0074] Read cached frame data from the target region, and decode video frames after the first video frame based on the cached frame data.

[0075] The target area can be a user-defined area used to cache frame data.

[0076] In this embodiment of the application, by caching the decoded frame data in the target area, when it is necessary to decode the video frames after the first video frame, the frame data of the previous video frame can be directly retrieved from the target area, so that the video frames that have already been decoded do not need to be decoded again, thereby reducing the decoding time and improving the decoding efficiency.

[0077] Preferably, for each group, a corresponding decoding task can be generated. By executing multiple decoding tasks simultaneously, the frame data of each group can be obtained quickly, thereby improving the efficiency of video thumbnail generation.

[0078] like Figure 4 As shown, specifically, the steps for obtaining several frames of data from the several groups include:

[0079] S141: Generate the decoding task corresponding to each group;

[0080] S142: Execute the decoding task in parallel to obtain the frame data corresponding to each group.

[0081] The decoding task is used to obtain the corresponding frame data of the group.

[0082] The number of tasks that can be executed in parallel can be determined based on the computing resources of the electronic device. Specifically, it can be the maximum number of tasks that the electronic device can execute. For example, if the current computing resources of the electronic device support a maximum of 5 tasks, then 5 decoding tasks can be executed in parallel. The execution order of each decoding task can be set according to user requirements.

[0083] In another embodiment, the number of tasks to be executed in parallel can also be determined based on the number of groups, or in other embodiments, the number of tasks to be executed in parallel can also be determined based on the computing resources of the electronic device and the number of groups.

[0084] In this embodiment, by generating a decoding task corresponding to each group and executing the decoding tasks in parallel, the frame data of each group can be obtained quickly, thereby improving the generation efficiency of multiple video thumbnails.

[0085] Please see Figure 5 This application also provides a video thumbnail generation apparatus, the apparatus comprising:

[0086] The information acquisition module 110 is used to acquire target time point information and image group length information of the target video; wherein, the target time point information includes at least one target time point, and the target time point is the time point of the video thumbnail to be generated in the target video;

[0087] Grouping module 120 is used to divide the target video into several groups based on the at least one target time point and the image group length information; wherein each group includes at least one target time point;

[0088] The decoding module 130 is configured to, if the current group includes a first target time point and a second target time point, decode each video frame of the current group in a preset order until the first video frame is decoded, obtain the frame data of the first video frame, and decode the video frames after the first video frame until the second video frame is decoded, obtain the frame data of the second video frame; wherein, the first video frame is the video frame closest to the time point of the first target time point; and the second video frame is the video frame closest to the time point of the second target time point.

[0089] The decoding module 140 is used to acquire several frames of data from the several groups and generate video thumbnails based on the several frames of data.

[0090] In one embodiment, the decoding module 130 includes:

[0091] The keyframe acquisition unit is used to acquire the keyframes of the current group;

[0092] A frame data acquisition unit is used to decode the key frame and acquire the frame data of the key frame;

[0093] The decoding acquisition unit is used to decode video frames after the key frame in a preset order based on the frame data of the key frame, until the first video frame is decoded.

[0094] In one embodiment, the decoding module 130 is used to take the current video frame as the first video frame and obtain the frame data of the first video frame when the time difference between the current video frame time point and the first target time point is less than or equal to the time difference threshold.

[0095] The decoding module 130 is used to take the current video frame as the second video frame and obtain the frame data of the second video frame when the time difference between the current video frame time point and the second target time point is less than or equal to the time difference threshold.

[0096] In one embodiment, the decoding module 140 includes:

[0097] The task generation unit is used to generate the decoding task corresponding to each group.

[0098] The parallel execution unit is used to execute the decoding task in parallel to obtain the frame data corresponding to each group.

[0099] In one embodiment, the decoding module 130 is configured to, after decoding each video frame of the current group in a preset order, cache the decoded frame data in a target area; read the cached frame data from the target area; and decode the video frames after the first video frame based on the cached frame data.

[0100] It should be noted that the video thumbnail generation device provided in the above embodiments is only illustrated by the division of the above functional modules when executing the video thumbnail generation method. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the video thumbnail generation device provided in the above embodiments and the video thumbnail generation method in the above embodiments belong to the same concept, and its implementation process is detailed in the method embodiments, which will not be repeated here.

[0101] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the video thumbnail generation method as described in any of the preceding claims.

[0102] This application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0103] Please see Figure 6 This application also provides an electronic device 200, including a memory 210, a processor 220, and a computer program stored in the memory 210 and executable by the processor 220;

[0104] When the processor 220 executes the computer program, it implements the steps of the video thumbnail generation method as described in any of the above.

[0105] The memory 210 includes read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0106] The processor 220 is the control unit of the electronic device 200. It connects to various components of the electronic device 200 via various interfaces and lines. By running or executing programs or modules stored in the memory 210, and by calling data stored in the memory 210, it performs various functions and processes data for the electronic device 200. For example, when the processor 220 executes a computer program stored in the memory, it implements all or part of the steps of the video thumbnail generation method described in this application embodiment; or it implements all or part of the functions of the video thumbnail generation device. The processor 220 can be composed of integrated circuits, such as a single packaged integrated circuit, or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips.

[0107] This invention is not limited to the above-described embodiments. If any modifications or variations to this invention do not depart from the spirit and scope of this invention, and if such modifications and variations fall within the scope of the claims and equivalent technologies of this invention, then this invention also intends to include such modifications and variations.

Claims

1. A method for generating video thumbnails, characterized in that, Includes the following steps: Obtain target time point information and image group length information of target video; wherein, the target time point information includes at least one target time point, the target time point being the time point of the video thumbnail to be generated in the target video; Based on the at least one target time point and the image group length information, the target video is divided into several groups; wherein each group includes at least one target time point; If the current group includes a first target time point and a second target time point, each video frame of the current group is decoded in a preset order until the first video frame is decoded, and the frame data of the first video frame is obtained. Then, the video frames after the first video frame are decoded until the second video frame is decoded, and the frame data of the second video frame is obtained. Wherein, the first video frame is the video frame closest to the time point of the first target time point; the second video frame is the video frame closest to the time point of the second target time point. Acquire several frames of data from the aforementioned groups, and generate video thumbnails based on the aforementioned frames of data.

2. The video thumbnail generation method according to claim 1, characterized in that, Decoding each video frame of the current group in a preset order specifically includes: Get the keyframe of the current group; The keyframe is decoded to obtain the frame data of the keyframe; Based on the frame data of the key frame, the video frames following the key frame are decoded in a preset order until the first video frame is decoded.

3. The video thumbnail generation method according to claim 2, characterized in that, The keyframe is the keyframe that is closest to the time point of the first target time point.

4. The video thumbnail generation method according to claim 1, characterized in that, The specific steps for obtaining the frame data of the first video frame include: If the time difference between the current video frame and the first target time point is less than or equal to the time difference threshold, the current video frame is taken as the first video frame, and the frame data of the first video frame is obtained. The specific steps for obtaining the frame data of the second video frame include: If the time difference between the current video frame and the second target time point is less than or equal to the time difference threshold, the current video frame is used as the second video frame, and the frame data of the second video frame is obtained.

5. The video thumbnail generation method according to claim 1, characterized in that, The steps for obtaining several frames of data from the aforementioned groups specifically include: Generate the decoding task corresponding to each group; The decoding task is executed in parallel to obtain the frame data corresponding to each group.

6. The video thumbnail generation method according to claim 1, characterized in that, After decoding each video frame of the current group in a preset order, the following steps are also included: The decoded frame data is cached in the target area; The specific steps for decoding video frames following the first video frame include: Read cached frame data from the target region, and decode video frames after the first video frame based on the cached frame data.

7. The video thumbnail generation method according to claim 1, characterized in that, The video thumbnail generation method is applied to electronic devices; The steps of decoding each video frame of the current group in a preset order specifically include: Obtain the decoding component built into the electronic device; Using the decoding component, each video frame of the current group is decoded in a preset order.

8. A video thumbnail generation device, characterized in that, The device includes: The information acquisition module is used to acquire target time point information and image group length information of the target video; wherein, the target time point information includes at least one target time point, and the target time point is the time point of the video thumbnail to be generated in the target video; A grouping module is used to divide the target video into several groups based on the at least one target time point and the image group length information; wherein each group includes at least one target time point; The decoding module is configured to, if the current group includes a first target time point and a second target time point, decode each video frame of the current group in a preset order until the first video frame is decoded, obtain the frame data of the first video frame, and decode the video frames after the first video frame until the second video frame is decoded, obtain the frame data of the second video frame; wherein, the first video frame is the video frame closest to the time point of the first target time point; and the second video frame is the video frame closest to the time point of the second target time point. The decoding module is used to acquire several frames of data from the several groups and generate video thumbnails based on the several frames of data.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When executed by a processor, the computer program implements the steps of the video thumbnail generation method as described in any one of claims 1-7.

10. An electronic device, characterized in that, Includes a memory, a processor, and a computer program stored in the memory and executable by the processor; When the processor executes the computer program, it implements the steps of the video thumbnail generation method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Thumbnail generation method and related device

    CN110572723A

  • Thumbnail extraction method and device

    CN111147954A