Video generation method, electronic equipment and storage medium

By splitting and filtering the original video frames and combining similar video frames in the media library to quickly generate multiple videos, the time-consuming and labor-intensive problem of traditional video production methods is solved, and the video production efficiency and relevance are improved.

CN119893207AActive Publication Date: 2025-04-25GUANGZHOU LAILA SMART TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510118607.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-04-25
Estimated Expiration
2045-01-24

AI Technical Summary

Technical Problem

Traditional video production methods are time-consuming and labor-intensive, and cannot quickly generate multiple videos in a short time, and cannot meet the needs of e-commerce product promotion and marketing.

Method used

By splitting the original video frames, filtering out the target video frames, and searching for similar video frames in the media library to form a collection of material frames, and finally merging and generating a new video.

Benefits of technology

It realizes the rapid generation of multiple videos, improves the efficiency of video production, and the video content is highly correlated with the topic, reducing the time and labor cost of video production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119893207A_ABST
    Figure CN119893207A_ABST
Patent Text Reader

Abstract

The invention provides a video generation method, electronic equipment and a storage medium. The video generation method comprises the following steps: S1, obtaining a video frame set, wherein the video frame set is each video frame contained in an original video; s2, according to a keyword, a picture or a video, a target frame set is screened out from the video frame set, the target frame set comprises at least one target video frame, and the target video frame comprises a target object determined based on the keyword, the picture or the video; s3, in a media library, searching a corresponding similar video frame according to each target video frame to obtain a plurality of material frame sets, each material frame set comprising one target video frame and at least one similar video frame; and S4, respectively selecting the target video frame and / or the similar video frame from each material frame set, and combining to generate at least one new video. According to the invention, a plurality of videos can be quickly generated based on a certain video, and the video production efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video processing, and more specifically, to a video generation method, electronic equipment and storage medium. Background Art

[0002] With the rapid development of the e-commerce industry, market competition is becoming increasingly fierce. Merchants need to use various means to attract consumers' attention and increase product exposure and sales. The rise of social media and short video platforms such as Douyin, Kuaishou, and Xiaohongshu has provided new channels for e-commerce product promotion. These platforms have a huge user base and concentrated traffic. By producing video content suitable for these platforms, the exposure and communication effect of products can be effectively improved. As an intuitive and vivid way of display, short videos can better attract consumers' interest and increase their willingness to buy. Therefore, e-commerce product promotion videos have become an inevitable choice for merchants.

[0003] However, e-commerce product promotion videos need to be generated efficiently and quickly to meet the needs of promotion and marketing. Traditional video production methods are time-consuming and labor-intensive, and it is impossible to produce multiple videos in a short period of time. Summary of the invention

[0004] In order to overcome the technical problems existing in the above-mentioned prior art, the present invention provides a video generation method, an electronic device and a storage medium, which can generate videos efficiently and quickly, thereby improving the efficiency of video production.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: In a first aspect, the present invention provides a video generation method, comprising the following steps: S1. Obtaining a video frame set, wherein the video frame set is each video frame contained in the original video; S2. According to a keyword, picture or video, a target frame set is selected from the video frame set, wherein the target frame set includes at least one target video frame, and the target video frame includes a target object determined based on the keyword, picture or video; S3. In the media library, searching for a corresponding similar video frame according to each of the target video frames to obtain a plurality of material frame sets, the material frame set comprising one of the target video frames and / or at least one similar video frame; S4. Select target video frames and / or similar video frames from each material frame set respectively, and merge them to generate at least one new video.

[0006] In the technical solution of the present invention, the original video is first split into multiple video frames to obtain a video frame set, and then the video frames in the video frame set are screened according to keywords, pictures or videos, and the target video frames containing the target objects are extracted to form a target frame set, so that video clips related to the target object (i.e., keywords) can be quickly obtained.

[0007] Secondly, by searching for similar video frames in the media library, similar video frames containing the target object can be obtained. The scenes of the similar video frames can be the same or similar to the scenes of the original video, or different. These similar video frames constitute a material frame set, and each target video frame corresponds to a material frame set, thereby obtaining multiple material frame sets, each of which contains at least one similar video frame.

[0008] Finally, target video frames and / or similar video frames are selected from each set of material frames, and these video frames are combined to generate at least one new video. Generally, the selected video frames are arranged and combined according to the order in which the target video frames appear in the original video, and multiple new videos are generated by merging.

