Video generation method, apparatus, device, and storage medium
By acquiring and processing multiple media materials with sequential relationships, generating and merging result video clips and achieving the generation of target videos, the problem of single existing video creation methods is solved, and the smooth transition of video content and the richness of creative methods is achieved.
Patent Information
- Application Number
- PCT/CN2024/125386
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-20
- Filing Date
- 2024-10-16
- Publication Date
- 2025-05-30
AI Technical Summary
The existing video creation methods are single and lack rich creative methods, making it difficult to meet the diverse creative needs of users.
By obtaining multiple media materials with sequential relationships, video clips are generated based on these materials, and combined result video clips are generated through image similarity calculations, and the target video is finally generated. This method realizes a smooth transition of video content through image similarity calculation, reducing the probability of content bounce.
It achieves smooth transition of content during video creation, reduces the probability of content breaking out during playback, enriches video creation methods, and meets users' diverse creative needs.
Smart Images

Figure CN2024125386_30052025_PF_FP_ABST
Abstract
Description
Video generation method, device, equipment and storage medium
[0001] This application claims priority to the Chinese invention patent application entitled “A video generation method, device, equipment and storage medium” and application number 202311548953.7, filed on November 20, 2023. The entire contents of that application are incorporated by reference into this application. Technical Field
[0002] The present disclosure relates to the field of data processing, and in particular to a video generation method, apparatus, device, and storage medium. Background Art
[0003] With the continuous development of computer technology, the method of creating videos by uploading media materials in applications is becoming more and more common.
[0004] However, the current video creation methods are single, and how to enrich the video creation methods has become a technical problem that needs to be solved urgently.
[0005] Summary of the Invention
[0006] In order to solve the above technical problems, an embodiment of the present disclosure provides a video generation method.
[0007] In a first aspect, the present disclosure provides a video generation method, the method comprising:
[0008] Acquire a plurality of media materials having a sequential relationship; wherein the media materials are pictures or video clips, and the plurality of media materials include a first media material and a second media material having an adjacent sequential relationship;
[0009] generating a first video segment based on the first media material, and generating a second video segment based on the second media material;
[0010] generating a merged video segment based on the first video segment and the second video segment; wherein the merged video segment includes a first video sub-segment from the first video segment and a second video sub-segment from the second video segment, and image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition;
[0011] A target video is generated based on the merged video clips.
[0012] In an optional implementation, generating a merged result video segment based on the first video segment and the second video segment includes:
[0013] Determining, based on image similarity, a first image frame and a second image frame from the first video segment and the second video segment, respectively; wherein the first image frame is from the first video segment, and the second image frame is from the second video segment;
[0014] Based on the first image frame, extracting a first video sub-segment from the first video segment, and based on the second image frame, extracting a second video sub-segment from the second video segment;
[0015] Generate a merged result video segment based on the first video sub-segment and the second video sub-segment according to the adjacent order relationship.
[0016] In an optional embodiment, the first media material of the first and second media materials having an adjacent sequential relationship is located before the second media material. Before generating a merged result video segment based on the first video sub-segment and the second video sub-segment according to the adjacent sequential relationship, the method further includes:
[0017] Play the second video sub-segment in reverse order to obtain a second reverse-order video sub-segment;
[0018] Accordingly, generating a merged result video segment based on the first video sub-segment and the second video sub-segment according to the adjacent order relationship includes:
[0019] According to the adjacent order relationship, a merged result video segment is generated based on the first video sub-segment and the second reverse-order video sub-segment.
[0020] In an optional implementation manner, after generating a merged result video segment based on the first video sub-segment and the second video sub-segment according to the adjacent order relationship, the method further includes:
[0021] Determining whether the total number of image frames of the merged video segment is less than the preset number threshold;
[0022] If it is determined that the total number of image frames is less than the preset number threshold, the step of determining the first image frame and the second image frame from the first video clip and the second video clip respectively based on image similarity is triggered until a merged result video clip is obtained in which the total number of image frames is not less than the preset number threshold.
[0023] In an optional implementation, the multiple media materials further include a third media material, where the third media material is the last media material in the multiple media materials having a sequential relationship; and before generating the target video based on the merged video clip, the method further includes:
[0024] generating a third video clip based on the third media material;
[0025] Accordingly, generating a target video based on the merged video clips includes:
[0026] According to the sequential relationship, a merging process is performed based on the merging result video segment and the third video segment to obtain a target video.
[0027] In an optional implementation, the target video includes image frames corresponding to the multiple media materials, and the image frames corresponding to the multiple media materials comply with the sequential relationship.
[0028] In an optional implementation, generating a first video segment based on the first media material and generating a second video segment based on the second media material includes:
[0029] Based on the preset public target content, a first video segment is generated with the first media material as the first frame image, and a second video segment is generated with the second media material as the first frame image.
[0030] In a second aspect, the present disclosure provides a video generation device, the device comprising:
[0031] An acquisition module, configured to acquire a plurality of media materials having a sequential relationship; wherein the media materials are pictures or video clips, and the plurality of media materials include a first media material and a second media material having an adjacent sequential relationship;
[0032] A first generating module, configured to generate a first video segment based on the first media material, and generate a second video segment based on the second media material;
[0033] a second generating module, configured to generate a merged video segment based on the first video segment and the second video segment; wherein the merged video segment includes a first video sub-segment from the first video segment and a second video sub-segment from the second video segment, and image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition;
[0034] The third generating module is used to generate a target video based on the merged result video segment.
[0035] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a terminal device, the terminal device implements the above method.
[0036] In a fourth aspect, the present disclosure provides a video generation device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method when executing the computer program.
[0037] In a fifth aspect, the present disclosure provides a computer program product, which includes a computer program / instructions, and the computer program / instructions implement the above method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0039] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0040] FIG1 is a flow chart of a video generation method provided by an embodiment of the present disclosure;
[0041] FIG2 is a schematic diagram of generating a video clip based on preset public target content according to an embodiment of the present disclosure;
[0042] FIG3 is a schematic diagram showing a target video according to an embodiment of the present disclosure;
[0043] FIG4 is a schematic diagram showing another target video display according to an embodiment of the present disclosure;
[0044] FIG5 is a schematic diagram showing another target video display according to an embodiment of the present disclosure;
[0045] FIG6 is a flow chart of generating a target video according to an embodiment of the present disclosure;
[0046] FIG7 is a schematic structural diagram of a video generating device provided by an embodiment of the present disclosure;
[0047] FIG8 is a schematic structural diagram of a video generating device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0048] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0050] With the continuous development of computer technology, the method of creating videos by uploading media materials in applications is becoming more and more common.
[0051] However, the current video creation methods are single, and how to enrich the video creation methods has become a technical problem that needs to be solved urgently.
[0052] To this end, an embodiment of the present disclosure provides a video generation method. Specifically, first, multiple media materials with a sequential relationship are obtained, wherein the media materials are pictures or video clips, and the multiple media materials include a first media material and a second media material with an adjacent sequential relationship. Then, a first video clip is generated based on the first media material, and a second video clip is generated based on the second media material. A merged result video clip is generated based on the first video clip and the second video clip, wherein the merged result video clip includes a first video sub-segment from the first video clip and a second video sub-segment from the second video clip, and the image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition. Finally, a target video is generated based on the merged result video clip.
[0053] The disclosed embodiment generates a target video based on multiple media materials with a sequential relationship, and realizes a smooth transition of the image frame content in the target video through image similarity calculation, thereby reducing the probability of content jumping during the playback of the target video and enriching the video creation method.
[0054] Specifically, an embodiment of the present disclosure provides a video generation method. Referring to FIG1 , which is a flow chart of a video generation method provided by an embodiment of the present disclosure, the method specifically includes:
[0055] S101: Acquire multiple media materials having a sequential relationship.
[0056] The media material is a picture or a video clip, and the multiple media materials include a first media material and a second media material in an adjacent sequence relationship.
[0057] The video generation method provided by the embodiments of the present disclosure can be applied to a client, for example, the client can include a client deployed on a smartphone, a client deployed on a tablet computer, etc.; it can also be applied to a server.
[0058] In the embodiment of the present disclosure, the media material may include pictures or video clips selected from the user's album page, and may also include pictures or video clips taken by the user based on the shooting page, etc.
[0059] The first media material and the second media material may be any two media materials among a plurality of media materials that have an adjacent sequence relationship. The adjacent sequence relationship between the first media material and the second media material may include that the first media material is located before the second media material, or that the first media material is located after the second media material.
[0060] S102: Generate a first video segment based on the first media material, and generate a second video segment based on the second media material;
[0061] Generating a first video segment based on the first media material and generating a second video segment based on the second media material may include processing the first media material and the second media material using a relevant video generation model or a video generation algorithm to obtain corresponding first video segments and second video segments.
[0062] In addition, the first media material and the second media material may be processed based on preset common target content to generate a first video segment corresponding to the first media material and a second video segment corresponding to the second media material.
[0063] In an optional embodiment, based on a preset public target content, a first video segment is generated with a first media material as the first frame image, and a second video segment is generated with a second media material as the first frame image. The preset public target content refers to a preset common target generation content, that is, the first video segment is generated when the first media material is oriented toward the preset public target content, and the second video segment is generated when the second media material is oriented toward the preset public target content.
[0064] As shown in FIG2, a schematic diagram of generating a video clip based on a preset public target content provided by an embodiment of the present disclosure is shown. In this schematic diagram, the preset public target content 201 is used as the generation direction, wherein the first media material B is used as the first frame image, and the first video clip is generated in the direction of the preset public target content 201, wherein B 1 , B 2 They are respectively the image frames generated by the first media material B in the direction of the preset public target content, and the second video clip generated in the direction of the preset public target content 201 with the second media material C as the first frame image, wherein C 1 , C 2 They are respectively image frames generated by the second media material C in the direction of the preset public target content.
[0065] In another optional implementation, a processing method without common target content, i.e., infinitely divergent content generation, can be used to process a first media material and a second media material to generate a first video segment corresponding to the first media material and a second video segment corresponding to the second media material. Specifically, the first media material is processed to generate a first video segment, and the second video segment is processed to generate a second video segment. The first video segment and the second video segment are video segments generated using the infinitely divergent content generation method.
[0066] S103: Generate a merged result video segment based on the first video segment and the second video segment.
[0067] The merged video segment includes a first video sub-segment from the first video segment and a second video sub-segment from the second video segment, and image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition.
[0068] In the embodiment of the present disclosure, the preset image similarity condition may include a condition that the image similarity is the highest, a condition that the image similarity value is not less than a preset similarity threshold, and the like.
[0069] In practical applications, to improve the smoothness of the connection between displayed content in the target video, before generating a merged result video segment based on the first video segment and the second video segment, the embodiments of the present disclosure may respectively determine a first image frame and a second image frame from the first video segment and the second video segment based on image similarity, wherein the first image frame is from the first video segment and the second image frame is from the second video segment. The image similarity between the first image frame and the second image frame satisfies a preset similarity condition.
[0070] In practical applications, pairwise similarity calculations are performed on any image frame in the first video clip with each image frame in the second video clip, thereby determining the similarity value between the image frame and each image frame in the second video clip. Based on the above method, if the preset image similarity condition is the condition with the highest image similarity, the similarity value between each image frame in the first video clip and each image frame in the second video clip is calculated respectively, thereby obtaining the similarity value between each image frame in the first video clip and the second video clip. After comparison, the two image frames with the highest similarity values can be determined.
[0071] The method for calculating image similarity can be specifically set based on demand, and the embodiments of the present disclosure do not impose any limitation on this.
[0072] As shown in FIG2 , in the schematic diagram of generating video segments based on the preset public target content, the first video segment includes a first image frame B and an image frame B generated from the first image frame B. 1 and image frame B 2 The second video clip includes the first image frame C and the image frame C generated by the first image frame C. 1 and image frame C 2 , then the image similarity calculation is performed on each of the image frames in the first video clip and the second video clip to obtain (B, C), (B, C 1 ), (B, C 2 ), (B 1 , C)(B 1 , C 1 ), (B 1 , C 2 ), (B 2 , C), (B 2 , C 1 ), (B 2 , C 2 ) The image similarity values of the above 9 groups of image frames. If (B 2 , C 1 ) has the highest image similarity value, then B 2 Determine the first image frame in the first video clip, and set C 1 The second image frame is determined to be in the second video segment.
[0073] After determining the first image frame and the second image frame, the present embodiment can also perform interception processing on the first video segment and the second video segment for the first image frame and the second image frame respectively. Specifically, based on the first image frame, a first video sub-segment is intercepted from the first video segment, and based on the second image frame, a second video sub-segment is intercepted from the second video segment, wherein the first video sub-segment is a video sub-segment obtained by cutting off the first video segment from the position of the first image frame, and the second video sub-segment is a video sub-segment obtained by cutting off the second video segment from the position of the second image frame.
[0074] The first video sub-segment is obtained by cutting the first video segment based on the position information of the first image frame. That is, the first video segment is cut off from the position of the first image frame to obtain the first video sub-segment. The second video sub-segment is obtained by cutting the second video segment based on the position information of the second image frame. That is, the second video segment is cut off from the position of the second image frame to obtain the second video sub-segment. The position information of the first image frame and the position information of the second image frame are position information based on the timeline.
[0075] As shown in FIG. 2 above, in the schematic diagram of generating a video segment based on a preset public target content, it is assumed that the first image frame B 2 Based on the timeline position information of 5 seconds, the first video segment is cut from 0 seconds to 5 seconds to obtain the first video sub-segment; assuming that the second image frame C 1 Based on the timeline position information being the 6th second, the second video segment is intercepted from 0s to 6s to obtain a second video sub-segment.
[0076] On the basis of the above embodiment, a merged result video segment is generated based on the first video sub-segment and the second video sub-segment. Specifically, according to the adjacent sequence relationship between the media materials, the merged result video segment is generated based on the first video sub-segment and the second video sub-segment, wherein the merged result video segment includes the first image frame and the second image frame having an adjacent sequence relationship.
[0077] In actual applications, in order to achieve a more natural connection between the first video sub-segment and the second video sub-segment in the merged result video segment, the embodiment of the present disclosure can also reverse the second video sub-segment before generating the merged result video segment, wherein the second video sub-segment is obtained by intercepting the second video segment corresponding to the second media material, and the first media material of the first media material and the second media material having an adjacent sequential relationship is located before the second media material.
[0078] Specifically, the second video sub-segment is played in reverse order to obtain a second reverse order video sub-segment. Accordingly, according to the adjacent order relationship of the media materials, a merged result video segment is generated based on the first video sub-segment and the second reverse order video sub-segment.
[0079] The reverse play process may be implemented based on related modules, and the embodiments of the present disclosure do not impose any limitation on this.
[0080] As shown in FIG2 , a schematic diagram of generating a video segment based on a preset public target content, assuming that the order of playing image frames of the first video sub-segment is B→B 1 →B 2 , the order of playing image frames of the second video sub-segment is C→C 1 →C 2 , the second video sub-segment is played in reverse order to obtain a second reverse order video sub-segment, and the order of playing image frames of the second reverse order video sub-segment is C 2 →C 1 →C. A merged video segment is generated based on the first video sub-segment and the second reverse order video sub-segment. The order of playing image frames of the merged video segment includes B→B 1 →B 2 →C→C 1 →C 2 .
[0081] After generating a merged result video segment based on the first video sub-segment and the second video sub-segment, in order to ensure the playback quality of the merged result video segment and improve the user's viewing experience, in the embodiment of the present disclosure, it may also be necessary to determine whether the total number of image frames of the merged result video segment is less than the preset number threshold.
[0082] Specifically, a determination is made as to whether the total number of image frames in the merged video segment is less than a preset number threshold, where the preset number threshold may include the total number of image frames in the merged video segment. That is, a determination is also required as to whether the total number of image frames in the first video sub-segment and the second video sub-segment is greater than or equal to the preset number threshold.
[0083] If it is determined that the total number of image frames is less than the preset number threshold, the steps of determining the first image frame and the second image frame from the first video clip and the second video clip respectively based on image similarity are triggered until a merged result video clip is obtained in which the total number of image frames is not less than the preset number threshold.
[0084] In one optional embodiment, when the total number of image frames in the first and second video sub-segments is less than a preset threshold, based on the descending order of image similarity between each image frame in the first video segment and each image frame in the second video segment, the two image frames ranked second in image similarity are re-selected as the first and second image frames. Then, based on the position information of the first and second image frames, the first and second video segments are intercepted to obtain the first and second video sub-segments. The determination of whether the total number of image frames in the first and second video sub-segments is greater than the preset threshold is continued until a merged video segment is obtained in which the total number of image frames meets the preset threshold.
[0085] By setting a preset number threshold, the embodiment of the present disclosure can avoid the problem of too few image frames in the merged video segment synthesized from the first video sub-segment and the second video sub-segment, thereby ensuring the user's viewing experience.
[0086] In practical applications, a preset display duration can also be set, i.e., the total display duration of the first and second video sub-segments must be no less than the preset display duration. Specifically, based on the first and second video segments, a determination is made as to whether the total display duration of the first and second video sub-segments is no less than the preset display duration, provided that the preset similarity condition is met. If so, the first and second image frames that meet the preset image similarity condition need to be re-determined, and the search for two image frames that meet the condition continues.
[0087] S104: Generate a target video based on the merged video clips.
[0088] The target video includes image frames corresponding to a plurality of media materials, and the image frames corresponding to the plurality of media materials are in a sequential relationship.
[0089] Figure 3 shows a schematic diagram of a target video display according to an embodiment of the present disclosure. In this display diagram, an image frame of a first media material is used as the first frame, and an image frame of a second media material is used as the ending frame of the target video. The image similarity between two adjacent image frames at the junction of the first video sub-segment and the second video sub-segment satisfies a preset similarity condition. In other words, the image similarity between the first image frame and the second image frame satisfies the preset similarity condition.
[0090] In the video generation method provided by the embodiments of the present disclosure, first, a plurality of media materials having a sequential relationship are obtained, wherein the media materials are pictures or video clips, and the plurality of media materials include a first media material and a second media material having an adjacent sequential relationship, then a first video clip is generated based on the first media material, and a second video clip is generated based on the second media material, and a merged result video clip is generated based on the first video clip and the second video clip, wherein the merged result video clip includes a first video sub-segment from the first video clip and a second video sub-segment from the second video clip, and the image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition, and finally a target video is generated based on the merged result video clip.
[0091] The disclosed embodiment generates a target video based on multiple media materials with a sequential relationship, and realizes a smooth transition of the image frame content in the target video through image similarity calculation, thereby reducing the probability of content jumping during the playback of the target video and enriching the video creation method.
[0092] In an optional implementation, the plurality of media materials may further include a third media material, which is the last media material in the plurality of media materials in a sequential relationship. Before generating the target video based on the merged video clips, the third media material may be processed.
[0093] Specifically, a third video segment is generated based on the third media material. Accordingly, a target video is generated based on the merged video segment and the third video segment in a sequential relationship, wherein the target video includes the third video segment.
[0094] In one optional embodiment, the multiple media materials include two media materials, namely, a first media material and a second media material. In this case, the second media material is the third media material, i.e., the last media material. Before generating the target video based on the merged video clip, it is necessary to generate a third video clip from the second media material. In a sequential relationship, the target video is generated based on the merged video clip and the third video clip, wherein the target video includes the third video clip. The process of generating the third video clip can refer to the process of generating the first video clip from the first media material and generating the second video clip from the second media material, and will not be discussed in detail here.
[0095] As shown in Figure 4, a schematic diagram of displaying a target video provided by an embodiment of the present disclosure is shown. In this schematic diagram, the image frame of the first media material is used as the first frame, and the last image frame of the third video segment generated by the second media material is used as the end frame.
[0096] In another optional implementation, the third media material may be a media material other than the first and second media materials, wherein the third media material is the last media material in a sequential order. Before generating the target video based on the merged video clip, a third video clip is generated based on the third media material. The target video is generated based on the merged video clip and the third video clip in a sequential order. The process of generating the third video clip can be similar to the process of generating the first video clip from the first media material and the process of generating the second video clip from the second media material, and will not be discussed in detail here.
[0097] 5 is a schematic diagram of displaying a target video according to an embodiment of the present disclosure, wherein the image frame of the first media material is used as the first frame, and the last image frame of the third video segment generated by the third media material is used as the end frame.
[0098] To facilitate understanding of the above embodiment, the present disclosure provides a schematic diagram of generating a target video, as shown in Figure 6. Taking the example of a user selecting two media materials to generate a target video, it is assumed that the media materials selected by the user are a first media material and a second media material in a sequential relationship, wherein the first media material is located before the second media material.
[0099] First, based on preset common target content, a first media material is processed to generate a first video segment, and a second media material is processed to generate a second video segment. Then, similarity calculation is performed between image frames in the first video segment and image frames in the second video segment to determine the first image frame and the second image frame that meet the preset similarity condition.
[0100] Then, based on the timeline position information of the first image frame and the second image frame, the first video segment and the second video segment are intercepted to obtain the first video sub-segment and the second video sub-segment, and the second video sub-segment is played in reverse order to obtain the second reverse order video sub-segment.
[0101] Finally, based on the first video segment and the second reverse-order video sub-segment, according to the adjacent order relationship, a merged result video segment is obtained in which the total number of image frames meets a preset number threshold, and finally the target video is generated.
[0102] The technical solution provided by the embodiments of the present disclosure has at least the following advantages compared with the prior art:
[0103] An embodiment of the present disclosure provides a video generation method. First, a plurality of media materials having a sequential relationship are acquired, wherein the media materials are pictures or video clips, and the plurality of media materials include a first media material and a second media material having an adjacent sequential relationship. Then, a first video clip is generated based on the first media material, and a second video clip is generated based on the second media material. A merged video clip is generated based on the first video clip and the second video clip, wherein the merged video clip includes a first video sub-segment from the first video clip and a second video sub-segment from the second video clip, and image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition. Finally, a target video is generated based on the merged video clip.
[0104] The disclosed embodiment generates a target video based on multiple media materials with a sequential relationship, and realizes a smooth transition of the image frame content in the target video through image similarity calculation, thereby reducing the probability of content jumping during the playback of the target video and enriching the video creation method.
[0105] Based on the above method embodiment, the present disclosure further provides a video generation device. Referring to FIG7 , which is a schematic structural diagram of a video generation device provided in an embodiment of the present disclosure, the device includes:
[0106] An acquisition module 701 is configured to acquire a plurality of media materials having a sequential relationship; wherein the media materials are pictures or video clips, and the plurality of media materials include a first media material and a second media material having an adjacent sequential relationship;
[0107] A first generating module 702 is configured to generate a first video segment based on the first media material, and generate a second video segment based on the second media material;
[0108] A second generating module 703 is configured to generate a merged video segment based on the first video segment and the second video segment; wherein the merged video segment includes a first video sub-segment from the first video segment and a second video sub-segment from the second video segment, and image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition;
[0109] The third generating module 704 is configured to generate a target video based on the merged video clips.
[0110] In an optional implementation manner, the second generation module includes:
[0111] A first determining submodule, configured to determine, based on image similarity, a first image frame and a second image frame from the first video segment and the second video segment, respectively; wherein the first image frame is from the first video segment, and the second image frame is from the second video segment;
[0112] a first capturing submodule, configured to capture a first video sub-segment from the first video segment based on the first image frame, and to capture a second video sub-segment from the second video segment based on the second image frame;
[0113] The first generating submodule is configured to generate a merged result video segment based on the first video sub-segment and the second video sub-segment according to the adjacent sequence relationship.
[0114] In an optional implementation manner, in the first media material and the second media material having an adjacent sequential relationship, the first media material is located before the second media material, and the apparatus further includes:
[0115] a first processing module, configured to perform reverse playback processing on the second video sub-segment to obtain a second reverse-order video sub-segment;
[0116] Accordingly, the first generation submodule is specifically used to:
[0117] According to the adjacent order relationship, a merged result video segment is generated based on the first video sub-segment and the second reverse-order video sub-segment.
[0118] In an optional embodiment, the device further includes:
[0119] A first determining module is configured to determine whether the total number of image frames of the merged video segment is less than a preset number threshold;
[0120] The second determination module is used to trigger the execution of the step of respectively determining the first image frame and the second image frame from the first video clip and the second video clip based on image similarity when it is determined that the total number of image frames is less than the preset number threshold, until a merged result video clip is obtained in which the total number of image frames is not less than the preset number threshold.
[0121] In an optional implementation manner, the plurality of media materials further include a third media material, and the third media material is the last media material in the plurality of media materials having a sequential relationship; and the apparatus further includes:
[0122] a fourth generating module, configured to generate a third video clip based on the third media material;
[0123] Accordingly, the third generation module is specifically configured to:
[0124] According to the sequential relationship, a merging process is performed based on the merging result video segment and the third video segment to obtain a target video.
[0125] In an optional implementation, the target video includes image frames corresponding to the multiple media materials, and the image frames corresponding to the multiple media materials comply with the sequential relationship.
[0126] In an optional implementation manner, the first generating module is specifically configured to:
[0127] Based on the preset public target content, a first video segment is generated with the first media material as the first frame image, and a second video segment is generated with the second media material as the first frame image.
[0128] In the video generation device provided by the embodiment of the present disclosure, first, multiple media materials with a sequential relationship are obtained, wherein the media materials are pictures or video clips, and the multiple media materials include a first media material and a second media material with an adjacent sequential relationship, then a first video clip is generated based on the first media material, and a second video clip is generated based on the second media material, and a merged result video clip is generated based on the first video clip and the second video clip, wherein the merged result video clip includes a first video sub-segment from the first video clip and a second video sub-segment from the second video clip, and the image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition, and finally a target video is generated based on the merged result video clip.
[0129] The disclosed embodiment generates a target video based on multiple media materials with a sequential relationship, and realizes a smooth transition of the image frame content in the target video through image similarity calculation, thereby reducing the probability of content jumping during the playback of the target video and enriching the video creation method.
[0130] In addition to the above-mentioned method and apparatus, the embodiments of the present disclosure further provide a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal device, the terminal device implements the video generation method described in the embodiments of the present disclosure.
[0131] The embodiments of the present disclosure further provide a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the video generation method described in the embodiments of the present disclosure is implemented.
[0132] In addition, the embodiment of the present disclosure further provides a video generating device, as shown in FIG8 , which may include:
[0133] Processor 801, memory 802, input device 803, and output device 804. The number of processors 801 in the video generation device can be one or more, and Figure 8 uses one processor as an example. In some embodiments of the present disclosure, the processor 801, memory 802, input device 803, and output device 804 can be connected via a bus or other means, wherein Figure 8 uses the bus connection as an example.
[0134] The memory 802 can be used to store software programs and modules. The processor 801 executes the various functional applications and data processing of the video generation device by running the software programs and modules stored in the memory 802. The memory 802 may primarily include a program storage area and a data storage area. The program storage area may store an operating system, at least one application required for a function, and the like. Furthermore, the memory 802 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state memory device. The input device 803 may be used to receive input digital or character information and generate signal input related to user settings and function control of the video generation device.
[0135] Specifically in this embodiment, the processor 801 will load the executable files corresponding to the processes of one or more applications into the memory 802 according to the following instructions, and the processor 801 will run the applications stored in the memory 802, thereby realizing the various functions of the above-mentioned video generation device.
[0136] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0137] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A video generation method, comprising: Acquire a plurality of media materials having a sequential relationship; wherein the media materials are pictures or video clips, and the plurality of media materials include a first media material and a second media material having an adjacent sequential relationship; generating a first video segment based on the first media material, and generating a second video segment based on the second media material; generating a merged result video segment based on the first video segment and the second video segment; wherein the merged result video segment includes a first video sub-segment from the first video segment and a second video sub-segment from the second video segment, and image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition; and A target video is generated based on the merged result video segment.
2. The method according to claim 1, wherein generating a merged result video segment based on the first video segment and the second video segment comprises: Based on the image similarity, determining a first image frame and a second image frame from the first video segment and the second video segment respectively; wherein the first image frame comes from the first video segment, and the second image frame comes from the second video segment; Based on the first image frame, extracting a first video sub-segment from the first video segment, and based on the second image frame, extracting a second video sub-segment from the second video segment; and According to the adjacent order relationship, a merged result video segment is generated based on the first video sub-segment and the second video sub-segment.
3. The method according to claim 2, wherein the first media material of the first media material and the second media material having the adjacent sequential relationship is located before the second media material, and before generating the merged result video segment based on the first video sub-segment and the second video sub-segment according to the adjacent sequential relationship, the method further comprises: Play the second video sub-segment in reverse order to obtain a second reverse order video sub-segment; Accordingly, generating a merged result video segment based on the first video sub-segment and the second video sub-segment according to the adjacent order relationship includes: According to the adjacent order relationship, a merged result video segment is generated based on the first video sub-segment and the second reverse order video sub-segment.
4. The method according to claim 2, wherein after generating a merged result video segment based on the first video sub-segment and the second video sub-segment according to the adjacent order relationship, the method further comprises: Determine whether the total number of image frames of the merged result video segment is less than the preset number threshold; as well as If it is determined that the total number of image frames is less than the preset number threshold, the step of determining the first image frame and the second image frame from the first video clip and the second video clip respectively based on the image similarity is triggered. The steps are repeated until a merged video segment is obtained whose total number of image frames is not less than the preset number threshold.
5. The method according to claim 1, wherein the plurality of media materials further include a third media material, and the third media material is the last media material in the plurality of media materials having a sequential relationship; before generating the target video based on the merged result video segment, the method further includes: generating a third video clip based on the third media material; Accordingly, generating a target video based on the merged result video segment includes: According to the sequence relationship, a merging process is performed based on the merging result video segment and the third video segment to obtain a target video. 6 . The method according to claim 1 , wherein the target video includes image frames corresponding to the multiple media materials respectively, and the image frames corresponding to the multiple media materials respectively conform to the sequential relationship.
7. The method according to claim 1, wherein generating a first video segment based on the first media material and generating a second video segment based on the second media material comprises: Based on the preset public target content, a first video segment is generated with the first media material as the first frame image, and a second video segment is generated with the second media material as the first frame image.
8. A video generating device, comprising: An acquisition module, configured to acquire a plurality of media materials having a sequential relationship; wherein the media materials are pictures or video clips, and the plurality of media materials include a first media material and a second media material having an adjacent sequential relationship; A first generating module, configured to generate a first video segment based on the first media material, and to generate a second video segment based on the second media material; a second generating module, configured to generate a merged result video segment based on the first video segment and the second video segment; wherein the merged result video segment includes a first video sub-segment from the first video segment and a second video sub-segment from the second video segment, and image similarity of adjacent image frames between the first video sub-segment and the second video sub-segment meets a preset similarity condition; and The third generating module is used to generate a target video based on the merged result video segment.
9. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 7.
10. A video generating device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Video material processing method, video synthesis method and device as well as storage medium
CN107770626A
Video synthesis method and device, terminal and computer readable storage medium
CN110602552A
Video synthesis method and device, electronic equipment and readable storage medium
CN113301409A
Video rendering method and device, electronic equipment and storage medium
CN113852840A
Video processing method and device and electronic equipment
CN116055798A