Video thumbnail generation method and device, storage medium and equipment
By dividing the video into multiple packets and optimizing the decoding order, the problem of wasted computing resources and excessive generation time during video thumbnail generation in the prior art is solved, and more efficient video thumbnail generation is achieved.
Patent Information
- Application Number
- CN202311345967.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2043-10-17
AI Technical Summary
When generating multiple video thumbnails, existing video thumbnails are required to repeatedly decode video frames, resulting in wasted computing resources and excessive generation time.
By acquiring the target time point information and the image group length information, the target video is divided into several packets, each packet containing at least one target time point. When the current packet includes two target time points, the video frame corresponding to the first target time point is decoded first, and then continue to decode to the video frame corresponding to the second target time point, thereby avoiding repeated decoding.
Reduces the computing resource loss during video thumbnail generation, and improves the generation speed and efficiency.
Smart Images

Figure CN119854574A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video thumbnails, and in particular to a method, device, storage medium and equipment for generating video thumbnails. Background Art
[0002] Video thumbnails can be used to preview video content, making it easier for users to find and edit videos.
[0003] The existing method for generating video thumbnails is to first search for the key frame closest to the specified time point, start from the key frame, decode the next video frame until the video frame at the specified time point is decoded, and then render and generate a video thumbnail based on the frame data of the video frame. However, in the above method, each time a video thumbnail is generated, the above steps need to be repeated. When multiple video thumbnails need to be generated, a large amount of computing resources are required, and the video thumbnail generation time is long. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, storage medium and device for generating video thumbnails, which can improve the efficiency of generating video thumbnails.
[0005] In a first aspect, an embodiment of the present application provides a method for generating a video thumbnail, comprising the following steps:
[0006] Obtain target time point information and image group length information of a target video; wherein the target time point information includes at least one target time point, and the target time point is a time point in the target video when the video thumbnail to be generated occurs;
[0007] Based on the at least one target time point and the picture group length information, the target video is divided into a plurality of 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, decode each video frame of the current group in a preset order until the first video frame is decoded, and obtain frame data of the first video frame, and decode the video frames after the first video frame until the second video frame is decoded, and obtain frame data of the second video frame; wherein the first video frame is a video frame closest to the time point of the first target time point; and the second video frame is a video frame closest to the time point of the second target time point;
[0009] Acquire a plurality of frame data of the plurality of groups, and generate video thumbnails according to the plurality of frame data.
[0010] In a second aspect, an embodiment of the present application provides a video thumbnail generation device, the device comprising:
[0011] An information acquisition module, used to acquire target time point information and image group length information of a target video; wherein the target time point information includes at least one target time point, and the target time point is a time point in the target video when the video thumbnail to be generated occurs;
[0012] A grouping module, configured to divide the target video into a plurality of groups based on the at least one target time point and the picture group length information; wherein each group includes at least one target time point;
[0013] A decoding module, for, if the current group includes a first target time point and a second target time point, decoding each video frame of the current group in a preset order until the first video frame is decoded, obtaining frame data of the first video frame, decoding video frames after the first video frame until the second video frame is decoded, obtaining frame data of the second video frame; wherein the first video frame is a video frame closest to the time point of the first target time point; and the second video frame is a video frame closest to the time point of the second target time point;
[0014] The decoding module is used to obtain a plurality of frame data of the plurality of groups and generate a video thumbnail according to the plurality of frame data.
[0015] In a third aspect, an embodiment of the present application 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 one of the above.
[0016] In a fourth aspect, an embodiment of the present application provides 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, the steps of the video thumbnail generation method as described in any one of the above items are implemented.
[0018] In an embodiment of the present application, the target video is divided into several groups according to the image group length information of the target video and the target time point of the target video at the video thumbnail to be generated, so that each group includes at least one target time point. When the current group includes the first target time point and the 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, and then the video frame after the first video frame is decoded to obtain the frame data of the second video frame, thereby avoiding the need to restart decoding from the first video frame each time decoding, reducing the loss of computing resources, and improving the generation speed and efficiency of video thumbnails.
[0019] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a method for generating a video thumbnail in one embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of grouping target videos in one embodiment of the present invention;
[0022] Figure 3 is a flow chart of step S130 in one embodiment of the present invention;
[0023] Figure 4 is a flowchart of step S140 in another embodiment of the present invention;
[0024] Figure 5 A schematic diagram of the structure of a video thumbnail generating device in one embodiment of the present invention;
[0025] Figure 6 The figure is a schematic diagram of the structure of an electronic device in one embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0027] It should be clear that the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.
[0028] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0029] When the following description refers to the 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 the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.
[0030] In addition, in the description of this application, unless otherwise specified, "several" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0031] This application provides a method for generating a video thumbnail, which can be applied to electronic devices. Figure 1 The video thumbnail generation method of the present application specifically includes the following steps:
[0032] S110: Acquire target time point information and image group length information of a target video; the target time point information includes at least one target time point, and the target time point is a time point in the target video when a video thumbnail to be generated occurs;
[0033] In an embodiment of the present application, the target video needs to generate at least one video thumbnail, and each video thumbnail corresponds to a different target time point in the target video.
[0034] A Group of Pictures (GOP) refers to a group of continuous video images. A GOP usually includes a group of continuous video frames starting from a key frame and ending at the next key frame.
[0035] The picture group length information is used to determine the length of the picture group. The length of the picture group may be the number of frames between two key frames.
[0036] S120: Based on the at least one target time point and the picture group length information, divide the target video into a plurality of groups; wherein each group includes at least one target time point;
[0037] Specifically, when grouping, the target video can be grouped according to the image group length, or, in another embodiment, the target video can also be grouped according to at least one target time point and the image group length, so that each group includes at least one target time point.
[0038] In the embodiment of the present application, 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. The target video can be divided into 5 groups. The corresponding relationship between each group and the target time point 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, obtain frame data of the first video frame, and decode video frames after the first video frame until the frame data of the second video frame is obtained; wherein the first video frame is a video frame closest to the time point of the first target time point; and the second video frame is a video frame closest to the time point of the second target time point;
[0040] In the present application, each group includes at least one target time point. When the group includes only one target time point, each video frame of the current group is decoded in a preset order, and the frame data of the decoded video frame is obtained. 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 is ended.
[0041] When the grouping includes a first target time point and a second target time point, first decode each video frame of the current grouping in a preset order, obtain the frame data of the decoded video frame, and if the time point of the current video frame is closest to the first target time point, determine that the current video frame is the first video frame, and then continue to decode the video frames after the first video frame, instead of re-decoding from the first video frame, thereby reducing unnecessary decoding overhead. For video frames that have been decoded, directly reuse the previously decoded data, thereby effectively reducing the decoding time. When the time point of a certain video frame decoded is closest to the second target time point, determine that the video frame is the second video frame; wherein the first target time point is before the second target time point.
[0042] The time point of the video frame can be obtained by reading information such as the timestamp of the video frame.
[0043] The first video frame and the second video frame of the present application can be regarded as the video frames corresponding to the first target time point and the second target time point, that is, the video frames corresponding to the video thumbnails.
[0044] S140: Acquire a plurality of frame data of the plurality of groups, and generate video thumbnails according to the plurality of frame data.
[0045] Specifically, by decoding the video frame at the target time point of each group, the frame data of each group is obtained, and the frame data obtained after decoding can be directly used to generate a video thumbnail, so that multiple video thumbnails can be rendered and drawn according to the frame data of all groups of the target video. Among them, the acquisition of the frame data of each group can refer to the description of the above step S130 of this application.
[0046] In an embodiment of the present application, the target video is divided into several groups according to the image group length information of the target video and the target time point of the target video at the video thumbnail to be generated, so that each group includes at least one target time point. When the current group includes the first target time point and the 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, and then the frame data of the second video frame is obtained by decoding the video frames after the first video frame, thereby avoiding the need to start decoding from the first video frame each time frame data is obtained, reducing the loss of computing resources, and improving 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 can be started from the key frame of the current group, and the key frame and each subsequent video frame are decoded in turn to obtain the frame data of each video frame. The frame data can be edited and rendered, so that a corresponding video thumbnail can be generated based on the frame data.
[0048] Specifically, Figure 3 As shown, in one embodiment, obtaining the frame data of the first video frame specifically includes:
[0049] S131: Obtain the key frame of the current group;
[0050] S132: Decode the key frame to obtain 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 key frame refers to the most important frame in the video content, usually used to indicate the start frame or end frame of a shot in the video. A key frame usually contains the most representative content in the video, such as the turning point or climax of an action. A key frame can be used as an editing point to insert, delete or modify video content. A key frame can be a video frame obtained by pre-marking the video content by the user.
[0053] A key frame is usually a complete coded frame, which can be decoded without referring to other frame data. For other video frames, when decoding the video frames using a decoding algorithm, it is usually necessary to refer to the complete data of the previous frame for decoding. Therefore, in an embodiment of the present application, when decoding the grouped video frames, first find the key frame of the group, and then decode each video frame after the key frame until the first video frame is decoded.
[0054] The preset order is used to determine the next video frame to be decoded. In the present application, the preset order may be to decode the video frames in sequence.
[0055] When decoding the video frames of the target video, the existing decoding algorithms or existing decoding tools such as Webcodecs and MP4box can be used to obtain the frame data of the video frames; wherein the encoding algorithm can be determined according to the encoding and decoding protocol of the target video. For example, when the target video is encoded using the h264 protocol, the corresponding h264 protocol decoding algorithm can be used to decode it.
[0056] Preferably, the key frame of the present application can be the key frame 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 seek method of MP4box or other existing search algorithms to obtain the key frame that is closest to the time point of the first target time point, and then the key frame is decoded, thereby reducing the amount of decoded data and improving decoding efficiency.
[0057] The step of decoding each video frame of the current group according to a preset order specifically includes:
[0058] Acquire a decoding component built into the electronic device;
[0059] Utilizing the decoding component, each video frame of the current group is decoded in a preset order.
[0060] The decoding component may be a video codec built into the electronic device. The present application utilizes the decoding component built into the electronic device to decode the video frames, eliminating the need to load an additional decoding program, thereby effectively saving space and computing resources of the electronic device.
[0061] Preferably, in the embodiment of the present application, Webcodecs can be used to decode the target video. Webcodecs is a browser-based video codec, which can implement decoding and encoding of videos 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. Electronic devices no longer need to load additional decoding programs, which can effectively save computing resources of electronic devices.
[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. You can refer to the description of the above steps of this application and will not repeat them here.
[0063] In the present application, 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. When determining the first video frame and the second video frame, it can be determined whether the video frame is the video frame corresponding to the target time point based on the time difference between the time point of the current video frame and the target time point.
[0064] Specifically, the step of obtaining the frame data of the first video frame specifically includes:
[0065] If the time difference between the time point of 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 used as the first video frame, and frame data of the first video frame is obtained;
[0066] The step of obtaining the frame data of the second video frame specifically includes:
[0067] If the time difference between the time point of 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 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 time point of 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 of the current video frame continues until the first video frame is decoded; similarly, if there is a second target time point in the current group, after decoding the first video frame, the decoding of the video frames after the first video frame continues, and if the time difference between the time point of 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 of the current video frame continues until the second video frame is decoded.
[0070] In step S130, the decoded frame data can be stored in a cache area pre-set by the user. When the video frame needs to be decoded again, the frame data of the video frame in the cache area can be directly called, thereby eliminating the need to decode the video frame again, reducing the occupancy of computing resources and improving decoding efficiency.
[0071] Specifically, after decoding each video frame of the current group according to a preset order, the method further includes the following steps:
[0072] Cache the decoded frame data in the target area;
[0073] The step of decoding the video frame after the first video frame specifically includes:
[0074] The cached frame data is read from the target area, and the video frames subsequent to the first video frame are decoded based on the cached frame data.
[0075] The target area may be an area set by a user for caching frame data.
[0076] In an embodiment of the present application, by caching the frame data obtained after decoding in the target area, when the video frames after the first video frame need to be decoded, the frame data of the previous video frame can be directly called from the target area, thereby eliminating the need to decode the already decoded video frames again, thereby reducing the decoding time and improving the decoding efficiency.
[0077] Preferably, a corresponding decoding task may be generated for each group, and frame data of each group may be quickly obtained by executing multiple decoding tasks simultaneously, thereby improving the efficiency of generating video thumbnails.
[0078] like Figure 4 As shown, specifically, the step of obtaining the plurality of frame data of the plurality of groups specifically includes:
[0079] S141: Generate a decoding task corresponding to each group;
[0080] S142: Execute the decoding tasks in parallel to obtain 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 executed in parallel can be determined based on the computing resources of the electronic device, and specifically can be the maximum number of tasks that the electronic device can execute. For example, if the maximum number of tasks that can be executed supported by the computing resources of the current electronic device is 5, then 5 decoding tasks are executed in parallel, and the order of execution of each decoding task can be set according to user needs.
[0083] In another embodiment, the number of tasks executed in parallel may also be determined according to the number of groups, or, in other embodiments, the number of tasks executed in parallel may also be determined according to the computing resources of the electronic device and the number of groups.
[0084] In the embodiment of the present application, a decoding task corresponding to each group is generated, and the frame data of each group is quickly obtained by executing the decoding tasks in parallel, thereby improving the generation efficiency of multiple video thumbnails.
[0085] See also Figure 5 The embodiment of the present application also provides a video thumbnail generation device, the device comprising:
[0086] The information acquisition module 110 is used to acquire target time point information and image group length information of a 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] A grouping module 120, configured to divide the target video into a plurality of groups based on the at least one target time point and the picture group length information; wherein each group includes at least one target time point;
[0088] The decoding module 130 is used for, if the current group includes a first target time point and a second target time point, decoding each video frame of the current group in a preset order until the first video frame is decoded, obtaining frame data of the first video frame, decoding video frames after the first video frame until the second video frame is decoded, obtaining frame data of the second video frame; wherein the first video frame is a video frame closest to the time point of the first target time point; and the second video frame is a video frame closest to the time point of the second target time point;
[0089] The decoding module 140 is used to obtain the plurality of frame data of the plurality of groups, and generate a video thumbnail according to the plurality of frame data.
[0090] In one embodiment, the decoding module 130 includes:
[0091] A key frame acquisition unit, used to acquire the key frame of the current group;
[0092] A frame data acquisition unit, used for decoding the key frame to acquire frame data of the key frame;
[0093] The decoding acquisition unit is used to decode the 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, when the time difference between the time point of the current video frame and the first target time point is less than or equal to the time difference threshold, take the current video frame as the first video frame and obtain frame data of the first video frame;
[0095] The decoding module 130 is used to use the current video frame as the second video frame and obtain frame data of the second video frame when the time difference between the time point of the current video frame 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] A task generation unit, used to generate a decoding task corresponding to each group;
[0098] The parallel execution unit is used to execute the decoding tasks in parallel to obtain frame data corresponding to each group.
[0099] In one embodiment, the decoding module 130 is used to cache the decoded frame data in a target area after decoding each video frame of the current group in a preset order; 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 embodiment only uses the division of the above functional modules as an example when executing the video thumbnail generation method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is 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 embodiment and the video thumbnail generation method in the above embodiment belong to the same concept. The implementation process is detailed in the method embodiment and will not be repeated here.
[0101] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the video thumbnail generation method as described in any one of the above are implemented.
[0102] The present 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 achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0103] See also Figure 6 , the present application also provides an electronic device 200, comprising 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, the steps of the video thumbnail generation method as described in any one of the above items are implemented.
[0105] The memory 210 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0106] The processor 220 is the control core (Control Unit) of the electronic device 200. It uses various interfaces and lines to connect the various components of the entire electronic device 200, and executes various functions and processes data of the electronic device 200 by running or executing the program or module stored in the memory 210, and calling the data stored in the memory 210. For example, when the processor 220 executes the computer program stored in the memory, it implements all or part of the steps of the video thumbnail generation method described in the embodiment of the present application; or implements all or part of the functions of the video thumbnail generation device. The processor 220 can be composed of an integrated circuit, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips.
[0107] The present invention is not limited to the above-mentioned embodiments. If various changes or modifications to the present invention do not depart from the spirit and scope of the present invention, and if these changes and modifications fall within the scope of the claims and equivalent technologies of the present invention, the present invention is also intended to include these changes and modifications.
Claims
1. A method for generating a video thumbnail, characterized in that: The following steps are involved: Obtain target time point information and image group length information of a target video; wherein the target time point information includes at least one target time point, and the target time point is a time point in the target video when the video thumbnail to be generated occurs; Based on the at least one target time point and the picture group length information, the target video is divided into a plurality of 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, decode each video frame of the current group in a preset order until the first video frame is decoded, and obtain frame data of the first video frame, and decode the video frames after the first video frame until the second video frame is decoded, and obtain frame data of the second video frame; wherein the first video frame is a video frame closest to the time point of the first target time point; and the second video frame is a video frame closest to the time point of the second target time point; Acquire a plurality of frame data of the plurality of groups, and generate video thumbnails according to the plurality of frame data.
2. The video thumbnail generation method according to claim 1, characterized in that: Decoding each video frame of the current group according to a preset order specifically includes: Get the key frame of the current group; Decoding the key frame to obtain frame data of the key frame; Based on the frame data of the key frame, the video frames after 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 key frame is a key frame 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 step of obtaining the frame data of the first video frame specifically includes: If the time difference between the time point of 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 used as the first video frame, and frame data of the first video frame is obtained; The step of obtaining the frame data of the second video frame specifically includes: If the time difference between the time point of 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 frame data of the second video frame is obtained.
5. The video thumbnail generation method according to claim 1, characterized in that: The step of obtaining the plurality of frame data of the plurality of groups specifically includes: Generate a decoding task corresponding to each group; The decoding tasks are executed in parallel to obtain 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 according to a preset order, the following steps are also included: Cache the decoded frame data in the target area; The step of decoding the video frame after the first video frame specifically includes: The cached frame data is read from the target area, and the video frames subsequent to the first video frame are decoded 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 step of decoding each video frame of the current group according to a preset order specifically includes: Acquire a decoding component built into the electronic device; Utilizing 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 comprises: An information acquisition module, used to acquire target time point information and image group length information of a target video; wherein the target time point information includes at least one target time point, and the target time point is a time point in the target video when the video thumbnail to be generated occurs; A grouping module, configured to divide the target video into a plurality of groups based on the at least one target time point and the picture group length information; wherein each group includes at least one target time point; A decoding module, for, if the current group includes a first target time point and a second target time point, decoding each video frame of the current group in a preset order until the first video frame is decoded, obtaining frame data of the first video frame, decoding video frames after the first video frame until the second video frame is decoded, obtaining frame data of the second video frame; wherein the first video frame is a video frame closest to the time point of the first target time point; and the second video frame is a video frame closest to the time point of the second target time point; The decoding module is used to obtain a plurality of frame data of the plurality of groups and generate a video thumbnail according to the plurality of frame data.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the video thumbnail generation method as described in any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: comprising a memory, a processor, and a computer program stored in the memory and executable by the processor; When the processor executes the computer program, the steps of the video thumbnail generation method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Thumbnail generation method and related device
CN110572723A
Thumbnail extraction method and device
CN111147954A
Video frame extraction method and device, electronic equipment and computer readable storage medium
CN111405288A
Video acquisition method and device and electronic equipment
CN112738418A
Method and apparatus for thumbnail generation for a video device
WO2022149156A1