[0009] Through the above technical solution, the present invention can quickly generate multiple videos based on a certain video, thereby improving the efficiency of video production, and the videos are highly relevant to the subject.

[0010] The video frame described in the present invention refers to: the smallest unit of a video, which is a static image; for example, when playing video information, a picture frozen at any moment is a video frame.

[0011] The (video) scene in the present invention means that a video is usually composed of shots of different (video) scenes, and the video content usually changes continuously in each shot. Generally, each shot represents a (video) scene, and in each (video) scene, the display of the target object (such as a product) changes continuously, but the environment and background of the target object are usually the same or similar.

[0012] In S1, the video frame set may be single or multiple; frames are extracted from different original videos respectively to obtain multiple video frame sets.

[0013] When the present invention performs screening and searching based on keywords, pictures or videos, for the method of using keywords, a method of directly performing keyword search by matching text annotations with keywords can be used, or keywords can be converted into pictures representing the keywords, and the pictures are used for comparison. For the method of using videos, the first video frame of the video is first extracted, and the first video frame is used for comparison. Preferably, pictures are used for screening and searching.

[0014] Optionally, in S2, the method of filtering out a target frame set from the video frame set includes: When keywords are used, the target video frame can be searched from the video frame set by using text annotation and keyword matching methods, or by using image recognition and keyword association methods; when pictures are used, one or more methods of feature extraction and matching, image segmentation and comparison, and template matching are used to compare the picture with each video frame in the video frame set, and output the target video frame.

[0015] Optionally, in S3, the media library is a video library stored locally, on the Internet, on a mobile network, or in other cloud locations.

[0016] Generally, the target video frames in the target frame set are arranged in the order in which they appear in the original video.

[0017] Optionally, in S3, the method for searching for corresponding similar video frames according to each of the target video frames includes: obtaining the video to be searched from the media library, performing frame extraction on the video to be searched, and obtaining the video frame to be searched; comparing the target video frame with each of the video frames to be searched, and obtaining similar video frames; the comparison method is one or more of feature extraction and matching, image segmentation and comparison, and template matching. By combining multiple comparison methods, the accuracy of the comparison can be improved.

[0018] In the present invention, the principles and steps of the comparison method adopted are as follows: The text annotation is matched with keywords: first, the video frame is annotated with text, including information such as character dialogue, scene description, action, and object, and then the annotated text is searched according to the keyword to find the video frame containing the keyword as the target video frame. In addition, for the search of similar video frames, the text similarity calculation method (such as cosine similarity) can be used to calculate the similarity between the text annotation of the target video frame and the text annotation of other video frames, and the video frame with high similarity is found as the similar video frame.

[0019] The image recognition is associated with keywords: using image recognition technology to identify objects, scenes, people and other elements in video frames, and associate these recognition results with keywords. For example, if the keyword is "flowers", then video frames containing flowers can be filtered as target video frames. In addition, by comparing the features, colors, shapes and other attributes of objects in different video frames, feature matching algorithms (such as SIFT and SURF) can be used to extract feature points in video frames, and match and compare them to find similar video frames.

[0020] The feature extraction and matching: extract key features (such as color histogram, texture features, shape features, etc.) from the target video frame, and use the same feature extraction method to extract the features of each video frame in the video frame to be searched, and match them with the key features of the target video frame, and select the video frame to be searched with high feature similarity as the similar video frame. In addition, a feature matching algorithm (such as FLANN) can be used to speed up the search.

[0021] The image segmentation and comparison: segment the target video frame to obtain multiple regions, then perform the same segmentation in the video frame to be searched, compare the features (such as color, texture, etc.) of each region, and select similar video frames to be searched as similar video frames based on the similarity of the regional features.

[0022] Template matching: the target video frame is used as a template, and template matching is performed in the video frame to be searched. By calculating the similarity between the template and the video frame to be searched, the video frame to be searched with high similarity is selected as the similar video frame. Template matching can use a variety of algorithms (such as square difference matching, normalized cross correlation, etc.).

[0023] The similar video frame is a video frame whose similarity with the target video frame is greater than a set threshold.

[0024] Optionally, the material frame set includes at least one similar video frame; or, if no similar video frame is found, the material frame set includes one target video frame; or, the material frame set includes one target video frame and at least one similar video frame.

[0025] Optionally, in S4, the selection is manual selection or automatic random selection. The automatic random selection is to select similar video frames from each material frame set at random to combine and merge to generate multiple new videos.

[0026] In order to avoid the scene switching of the video being too frequent in a short period of time and giving the viewer a noticeable sense of disconnection, the smoothness of the video is improved, that is, the smoothness of the transition between video frames is enhanced. The present invention provides the following implementation modes: As one implementation method, in S4, the selection method includes: determining the first video frame, sorting similar video frames in the next material frame set according to the scene similarity with the first video frame, and selecting one of the similar video frames with higher scene similarity and ranked in the top m as the second video frame; repeating this step, determining the nth video frame, sorting similar video frames in the n+1th material frame set according to the scene similarity with the nth video frame, and selecting one of the similar video frames with higher scene similarity and ranked in the top m as the n+1th video frame; until the last video frame is selected. n is an integer greater than or equal to 1.

[0027] The m can be preset. m is an integer greater than or equal to 1; optionally, m is 1, 2, 3, 4, 5, 6, 7 or 8.

[0028] By controlling the scene similarity of adjacent video frames and combining video frames with high scene similarity, the new video generated by the merger can reduce the sense of video fragmentation and improve the smoothness of the transition between video frames.

[0029] Further, in S4, the selection method includes: determining the first video frame, comparing the similar video frame in the next material frame set with the first video frame, obtaining the similar video frame with the highest scene similarity to the first video frame, and selecting it as the second video frame; repeating this step, determining the nth video frame, comparing the similar video frame in the n+1th material frame set with the nth video frame, obtaining the similar video frame with the highest scene similarity to the nth video frame, and selecting it as the n+1th video frame; until the last video frame is selected. Through the above technical solution, a new video with the highest smoothness can be obtained.

[0030] Optionally, when determining the first video frame to be selected, the first video frame is selected by random selection or selection based on the degree of scene similarity. A similar video frame with low scene similarity is selected as the first video frame, and the newly generated video is significantly different from the original video in scene, thereby improving the difference of the new video.

[0031] The number of new videos can be set according to a preset number value. Optionally, in S4, multiple new videos are merged and generated according to the preset number value.

[0032] E-commerce product promotion videos need to be generated efficiently and quickly to meet the needs of large-scale marketing. On the one hand, in the early stages of product promotion, merchants cannot know which promotional video will attract more consumers, so they often produce multiple promotional / introduction videos for the same product. On the other hand, agents or sellers of the same product will reprocess the promotional / introduction videos provided by the product manufacturer, extract the required video content, and produce different promotional videos. In either case, traditional video production methods are time-consuming and labor-intensive, and it is impossible to produce multiple videos in a short period of time.

[0033] In view of the above problems, the present invention provides a method for batch generating videos. The video generation method of the present invention can be applied to the production of commodity videos, such as e-commerce product introduction videos. Starting from a product video, the target video frame is extracted, and similar video frames of the same product are found. Similar video frames of different scenes can be selected. The scene of the original video is replaced with a new scene.

[0034] Alternatively, based on a product introduction video, by adopting the technical solution of the present invention, it can be split into multiple product introduction videos. By adopting the technical solution of the present invention, it is possible to avoid directly copying other people's videos, greatly increasing the originality of the video.

[0035] In a second aspect, the present invention provides an electronic device. The electronic device includes at least one memory and at least one processor; the at least one memory is coupled to the at least one processor, the at least one memory is used to store a computer program, the at least one processor is used to call the computer program, the computer program includes instructions, and when the instructions are executed by the at least one processor, the electronic device executes the video generation method described in the first aspect.

[0036] In a third aspect, the present invention provides a computer storage medium, wherein the computer storage medium includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the video generation method in the first aspect.

[0037] Compared with the prior art, the present invention has the following beneficial effects: The present invention mainly extracts target video frames from original videos, finds similar video frames based on the target video frames, and classifies them to obtain multiple material frame sets, and then merges the multiple material frame sets to generate new videos. The present invention can achieve faster generation of multiple videos, improve video production efficiency, and the video content is highly relevant to the target object. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flowchart of the video generation method described in an embodiment of the present application.

[0039] Figure 2 This is a schematic diagram of obtaining a set of video frames from a video in step S1 of an embodiment of the present application.

[0040] Figure 3 This is a schematic diagram of selecting a target frame set from a video frame set in step S2 of an embodiment of the present application.

[0041] Figure 4 This is a schematic diagram of obtaining a material frame set in step S3 of an embodiment of the present application.

[0042] Figure 5 This is a schematic diagram of step S4 of an embodiment of the present application, in which video frames are selected from a set of material frames and merged to generate a new video.

[0043] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0045] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more. The number of video frames included in the video is listed in the text for the convenience of example only, which may be more or less than the actual number and should not be regarded as a limitation on the technical solution.

[0046] Figure 1 is a flow chart of a video generation method of this embodiment, and the video generation method may include the following steps: Step S1, obtaining a video frame set, where the video frame set is each video frame contained in the original video.

[0047] Before obtaining a set of video frames, first obtain the original video that needs to be processed and fissioned, as follows: For example, a URL (Uniform Resource Locator) corresponding to the original video is input into the electronic device, and then the electronic device can download the original video from the corresponding resource server according to the URL for processing. Alternatively, the electronic device can obtain the stored video from the memory as the original video for processing in response to the request, and the present embodiment does not limit the method for obtaining the original video.

[0048] The video frame set may be single or multiple; for multiple original videos, frames are extracted from different original videos respectively to obtain multiple video frame sets.

[0049] like Figure 2 As shown, a single original video is subjected to frame extraction and split into multiple video frames, which are used to form a video frame set to obtain a video frame set.

[0050] For example, if an original video to be processed contains 20 video frames, frame extraction is performed on the video to obtain 20 video frames, that is, 20 static images (pictures), forming a video frame set.

[0051] Step S2: Filter out a target frame set from the video frame set according to keywords, pictures or videos.

[0052] When filtering and searching by keywords, pictures or videos, for the method of using keywords, the keyword search can be directly performed by matching text annotations with keywords, or the keywords can be converted into pictures representing the keywords and the pictures are used for comparison. For the method of using videos, the first video frame of the video will be extracted first and the first video frame will be used for comparison.

[0053] When keywords are used, a text annotation and keyword matching method, or an image recognition and keyword association method may be used to search for a target video frame from the video frame set.

[0054] When a picture is used, one or more methods of feature extraction and matching, image segmentation and comparison, and template matching are used to compare the picture with each video frame in the video frame set, and the target video frame is output.

[0055] As one of the embodiments, a keyword search and screening method is used, such as Figure 3 As shown, the keyword is first converted into a picture 1 representing the keyword through an algorithm or artificial intelligence model recognition. For example, if the keyword is a water cup, the keyword is converted into a picture representing the water cup, that is, picture 1 presents an image of a water cup.

[0056] According to the comparison between picture 1 and each video frame in the video frame set, the video frame containing the water cup is screened out as the target video frame, and the target video frame is output. For example, the video frame set has 10 video frames, among which the second video frame, the third video frame, the fourth video frame and the eighth video frame all contain the target object of the water cup, then the second video frame, the third video frame, the fourth video frame and the eighth video frame are taken as the target video frames, and the target video frames are output. Therefore, the target frame set screened out from the video frame set includes the second video frame, the third video frame, the fourth video frame and the eighth video frame.

[0057] As a second embodiment, a method of image search and screening is adopted, for example, Picture 2, Picture 2 is an image of a teapot, that is, the teapot is the target object. The video frame set is directly compared with Picture 2, and the video frames containing the teapot are screened out as target video frames according to the comparison between Picture 2 and each video frame in the video frame set, and the target video frames are output. For example, the video frame set has 20 video frames, of which the 1st to 5th video frames and the 12th to 15th video frames all contain the target object of the teapot, then the 1st to 5th video frames and the 12th to 15th video frames are used as target video frames, and the target video frames are output. Therefore, the target frame set screened out from the video frame set includes the 1st to 5th video frames and the 12th to 15th video frames.

[0058] As a third embodiment, the video search and screening method is adopted. First, the first video frame of the video is extracted, and the first video frame is used for comparison. For example, the first video frame extracted from the video is picture 3, and picture 3 may contain one object or multiple objects. If picture 3 contains multiple objects, multiple objects are used as target objects. For example, picture 3 contains a water cup and a teapot, and the water cup and the teapot are used as target objects. Picture 3 is compared with each video frame in the video frame set, and the video frame containing the water cup and / or the teapot is screened out as the target video frame, and the target video frame is output. For example, the video frame set has 20 video frames, of which the 1st to 3rd video frames contain a water cup, the 10th to 13th video frames contain a teapot, and the 16th to 20th video frames contain both a water cup and a teapot. Then the 1st to 3rd video frames, the 10th to 13th video frames, and the 16th to 20th video frames are used as target video frames, and the target video frames are output. Therefore, the target frame set selected from the video frame set includes the 1st to 3rd video frames, the 10th to 13th video frames, and the 16th to 20th video frames.

[0059] Step S3, such as Figure 4 As shown, in the media library, a corresponding similar video frame is searched for each target video frame to obtain a plurality of material frame sets, wherein the material frame sets include one target video frame and / or at least one similar video frame.

[0060] The media library is a video library stored locally, on the Internet, in a mobile network or in other cloud storages. As one embodiment, the media library is a video library stored locally, and the local refers to an electronic device executing the video generation method or a server or storage in the same local area network as the electronic device.

[0061] The method for searching for corresponding similar video frames according to each target video frame includes: obtaining a video to be searched from a media library, performing frame extraction on the video to be searched, and obtaining a video frame to be searched; comparing the target video frame with each video frame to be searched, and obtaining similar video frames; the comparison method is one or more of feature extraction and matching, image segmentation and comparison, and template matching.

[0062] For example, the target frame set contains 20 target video frames, and the local media library has 3 videos. The target video frames in the target frame set are arranged in the order in which they appear in the original video. The search starts from the first target video frame in the target frame set, and the first target video frame is used as the target to search the three videos in the media library in turn. When searching the video, the video to be compared is decomposed into multiple video frames, and the decomposed video frames are compared with the first target video frame one by one. The video frames whose similarity with the target video frame is greater than the set threshold (for example, the interval value is 0-100%, the higher the value, the higher the similarity) are selected as similar video frames, and the obtained similar video frames are classified into the first material frame set. Further, depending on the situation, the first target video frame can be put into the first material frame set.

[0063] In this way, the video frames included in the first material frame set will have the following conditions: In the first case, the material frame set contains at least one similar video frame; In the second case, no similar video frame is found in the three videos in the local media library, and the material frame set includes a target video frame, namely, the first target video frame, which is used for subsequent combination with the video frame; In a third case, the material frame set includes the first target video frame and at least one similar video frame.

[0064] Taking the first case as an example, if the first video in the local media library contains 20 video frames A1~A20, of which A1, A2, and A3 are similar video frames; the second video contains 16 video frames B1~16, of which B5, B6, B10, and B11 are similar video frames; the third video contains 25 video frames C1~25, and no similar video frames are found; therefore, the first material frame set contains similar video frames such as A1, A2, A3, B5, B6, B10, and B11.

[0065] Next, the second target video frame is used as the target, and the three videos in the media library are searched in sequence to obtain the second material frame set. The similar video frames in the second material frame set may be partially the same as the similar video frames in the first material frame set, or may be completely different.

[0066] Next, taking the third target video frame as the target, the three videos in the media library are searched in sequence to obtain the third material frame set.

[0067] This process is repeated until the last target video frame, that is, the 20th target video frame, is taken as the target, and the 20th material frame set is obtained.

[0068] After step S3, 20 material frame sets are obtained based on the target frame set (including 20 target video frames). Among the 20 material frame sets, some material frame sets include multiple similar video frames, some material frame sets include only one similar video frame, and some material frame sets do not include similar video frames but only corresponding target video frames.

[0069] Step S4: select target video frames and / or similar video frames from each material frame set respectively, and merge them to generate at least one new video.

[0070] The first implementation mode: manually selecting target video frames and / or similar video frames from each material frame set, and merging the selected similar video frames to generate a new video.

[0071] For example, Figure 5 As shown, after step S3, 4 material frame sets are obtained, the first material frame set includes similar video frames such as A1, A2, A3, A4, the second material frame set includes similar video frames such as B1, B2, B3, B4, the third material frame set includes similar video frames such as C0, C1, C2, C3, C4, and the fourth material frame set includes similar video frames such as D0, D1, D2, D3, D4, among which C0 and D0 are target video frames.

[0072] The four video frames A1, B2, C3, and D4 are manually selected and merged to generate the first new video.

[0073] You can continue to select the four video frames A1, B1, C2, and D2, and merge them to generate the second new video.

[0074] You can continue to select the four video frames A3, B4, C0, and D0, and merge them to generate the third new video.

[0075] Repeat this process to get other new videos.

[0076] Since the materials for making videos have been classified and organized, video producers only need to select video frames from the material frame set to merge and generate a video, which improves the efficiency of video production and saves time.

[0077] The second implementation method: using automatic random selection can further improve efficiency and save time.

[0078] Automatic random selection is to select similar video frames from each material frame set to combine and generate multiple new videos. The number of new videos can be set according to the preset number value. For example, if the preset number value is 10, 10 new videos will be output.

[0079] A third implementation method is as follows: manually or automatically randomly select the first video frame from the first material frame set, determine the selected first video frame, sort similar video frames in the next material frame set according to the scene similarity with the first video frame, and select one of the similar video frames with higher scene similarity and ranked in the top m as the second video frame; repeat this step to determine the selected nth video frame, sort similar video frames in the n+1th material frame set according to the scene similarity with the nth video frame, and select one of the similar video frames with higher scene similarity and ranked in the top m as the n+1th video frame; until the last video frame is selected.

[0080] n is an integer greater than or equal to 1. m can be preset. m is an integer greater than or equal to 1, and m can be selected from 1, 2, 3, 4, 5, 6, 7 or 8.

[0081] For example, after step S3, 8 material frame sets are obtained, and the first video frame is manually selected or automatically randomly selected. After determining the first video frame, the similar video frames in the second material frame set are sorted according to the scene similarity with the first video frame, and one of the similar video frames with higher scene similarity and ranked in the top 4 is randomly selected as the second video frame. After determining the second video frame, the similar video frames in the third material frame set are sorted according to the scene similarity with the second video frame, and one of the similar video frames with higher scene similarity and ranked in the top 4 is randomly selected as the third video frame. Repeat this process until the eighth video frame is selected. Based on the obtained 8 video frames, merge and generate a new video.

[0082] Next, while the first selected video frame remains unchanged (the same first video frame), one of the top 4 similar video frames with higher scene similarity is randomly selected from the second material frame set as the second video frame. Similarly, one of the top 4 similar video frames with higher scene similarity is randomly selected from the third material frame set as the third video frame; this is repeated until the eighth video frame is selected. The eight video frames are merged again to generate the second new video.

[0083] Repeat the above steps to generate the third new video and the fifth new video in sequence until the preset number of new videos is reached; or because the number of similar video frames in the material frame set is small, the content of the generated video repeats the content of the previous video, and the generation of new videos is stopped. By controlling the scene similarity of adjacent video frames and combining video frames with high scene similarity, the sense of fragmentation of these 8 new videos and the smoothness of the transition between video frames are better than those of videos generated by random merging.

[0084] The fourth implementation method is as follows: from the first material frame set, determine to select the first video frame, compare the similar video frames in the next material frame set with the first video frame, obtain the similar video frame with the highest scene similarity to the first video frame, and select it as the second video frame; repeat this step to determine the selected nth video frame, compare the similar video frames in the n+1th material frame set with the nth video frame, obtain the similar video frame with the highest scene similarity to the nth video frame, and select it as the n+1th video frame; until the last video frame is selected.

[0085] For example, after step S3, 8 material frame sets are obtained, and the first video frame is selected manually or automatically and randomly. After determining the first video frame, the similar video frames in the second material frame set are compared with the first video frame, and the similar video frame with the highest scene similarity to the first video frame is obtained according to the scene similarity with the first video frame, and is selected as the second video frame; after determining the second video frame, the similar video frame with the highest scene similarity to the second video frame is obtained from the third material frame set according to the scene similarity with the second video frame, and is selected as the third video frame; and this is repeated until the eighth video frame is selected. Based on the obtained 8 video frames, a new video is generated by merging. Through the above implementation, only a new video is obtained, but the smoothness of the transition between the video frames of this new video should be the best, and the sense of fragmentation should be the lowest.

[0086] The fifth implementation method: Determine to select the first video frame from the first material frame set. When determining the first video frame, the method for selecting the first video frame is to select according to the degree of scene similarity. Select a similar video frame with low scene similarity as the first video frame. After determining the first video frame, adopt the method of the third or fourth implementation method to select the second video frame and the third video frame in turn until the last video frame is selected. Merge to generate a new video. The generated new video has a large difference in scene from the original video, which improves the difference of the new video.

[0087] On the contrary, when determining the first video frame, a video frame with high scene similarity may be selected as the first video frame.

[0088] Based on the same inventive concept as the above-mentioned video generation method embodiment, an electronic device is also provided in the embodiment of the present application.

[0089] like Figure 6As shown, a specific structural block diagram of an electronic device 100, the electronic device 100 includes: at least one memory 101, and at least one processor 102; the at least one memory 101 is coupled to the at least one processor 102, the at least one memory 101 is used to store a computer program, the at least one processor 102 is used to call the computer program, the computer program includes instructions, and when the instructions are executed by the at least one processor, the electronic device executes the above-mentioned video generation method.

[0090] Based on the same inventive concept as the above-mentioned video generation method and electronic device embodiments, a computer storage medium is also provided in the embodiments of the present application.

[0091] The following describes a computer storage medium containing the above-mentioned video generation method.

[0092] A computer storage medium includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned video generation method.

[0093] The electronic device 100 and computer storage medium provided in this embodiment belong to the same concept as the above-mentioned video generation method. The specific implementation process is detailed in the full text of the specification and will not be repeated here.

[0094] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A video generation method, characterized in that: The following steps are involved: S1. Obtaining a video frame set, wherein the video frame set is each video frame contained in the original video; S2. According to a keyword, picture or video, a target frame set is selected from the video frame set, wherein the target frame set includes at least one target video frame, and the target video frame includes a target object determined based on the keyword, picture or video; S3. In the media library, searching for a corresponding similar video frame according to each of the target video frames to obtain a plurality of material frame sets, the material frame set comprising one of the target video frames and / or at least one similar video frame; S4. Select target video frames and / or similar video frames from each material frame set respectively, and merge them to generate at least one new video.

2. The video generation method according to claim 1, characterized in that: In S2, the method for filtering out a target frame set from the video frame set includes: when using keywords, a text annotation and keyword matching method, or an image recognition and keyword association method can be used to search for target video frames from the video frame set; when using pictures, one or more methods of feature extraction and matching, image segmentation and comparison, and template matching are used to compare the pictures with each video frame in the video frame set, and output the target video frame.

3. The video generation method according to claim 1, characterized in that: In S3, the media library is a video library stored locally, on the Internet, in a mobile network or in other cloud storages.

4. The video generation method according to claim 1, characterized in that: In S3, the method for searching for corresponding similar video frames according to each of the target video frames includes: obtaining the video to be searched from the media library, performing frame extraction on the video to be searched, and obtaining the video frames to be searched; and comparing the target video frame with each of the video frames to be searched, and obtaining similar video frames.

5. The video generation method according to claim 1, characterized in that: In S4, the selection is manual selection or automatic random selection.

6. The video generation method according to claim 1, characterized in that: In S4, the selection method includes: determining the nth video frame, sorting similar video frames in the n+1th material frame set according to the scene similarity with the nth video frame, and selecting one of the similar video frames with higher scene similarity and in the top m rankings as the n+1th video frame; repeating the above steps until the last video frame is selected; n is an integer greater than or equal to 1.

7. The video generation method according to claim 1 or 6, characterized in that: In S4, the selection method includes: determining the nth video frame, comparing the similar video frame in the n+1th material frame set with the nth video frame, obtaining the similar video frame with the highest scene similarity to the nth video frame, and selecting it as the n+1th video frame; repeating the above steps until the last video frame is selected; n is an integer greater than or equal to 1.

8. The video generation method according to claim 1 or 6, characterized in that: In S4, when determining the first video frame to be selected, the first video frame is selected by random selection or selection based on the degree of scene similarity.

9. An electronic device, characterized in that: comprising at least one memory and at least one processor; The at least one memory is coupled to the at least one processor, the at least one memory is used to store a computer program, the at least one processor is used to call the computer program, the computer program includes instructions, and when the instructions are executed by the at least one processor, the electronic device executes the video generation method as described in any one of claims 1 to 8.

10. A computer storage medium, characterized in that: It includes computer instructions, which, when executed on an electronic device, enable the electronic device to execute the video generation method as claimed in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Video generation method and device, computer device and storage medium

    CN110072120A

  • Video processing method and device and electronic equipment

    CN112070047A

  • Method for quickly generating short video

    CN112911399A

  • Video production method and system based on machine learning algorithm

    CN114915841A

  • Advertisement material production method and device, storage medium and computer equipment

    CN117676048A