Video generation method and device, equipment, storage medium and program product

By determining the target video frame group and generating transition frames, the problems of inaccurate video cutting and unnatural transition are solved, the smoothness and realism of the video are improved, and the quality and efficiency of video generation are enhanced.

CN119155524APending Publication Date: 2024-12-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411231878.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

When processing 2D digital human videos, existing video generation methods have problems such as inaccurate video cutting and unnatural transition, resulting in poor smooth videos, serious splicing traces, and lack of realism, especially when dealing with long videos and multiple characters. Inefficient when video.

Method used

By determining the target video frame group, the video is cut according to the deviation comparison results between the video frames, and the transition frame is generated to achieve a natural transition of the candidate video segments, weaken the splicing traces, and improve the smoothness and reality of the video.

Benefits of technology

Improves the smoothness and reality of video generation, weakens splicing traces, enhances the smoothness and quality of videos, especially when dealing with long videos and multi-person videos, and improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155524A_ABST
    Figure CN119155524A_ABST
Patent Text Reader

Abstract

The invention provides a video generation method and device, equipment, a storage medium and a program product. The video generation method comprises: determining a target video frame group of a first video, the target video frame group comprising video frames selected from a second sampling video segment, the second sampling video segment being a video segment satisfying a preset smoothness constraint condition in the first video, determining a first video frame according to a deviation comparison result between the video frames in the target video frame group; cutting the first video based on the first video frame to obtain candidate video segments; and generating a first transition frame between the candidate video segments, and generating a target video based on the first transition frame and the candidate video segments. By adopting the method, the smoothness of the generated target video can be enhanced, and the video splicing trace is weakened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video processing technology, and in particular to a video generation method, device, equipment, storage medium and program product. Background Art

[0002] 2D digital humans, as a kind of digital humans with real-life effects, have been widely used. For example, some digital humans have been put into use in the fields of enterprise digital employees, cultural and tourism guides, product guides, and public services. When applying, the original video needs to be pre-processed. For example, the original video has a limited duration, but a longer video needs to be generated; when interacting, videos with different actions need to be connected; in some occasions, the digital human needs to return to the original posture at the end of a service to express politeness. Summary of the invention

[0003] Based on this, it is necessary to provide a video generation method, device, equipment, storage medium and program product that can enhance the smoothness of the generated target video and weaken the video splicing traces in response to the above technical problems.

[0004] In a first aspect, the present application provides a video generation method. The method comprises:

[0005] Determine a target video frame group of the first video, the target video frame group includes video frames selected from a second sampled video segment, the second sampled video segment is a video segment in the first video that satisfies a preset smoothness constraint condition;

[0006] Determining a first video frame according to a deviation comparison result between video frames in the target video frame group;

[0007] Cutting the first video based on the first video frame to obtain candidate video segments;

[0008] A first transition frame between the candidate video segments is generated, and a target video is generated based on the first transition frame and the candidate video segments.

[0009] In a second aspect, the present application also provides a video generation device. The device comprises:

[0010] A target video frame group module, used to determine a target video frame group of the first video, wherein the target video frame group includes video frames selected from a second sampled video segment, wherein the second sampled video segment is a video segment in the first video that satisfies a preset smoothness constraint condition;

[0011] A first video frame module, configured to determine a first video frame according to a deviation comparison result between video frames in the target video frame group;

[0012] A video segmentation module, configured to segment the first video based on the first video frame to obtain candidate video segments;

[0013] The video generation module is used to generate a first transition frame between the candidate video segments, and generate a target video based on the first transition frame and the candidate video segments.

[0014] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the video generation method as described in any one of the embodiments in the first aspect are implemented.

[0015] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in a video generation method as described in any one of the embodiments in the first aspect are implemented.

[0016] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps in the video generation method as described in any one of the embodiments in the first aspect are implemented.

[0017] The above-mentioned video generation method, device, equipment, storage medium and program product can achieve the following beneficial effects corresponding to the technical problems in the background technology by deducing the technical features in the claims:

[0018] The present application provides a video generation method. After acquiring a first video, a target video frame group is determined. The target video frame group includes video frames selected from a second sampled video segment. The second sampled video segment is a video segment in the first video that satisfies a preset smoothness constraint. The first video frame is determined based on a deviation comparison result between video frames in the target video frame group, thereby determining at least one cutting point, and cutting the first video into multiple candidate video segments. Finally, a first transition frame is generated between the candidate video segments, and the candidate video segments are spliced ​​through the first transition frame, which helps to further improve the smoothness of the connection between the candidate video segments, reduce the editing traces of the target video, and ultimately improve the quality of the produced digital video. In the embodiment of the present application, each frame image in the video is compared to obtain a target video frame group, and the first video frame in the target video frame group can be used as the cutting point of the first video, and a first transition frame is generated to splice the candidate video segments obtained after cutting, so as to achieve a smooth transition between the candidate video segments. In this way, the first video can be accurately cut according to the deviation results between the video frames, and the natural transition of the splicing processing between the candidate video segments can be achieved, which can ultimately improve the smoothness of the generated target video and reduce the splicing marks. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A first flow chart of a video generation method in one embodiment;

[0020] Figure 2 A second flow chart of a video generation method in another embodiment;

[0021] Figure 3 A schematic diagram of sampling points of a target object in one embodiment;

[0022] Figure 4 is a third flow chart of a video generating method in another embodiment;

[0023] Figure 5 A schematic diagram of the frame composition of a long video in one embodiment;

[0024] Figure 6 is a fourth flow chart of a video generating method in another embodiment;

[0025] Figure 7 A schematic diagram of the overall process of generating transition materials in one embodiment;

[0026] Figure 8 is a fifth flow chart of a video generating method in another embodiment;

[0027] Fig. 9 A schematic diagram of a process for generating a long video of a specified candidate video segment in one embodiment;

[0028] Fig.10 A schematic diagram of frame composition of a long video specifying a candidate video segment in one embodiment;

[0029] Fig.11 A schematic diagram of a process for generating a long video of a specified standard frame in one embodiment;

[0030] Fig.12 A schematic diagram of frame composition of a long video specifying a standard frame in an embodiment;

[0031] Fig.13 is a sixth flow chart of a video generating method in another embodiment;

[0032] Fig.14 is a seventh flow chart of a video generating method in another embodiment;

[0033] Fig.15 A schematic diagram of a process for generating a long video in one embodiment;

[0034] Fig.16 is a structural block diagram of a video generating device in one embodiment;

[0035] Fig.17 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0037] In the related technologies, 2D digital humans as a kind of digital humans with real-life effects have been widely used. For example, some digital humans have been "on duty" in the fields of enterprise digital employees, cultural and tourism tour guides, product tour guides, and public services. Since the essence of 2D digital humans is a re-editing of the video, only the area of ​​the lower half of the face is generated by the algorithm, and the other non-generated areas are taken from the original video, and then the generated part is merged with the original video. When applying, the original video needs to be preprocessed. For example: the original video has a limited length, but a longer video needs to be generated; videos with different actions need to be connected during interaction; in some occasions, digital humans need to return to the original posture at the end of a service to express politeness. These all involve cutting and transitioning the original video. If the position of the video cutting is inaccurate, or the transition is unnatural, the final video will be unsmooth and the effect will be poor.

[0038] The current processing methods for digital video generation have the following technical problems: the video needs to be previewed and the video frames in the video need to be compared one by one, which is inefficient, especially when it is necessary to process videos involving people or even multiple people. The cutting point is selected only by the difference comparison between basic video frames, and it is difficult to select the frame closest to the previous and next frames, resulting in the video not being smooth enough when the transition frame group is inserted later. The long video generated in the end usually has serious splicing marks, a strong sense of looping, lack of realism, and other problems, and the quality is poor.

[0039] Based on this, the present application provides a video generation method. In one embodiment, Figure 1 As shown, a video generation method is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0040] Step 102: Determine a target video frame group of the first video, wherein the target video frame group includes video frames selected from a second sampled video segment, wherein the second sampled video segment is a video segment in the first video that satisfies a preset smoothness constraint condition.

[0041] Among them, the video frame is the basic unit in video data processing, which represents a static image of the video screen at a specific time point. Video frames are arranged in order in a video file or video stream to present a continuous dynamic picture. In order to cut the video into segments in the first video, it is necessary to determine the location of the cutting point. The target video frame group can refer to the video frame interval where the cutting point is located. Compared with selecting the cutting point in the complete first video, narrowing the selection range to the target video frame group first helps to improve the efficiency and accuracy of selecting the cutting point.

[0042] The target video frame group may include multiple continuous video frames. Exemplarily, after acquiring the first video, in order to segment the first video, the terminal needs to find the approximate position interval of the cutting point in the original video, that is, the target video frame group. At this time, in order to enhance the smoothness of the long video finally synthesized, the terminal can process the first video based on the preset smoothness constraint condition, select a sampled video segment that meets the preset smoothness constraint condition from the first video, and then select a video frame from the sampled video segment to obtain the target video frame group.

[0043] The preset smoothness constraint condition may refer to a condition for selecting a sampled video segment when sampling the first video, and is a constraint condition based on the smoothness of picture transition. Exemplarily, the smoothness constraint condition may specifically be a condition for constraining the stability of the video content of the first video, and the video content of the selected sampled video segment may include the entire video picture of the first video, or may include the picture of a specific object in the video.

[0044] For example, the smoothness constraint condition may be a smoothness threshold, which may be pre-set by a technician by selecting different video segments in the first video and respectively calculating a quantization parameter that can reflect the overall smoothness of the video frame of each video segment, and comparing the quantization parameter with the smoothness threshold. Ultimately, a sampled video segment that meets the preset smoothness threshold may be selected, and then a target video frame group may be obtained from the sampled video segment.

[0045] Step 104: Determine a first video frame according to the deviation comparison result between the video frames in the target video frame group.

[0046] The deviation comparison result may refer to a comparison result obtained by comparing the video frames based on a preset comparison logic, and is a comparison result that quantifies the similarity between the video frames. The first video frame is the cutting point of the first video.

[0047] For example, in order to enhance the smoothness of the synthesized video connection, a frame with the smallest change before and after can be selected as the cutting point, so that although the head and tail of the two video segments obtained by cutting are located in two video segments respectively, they have a smooth transition effect when connected together. Specifically, the terminal can determine the first video frame as the first video frame among the two adjacent video frames with the smallest deviation based on the deviation comparison result between the video frames in the target video frame group. At this time, the two first video frames are a cutting point.

[0048] Specifically, the cutting point may refer to the segmentation position selected for segmenting the first video, and the segmentation point may be determined based on the video time or the video frame. In the fine segmentation process, the segmentation point is usually determined based on the video frame. For example, if the 30th frame of the first video is used as the segmentation point for segmentation, the video segment before the 30th frame is segmented into the front video segment, and the video segment after the 31st frame is segmented into the back video segment. After determining the target video frame group, the terminal needs to determine the specific cutting point position in the target video frame group.

[0049] The cutting point can be a frame in the target video frame group that has the smallest change compared to other video frames in the same group. At this time, the video frames in the target video frame group can be further compared, specifically, the deviation comparison results between any video frame in the target video frame group and other video frames are calculated, all deviation comparison results are summarized, and the video frame with the smallest overall deviation is selected. In this way, the selected video frame can be used as the cutting point.

[0050] In a special case, if there are multiple video frames with the same deviation in the same target video frame group, one or more of the video frames with the same deviation can be randomly selected as cutting points.

[0051] Preferably, the terminal can randomly select one as a cutting point. In the implementation scenario, the first video may include multiple target video frame groups, and only one cutting point needs to be determined in each video frame group to segment the first video. Because the target of the cutting is the first video rather than the target video frame group, there is a difference in the size of the two. For example, the total length of the first video is 1000 frames, while the target video frame group is 20 frames. At this time, if a cutting point is selected from the target video frame group, and the cutting point corresponds to the position of the 400th frame of the target video, the first video will be segmented into two video segments of 400 frames and 600 frames; if two cutting points are selected from the target video frame group, corresponding to the positions of the 400th and 410th frames of the target video, the first video will be segmented into three video segments of 400 frames, 10 frames, and 590 frames. At this time, extremely small video clips such as 10 frames appear, and such extremely short video clips have a large scale difference from other video clips. Therefore, the terminal can preferably determine only one cutting point in a target video frame group.

[0052] Step 106: Segment the first video based on the first video frame to obtain candidate video segments.

[0053] The candidate video segments may refer to video clips used to synthesize the target video.

[0054] Exemplarily, after determining the first video frame, the terminal may determine a cutting point of the first video, that is, determine the position of the first video frame as the cutting point, thereby cutting the first video to obtain a plurality of candidate video segments.

[0055] Step 108: Generate a first transition frame between the candidate video segments, and generate a target video based on the first transition frame and the candidate video segments.

[0056] The first transition frame may refer to a transition video frame used to achieve the connection synthesis between the two selected candidate video segments. The target video may refer to the digital synthesized video that needs to be synthesized in the end.

[0057] Exemplarily, the terminal may generate a first transition frame between candidate video segments based on a preset transition frame generation algorithm, and the first transition frame may include a video frame group composed of multiple video frames, and is not limited to one video frame. Specifically, the transition frame generation algorithm may include a frame insertion algorithm, a frame mixing algorithm, a motion blur algorithm, a content-aware interpolation algorithm, a frame prediction algorithm, a timeline transition algorithm, etc. The specific transition frame generation algorithm is selected based on the generation requirements of the target video.

[0058] Specifically, when calling the interpolation algorithm, the number of transition frames to be inserted can be specified, for example, the number of transition frames is k, and the size of k depends on the required transition duration. The playback duration of each frame can be determined according to the FPS (frames per second) of the current first video. and The creation of the first transition frame group is used as an example for explanation. The other two candidate video segments are similar and will not be described in detail. , then play the video clip , video clip have frame , video clip have frame , video clip Continue playing the video clip after it ends , so it can be and , and A transition frame group is created during the transition, and the transition frame group is the first transition frame.

[0059] Finally, the terminal can generate a target video by cutting the obtained candidate video segments. During the generation, the candidate video segments are connected and transitioned through the first transition frame, and finally the required target video is obtained.

[0060] In the above-mentioned video generation method, reasonable deduction is carried out in combination with the technical features in the embodiment, which can achieve the following beneficial effects of solving the technical problems raised in the background technology: a video generation method provided by the present application determines a target video frame group after obtaining a first video, so as to determine a target video frame group with a higher smoothness in the first video as a whole. According to the deviation comparison results between the video frames in the target video frame group, the first video frame is determined, so as to determine at least one cutting point, and the first video is cut into multiple candidate video segments, so that the connection between the candidate video segments after cutting has a higher similarity. Finally, by generating a first transition frame between the candidate video segments and realizing the splicing of the candidate video segments through the first transition frame group, it is helpful to further improve the smoothness of the connection between the candidate video segments, reduce the editing traces of the target video, and finally improve the quality of the produced digital video.

[0061] In implementation, by comparing and calculating each frame image in the video and using the calculation results as the basis for determining the target video frame group and the cutting point, the accuracy of the target video frame group and the cutting point can be improved, thereby realizing the cutting, transition, and splicing of the first video at a position with a smaller deviation in the first video, and ultimately reducing the deviation before and after the splicing point of the target video, improving the smoothness of the generated target video, and reducing the splicing marks.

[0062] In one embodiment, the Figure 2 As shown, step 102 includes:

[0063] Step 202: Perform target detection on the first video and determine sampling points according to the detected target object.

[0064] Among them, target detection may refer to the process of detecting a target object in the first video, and the target object may be a person in the video, a background scene, or an object in the video screen, etc. Sampling points may refer to specific positions or pixels selected in two video frames in video frame comparison, which are used for comparison and matching between video frames.

[0065] Specifically, the sampling points can be randomly selected within the image range of the target object. For example, when the target object is an object, the sampling points can be randomly selected within the image range of the object. The sampling points can also be set in the image area where the target object is in a more active state of motion. For example, when the target object is a person, the image area where the limbs, head, etc. of the person are in more active motion can be selected and the sampling points can be set therein. By comparing the pixel values ​​or features of the sampling points, the similarity or difference between the two images can be evaluated. Accordingly, the selection of sampling points is crucial to the accuracy and efficiency of image comparison.

[0066] For example, it can be Figure 3As shown, taking the target object as a person in the first video as an example, the terminal can call a preset posture estimation algorithm to estimate the human posture of each frame of the first video, thereby determining multiple sampling points of the target object, such as sampling point A and sampling point B shown in the figure. In order to improve the accuracy of video frame comparison, multiple sampling points can be set. At this time, different sampling points have certain two-dimensional coordinates (X, Y) in each video frame.

[0067] Step 204: Sliding sampling is performed on the first video based on a preset sampling window to obtain a first sampled video segment.

[0068] The sampling window may refer to a sampling range set for selecting a video segment of a fixed area in a video sequence, and the size of the sampling window may be determined based on the number of video frames.

[0069] Exemplarily, the terminal may perform sliding sampling on the first video based on a preset sampling window.

[0070] Step 206: Determine a smoothness determination parameter of the first sampled video segment according to the sampling points.

[0071] The smoothness discrimination parameter may refer to a quantization parameter for discriminating the smoothness of a video frame, such as Euclidean distance, cosine distance, and the like.

[0072] Exemplarily, the terminal may determine the smoothness discrimination parameters of different intercepted sampled video segments according to the sampling points.

[0073] In a specific implementation, each sampled video segment includes multiple video frames. The terminal can calculate the difference between the sampling point coordinates of each video frame and the previous video frame. The difference can be determined by calculating the distance between the sampling point of each video frame and the corresponding sampling point of the previous video frame.

[0074] Specifically, the distance between the same sampling point in different video frames can be represented by, for example, the Euclidean distance or other distance metrics. The distances of all sampling points are summed up to obtain , as the sum of the differences between the current video frame and the previous video frame, the sum of the differences can be used to determine the degree of deviation between the current video frame and the previous video frame. The higher the degree of deviation, the worse the smoothness between the two, and the lower the degree of deviation, the higher the smoothness between the two. is the coordinate of a sampling point in the current video frame, is the coordinate of the sampling point in the previous video frame, is the sampling point set of the current frame, is the sampling point set of the previous frame. On this basis, in order to determine the overall smoothness discrimination parameter of the sampled video segment, we can first give the sampling window size k and a very small positive number As the smoothness threshold, calculate the cumulative difference of the video frame from the 1st frame to the kth frame window, that is, , and then slide the window backward, that is, from the 2nd frame to the k+1th frame, and so on, to calculate .

[0075] Step 208: Select a second sampled video segment from the first sampled video segment according to the smoothness discrimination parameter, and the video frames in the target video frame group include the video frames selected from the second sampled video segment.

[0076] Exemplarily, the terminal may select a sampled video segment whose smoothness discrimination parameter satisfies a preset smoothness constraint condition, and determine the video frames in the selected sampled video segment as the target video frame group. Following the above example, after determining the smoothness discrimination parameter of each sampled video segment, the sampled video segment may be discriminated according to the smoothness constraint condition. In this example, the smoothness discrimination parameter may be a smoothness threshold ,like ,in It can be considered that a target video frame group has been found.

[0077] In this embodiment, target detection is performed in the first video, specific and multiple sampling points of the target object are selected, and the first video is slidingly sampled through a sampling window. The smoothness discrimination parameters in different intercepted sampling video segments are determined through the sampling points, so that the sampling video segments that meet the smoothness constraint conditions can be determined according to the smoothness discrimination parameters, and finally the target video frame group is determined, which helps to improve the accuracy of the target video frame group selection, and then correspondingly improve the video effect of the final synthesized target video.

[0078] In one embodiment, the current generation of long videos mainly relies on looping certain video clips, or playing the original video forward and backward. This method can easily make users feel that this is a post-synthesized video and lacks realism. Figure 4 As shown, the first transition frame includes X sub-transition frames, and step 106 includes:

[0079] Step 402: Randomly sort the candidate video segments.

[0080] For example, it can be Figure 5 As shown, the terminal can randomly sort the candidate video segments in response to the generation requirements of the target video. In a specific example, the terminal can generate a random number sequence for the candidate video segments. For example: 3, 15, 7, 22, ... Each number is uniquely associated with a candidate video segment. In this way, the terminal can obtain a sequence of randomly sorted candidate video segments. Exemplarily, the terminal obtains a candidate video segment sequence of 3, 15, 7 by random sorting.

[0081] Step 404: Determine the arrangement order of the X sub-transition frames based on the randomly sorted candidate video segments.

[0082] Exemplarily, after randomly sorting the candidate video segments, the terminal can determine the arrangement order of the corresponding sub-transition frames in the first transition frame accordingly. Specifically, when the randomly sorted candidate video segments are obtained, the arrangement order of the sub-transition frames corresponds to the arrangement order of the candidate video segments. For example, when the candidate video segments are e3, e15, and e7, the corresponding sub-transition frames are t3-15 and t15-7.

[0083] Step 406: inserting the X sub-transition frames arranged in the arrangement order into the randomly sorted candidate video segments to obtain the target video.

[0084] For example, it can be Figure 5 As shown, the terminal may insert the X sub-transition frames arranged in the arrangement order into the randomly sorted candidate video segments to obtain the target video.

[0085] In this embodiment, by randomly sorting the candidate video segments and splicing them into the target video, it is possible to enhance the randomness of the target video content, weaken the sense of looping of the target video, and thus enhance the sense of reality of the video. Specifically, in the process of video generation, if the arrangement order of the candidate video segments is not random but has certain rules, such as playing in a loop in the order of e1, e2, e3, e1, e2, e3, the target video finally generated will have a strong sense of looping, which is unnatural and will cause the user watching the video to perceive that the video is synthesized. The scheme recorded in this embodiment can enhance the arrangement order of the candidate video segments in the target video by random sorting, thereby weakening this unnatural sense of looping, and thus enhancing the sense of reality of the synthesized target video.

[0086] In one embodiment, it can be Figure 6 As shown, the method also includes:

[0087] Step 602: Based on the deviation comparison result, the video frames in the first transition frame are arranged in descending order of similarity.

[0088] Exemplarily, after obtaining the deviation comparison result between the video frames, the terminal can arrange the video frames in the first transition frame in descending order of similarity based on the deviation comparison result. Specifically, the terminal can aggregate all the first transition frames into a large set of video frames, and then the terminal can arrange the video frames in the set of first transition frames in descending order of similarity based on the deviation comparison result. In the sequence of video frames obtained at this time, each video frame is sorted according to the deviation between it and other video frames in the set of first transition frames. The higher the ranking of the video frame, the lower the overall deviation of the video frame from the set of first transition frames.

[0089] Step 604: according to the sorting, calculate the deviation parameters between the video frames in the first transition frame and the reference standard frame, and determine the video frames whose deviation parameters are less than a preset deviation parameter threshold as standard frames.

[0090] The reference standard frame is used to identify the specific content of the video frame. The reference standard frame can be a video frame with the semantics of "initial action" pre-identified by a technician. The initial action can be a specific action of a person in the video, such as thinking, listening, and other specific static actions. The deviation parameter can refer to a quantitative parameter used to represent the degree of deviation between video frames, which can be a Euclidean distance, a cosine distance, etc. The deviation parameter threshold can refer to a threshold used to filter standard frames according to the deviation parameter, which can be set in advance by a technician.

[0091] Exemplarily, the terminal may determine one or more reference standard frames in the target video frame group, and assign semantic information to specific video frames by referring to the standard frames as a reference for selecting standard frames. The terminal may calculate the deviation parameters between the video frames in the target video frame group and the reference standard frames according to the sorting results in descending order of similarity, and determine the video frames whose deviation parameters are less than a preset deviation parameter threshold as standard frames.

[0092] Specifically, the terminal can obtain the deviation parameters between each video frame and the reference standard frame through traversal calculation until a standard frame that meets the deviation parameter threshold is selected. In special scenarios, if the standard frame cannot be selected under the current deviation parameter threshold, the deviation parameter threshold can be adjusted according to the preset adjustment method, and the traversal comparison can be performed again until it is selected. For example, the initial deviation parameter threshold is ε. If the standard frame is not found in the first traversal, ε can be increased to 1.05ε as a new ε, and traversal is performed again, and so on, until it is found. The standard frame found at this time includes both the "initial action" semantics and is also a frame that is close to the video frames in all the first transition frames.

[0093] Step 606: Generate a second transition frame between the candidate video segment and the standard frame, and generate the target video based on the first transition frame, the second transition frame, the candidate video segment, and the standard frame.

[0094] The second transition frame is used to achieve the connection between the selected candidate video segment and the standard frame. Figure 7 As shown, the terminal can generate transition material for any candidate video segment and the standard frame, and the second transition frame is obtained. In the specific generation process, a preset transition frame generation algorithm can be called for processing, and the specific generation algorithm can include an interpolation algorithm.

[0095] Specifically, when calling the interpolation algorithm, the number of transition frames to be inserted can be specified, for example, the number of transition frames is k, and the size of k depends on the required transition duration. The playback duration of each frame can be determined according to the current FPS (frames per second, Frames PerSecond) of the first video.

[0096] In the specific example, there are two candidate video segments and Taking the creation of transition material as an example, the other two candidate video segments are similar and will not be described in detail. have frame , candidate video segments have frame , the standard frame is , the standard frame S can be set before or after any candidate video segment, that is, Before, after, Before, Then. Therefore, accordingly, it can be and , and , and , and A second transition frame is generated during the transition, and the transition connection between the standard frame and the candidate video frame is achieved through the second transition frame.

[0097] In this embodiment, by determining a reference standard frame in the target video frame group, semantic information containing "initial action" is applied, and by sorting the video frames in the target video frame group by similarity, the similarity between the video frames and the target video frame group can be sorted, and the standard frames are selected in order by thresholds, so that standard frames that are close to the reference standard frame and have a small deviation from other target video frame groups can be selected. The second transition frame is generated by the selected standard frame, which can smoothly meet the transition connection between the candidate video segment and the standard frame, improve the smoothness of the digital video that needs to return to a specific initial action, and reduce splicing traces.

[0098] In one embodiment, the Figure 8 As shown, step 106 includes:

[0099] Step 802: Randomly sort the candidate video segments.

[0100] Exemplarily, the terminal may randomly sort the candidate video segments in response to the generation requirements of the target video. In a specific example, the terminal may generate a random sequence of numbers for the candidate video segments. Each number is uniquely associated with a candidate video segment. In this way, the terminal may obtain a sequence of randomly sorted candidate video segments.

[0101] Step 804: inserting target material at a target position in the randomly sorted candidate video segments.

[0102] The target material includes a first candidate video segment and / or a target standard frame. The first candidate video segment includes a video segment of a target object performing a preset action, and the target standard frame includes a video frame of a target object performing a preset action.

[0103] For example, it can be Fig. 9 as well as Fig.10 As shown, taking the first candidate video segment designated as the target material as an example, for example, in a scene where the digital human needs to switch between several states such as "listening, thinking, and answering" in an interactive video, the duration of the several states such as "listening, thinking, and answering" is random. At this time, the terminal can generate a sequence of candidate video segments in the listening state. Specifically, the random candidate video segment number sequence generated in the listening state can be: 18, 45, 9, 8, .... Then the final listening state sequence is: The above sequence will continue until the answering state is reached. Assume that the video clip of the thinking state is . When an answer is required, the digital human will first switch to the thinking state. At this time, assuming that the last video clip in the listening state is , then the video frames that follow are: Finally, when the thinking state is converted to the answering state, a video sequence of the answering state can be generated. Similar to the generation process of the target video, the terminal can generate a random candidate video segment number sequence of the answering state. For example: 3, 15, 7, 22, .... The sequence is truncated according to the required answering time. Suppose the required answering time is seconds, then a total of frames. Then the candidate video segments and transition frames corresponding to the number sequence are accumulated until the number exceeds End, that is .like , then The frames composed of are the frames corresponding to the answering video. Finally, when the digital human returns to the listening state from the answering state, the terminal can repeat the above method to generate . Start a new round of listening state.

[0104] Specifically, for example, Fig.11 as well as Fig.12 As shown, the target material can be used as a standard frame as an example. In some service-oriented digital employee scenarios, digital employees need to return to the initial action (static posture) after completing a service to express politeness. Therefore, in this type of interaction, the digital human not only needs to switch between several states such as "listening, thinking, and answering", but also needs to switch back to the initial action when appropriate. In addition to generating connections according to the above interactive video, it is also necessary to use the method of generating the second transition frame.

[0105] Exemplarily, the terminal may pre-generate a second transition frame between the candidate video segment and the standard frame. Subsequently, the terminal may generate a video sequence of the listening state. At this time, the listening state is a number of videos surrounding the initial action, and a random candidate video segment number sequence of the listening state is generated, such as: 18, 45, 9, 8, ... Then the final listening state sequence is: The sequence will continue until an answer is required. A second transition frame back to the standard frame can be randomly inserted in the middle to show politeness. In this case, the sequence after the second transition frame back to the standard frame is: In the scenario where the listening state is converted to thinking, a video sequence of the thinking state is generated. When an answer is required, the digital human will first switch to the thinking state. At this time, it is assumed that the last video clip of the listening state is , then the frames that follow are: ,in is a video clip in the thinking state. Then, in the process of converting from the thinking state to the answering state, the terminal can generate a video sequence in the answering state. Similar to the generation of the target video, a random candidate video segment number sequence for the answering state is generated. For example: 3, 15, 7, 22, .... The sequence is truncated according to the required answering time. Suppose the required answering time is seconds, then a total of Frames. Accumulate the candidate video segments and the first transition frames and the second transition frames corresponding to the number sequence until the number exceeds End, that is .like , then The frames composed of are the frames corresponding to the answer video. Finally, the answer state is switched to the initial action. Assume that the last video clip of the answer state is , then the frames that follow are: . Then return to the listening state from the initial action state. Similar to the above process, generate . Start a new round of listening state. In a specific interaction scenario, the terminal plays the video sequence of the listening state in the target video to guide the user to ask questions. After the user asks a question, the terminal plays the video sequence of the thinking state in the target video, and then plays the video sequence of the answering state in the target video to answer the user's question, forming a complete question-and-answer interaction. After that, the terminal can return to the listening state to guide the user to a new round of question-and-answer interaction. In such an interaction of listening, thinking, answering, listening, thinking, answering..., the listening state is the initial action of the interaction process.

[0106] Step 806: Based on the first transition frame and the second transition frame, the candidate video segments after the target material is inserted are spliced ​​to obtain the target video.

[0107] Exemplarily, the terminal may splice the candidate video segments after the target material is inserted based on the first transition frame and the second transition frame to obtain the target video.

[0108] In this embodiment, by inserting specific target materials into a random sequence of candidate video segments, any video segment can be connected to a specified video segment, and at the same time, the specified segment can be connected to the next random video segment. In some scenes, the digital employee can also return to the initial action specified by the standard frame after completing a video segment. Thus, while improving the randomness of the target video and enhancing the realism of the video, the functionality and editability of the target video are enhanced. Specifically, after enhancing the realism of the target video by randomly sorting the candidate video segments, any video segment can be inserted at the desired position, which will not affect the overall randomness of the target video, so the effect of enhancing the realism can be retained while enhancing the functionality of the target video.

[0109] In one embodiment, the Fig.13 As shown, the method also includes:

[0110] Step 1302: Identify the candidate video segment and the standard frame to obtain first identification information of the candidate video segment and second identification information of the standard frame.

[0111] Exemplarily, the terminal may identify the candidate video segment and the standard frame, thereby obtaining first identification information associated with the candidate video segment and second identification information associated with the standard frame. Specifically, the identification method may be a number, a string, etc., to give a unique identification to the candidate video segment and the standard frame.

[0112] Step 1304: Generate third identification information having a first index relationship with the first identification information, and identify the first transition frame based on the third identification information.

[0113] The first index relationship may refer to determining the index relationship of the first transition frame related to the splicing of any two candidate video segments.

[0114] Exemplarily, the terminal may generate third identification information having a first index relationship with the first identification information, and identify the first transition frame based on the third identification information. For example, when the identification information of two candidate video segments is 1 and 2 respectively, the identification information of the first transition frame connecting the two candidate video segments in this order is 1-2, and the identification information 1-2 can be used to know that the first transition frame is located between candidate video segment 1 and candidate video segment 2.

[0115] Step 1306: Generate fourth identification information having a second index relationship with the first identification information and the second identification information, and identify the second transition frame based on the fourth identification information.

[0116] The second index relationship may refer to an index relationship of a second transition frame related to the splicing of the candidate video segment and the standard frame determined by any candidate video segment and any standard frame.

[0117] Exemplarily, the terminal may generate fourth identification information having a second index relationship with the first identification information and the second identification information, and identify the second transition frame based on the fourth identification information. For example, when the first identification information of the candidate video segment is 1 and the second identification information of the standard frame is a, the identification information of the second transition frame connecting the candidate video segment and the standard frame in this order is 1-a, and the identification information 1-a can be used to know that the second transition frame is located between the candidate video segment 1 and the standard frame a.

[0118] In this embodiment, step 606 includes:

[0119] Step 1308: Based on the first identification information of the candidate video segment used to generate the target video and the second identification information of the standard frame, determine the third identification information of the first transition frame to be called and the fourth identification information of the second transition frame to be called.

[0120] Exemplarily, after pre-configuring identification information for the candidate video segment, the standard frame, the first transition frame, and the second transition frame, the terminal may determine the third identification information of the first transition frame to be called and the fourth identification information of the second transition frame to be called based on the first identification information of the candidate video segment used to generate the target video and the second identification information of the standard frame.

[0121] Step 1310: Call the first transition frame based on the third identification information, and call the second transition frame based on the fourth identification information, and generate the target video.

[0122] Exemplarily, the terminal may call the first transition frame based on the third identification information and the second transition frame based on the fourth identification information in response to a request to generate the target video, and generate the target video.

[0123] In this embodiment, by identifying the candidate video segment, the standard frame, the first transition frame and the second transition frame, it is helpful to index and call the first transition frame and the second transition frame through the identification information when the target video needs to be generated, thereby improving the generation efficiency of the target video.

[0124] In one embodiment, the Fig.14 As shown, step 106 includes:

[0125] Step 1402: Determine a first duration of the generated target video.

[0126] The first duration may refer to the total duration of the target video directly obtained by generation.

[0127] Exemplarily, when generating a target video, the terminal may first obtain a first duration of the generated target video.

[0128] Step 1404: If the first duration is greater than a preset duration threshold, determine a first video frame sequence of the target video, where the video frame sequence includes M video frames.

[0129] The preset duration threshold is a duration value corresponding to the generation requirement of the target video.

[0130] Exemplarily, if the first duration of the target video directly generated is greater than the preset duration threshold, it can be determined that the duration of the directly generated target video does not meet the generation requirement. Accordingly, the terminal can determine a first video frame sequence of the target video, and the video frame sequence includes M video frames.

[0131] Step 1406: Based on the preset duration threshold, N video frames are selected from the M video frames to obtain a second video frame sequence, where the N video frames include the first transition frame, the second transition frame and the standard frame.

[0132] The N video frames include a first transition frame, a second transition frame and a standard frame; or the N video frames include at least one of the first transition frame, the second transition frame and the standard frame, so that a smooth transition of the video can be ensured.

[0133] Exemplarily, the terminal may select N video frames from M video frames based on a preset duration threshold to obtain a second video frame sequence.

[0134] Step 1408: Based on the second video frame sequence, generate a video whose duration is less than or equal to the preset duration threshold, and use the generated video whose duration is less than or equal to the preset duration threshold as a new target video.

[0135] Exemplarily, the terminal may generate a video whose duration is less than or equal to the preset duration threshold based on the second video frame sequence, and use the generated video whose duration is less than or equal to the preset duration threshold as a new target video.

[0136] Specifically, you can Fig.15 As shown, the terminal can intercept the first video sequence with a total number of frames M to obtain a second video frame sequence with a total number of frames N. Wherein, both M and N are positive numbers, N is less than or equal to M, and N corresponds to the generation requirement.

[0137] Specifically, assuming that the target video duration to be generated is F seconds, a total of N = FPS * F frames are required. Accumulate the corresponding candidate video segments, first transition frames, second transition frames, and standard frames until they exceed N. The end point can be a certain video frame in a candidate video segment, that is, .like , then The composed frames are the frames corresponding to the long video.

[0138] In this embodiment, by generating a long video and intercepting it to obtain a target video of the required duration, it is helpful to improve the flexibility of the video generation process, so that the generated video can meet different duration requirements. Specifically, in the process of intercepting the generated long video to the target video of the required duration, the duration of the target video can be determined according to the generation requirements of the target video, such as 5 minutes, 10 minutes, etc. The length of the generated long video can be set by a technician, and it only needs to be greater than the duration required for the target video. In this way, a long video of a duration of can be intercepted from the head and / or tail to obtain a target video of a duration of.

[0139] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0140] Based on the same inventive concept, the embodiment of the present application also provides a video generation device for implementing the above-mentioned video generation method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more embodiments of the video generation device provided below can refer to the above-mentioned limitations on a video generation method, and will not be repeated here.

[0141] In one embodiment, Fig.16 As shown, a video generation device is provided, comprising: a target video frame group module, a first video frame module, a video segmentation module and a video generation module, wherein:

[0142] A target video frame group module, used to determine a target video frame group of the first video, wherein the target video frame group includes video frames selected from a second sampled video segment, wherein the second sampled video segment is a video segment in the first video that satisfies a preset smoothness constraint condition;

[0143] A first video frame module, configured to determine a first video frame according to a deviation comparison result between video frames in the target video frame group;

[0144] A video segmentation module, configured to segment the first video based on the first video frame to obtain candidate video segments;

[0145] The video generation module is used to generate a first transition frame between the candidate video segments, and generate a target video based on the first transition frame and the candidate video segments.

[0146] In one embodiment, the first video frame module is further used for:

[0147] Performing target detection on the first video, and determining sampling points according to the detected target object;

[0148] Sliding sampling is performed on the first video based on a preset sampling window to obtain a sampled video segment;

[0149] Determining a smoothness discrimination parameter of the sampled video segment according to the sampling point;

[0150] The sampled video segment is selected according to the smoothness discrimination parameter, and the video frames in the selected sampled video segment are determined as the target video frame group.

[0151] In one embodiment, the video generation module is further used for:

[0152] Randomly sorting the candidate video segments;

[0153] Sort the X sub-transition frames based on the arrangement order of the randomly sorted candidate video segments;

[0154] The sorted X sub-transition frames are inserted into the randomly sorted candidate video segments to obtain the target video.

[0155] In one embodiment, the device further comprises:

[0156] A video frame sorting module, configured to sort the video frames in the first transition frame in descending order of similarity based on the deviation comparison result;

[0157] A standard frame module, configured to calculate deviation parameters between the video frames in the target video frame group and the reference standard frames according to the sorting, and determine the video frames whose deviation parameters are less than a preset deviation parameter threshold as standard frames;

[0158] A generating module is used to generate a second transition frame between the candidate video segment and the standard frame, and generate the target video based on the first transition frame, the second transition frame, the candidate video segment and the standard frame.

[0159] In one embodiment, the video generation module is further used for:

[0160] Randomly sorting the candidate video segments;

[0161] Inserting a target material at a target position in the randomly sorted candidate video segments, wherein the target material includes a first candidate video segment and / or a target standard frame, wherein the first candidate video segment includes a video segment of a target object performing a preset action, and the target standard frame includes a video frame of the target object performing a preset action;

[0162] Based on the first transition frame and the second transition frame, the candidate video segments after the target material is inserted are connected to obtain the target video.

[0163] In one embodiment, the device further comprises:

[0164] A first identification module, used for identifying the candidate video segment and the standard frame to obtain first identification information of the candidate video segment and second identification information of the standard frame;

[0165] a first indexing module, configured to generate third identification information having a first index relationship with the first identification information, and identify the first transition frame based on the third identification information;

[0166] a second indexing module, configured to generate fourth identification information having a second index relationship with the first identification information and the second identification information, and identify the second transition frame based on the fourth identification information;

[0167] The generating module comprises:

[0168] A calling module, configured to determine third identification information of a first transition frame to be called and fourth identification information of a second transition frame to be called based on first identification information of the candidate video segment used to generate the target video and second identification information of the standard frame;

[0169] A calling generation module is used to call the first transition frame based on the third identification information and the second transition frame based on the fourth identification information, and generate the target video.

[0170] In one embodiment, the video generation module is further used for:

[0171] Determine a first duration of the generated target video;

[0172] If the first duration is greater than a preset duration threshold, determining a first video frame sequence of the target video, the video frame sequence including M video frames;

[0173] Based on the preset duration threshold, N video frames are selected from the M video frames to obtain a second video frame sequence, where the N video frames include the first transition frame, the second transition frame, and the standard frame;

[0174] Based on the second video frame sequence, a video whose duration is less than or equal to the preset duration threshold is generated, and the generated video whose duration is less than or equal to the preset duration threshold is used as a new target video.

[0175] Each module in the above-mentioned video generation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0176] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.17 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a video generation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0177] Those skilled in the art will understand that Fig.17 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0178] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0179] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0180] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0181] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0182] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0183] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0184] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A video generation method, characterized in that: The method comprises: Determine a target video frame group of the first video, the target video frame group includes video frames selected from a second sampled video segment, the second sampled video segment is a video segment in the first video that satisfies a preset smoothness constraint condition; Determining a first video frame according to a deviation comparison result between video frames in the target video frame group; Cutting the first video based on the first video frame to obtain candidate video segments; A first transition frame between the candidate video segments is generated, and a target video is generated based on the first transition frame and the candidate video segments.

2. The method according to claim 1, characterized in that The preset smoothness constraint condition includes a smoothness discrimination parameter; and determining a target video frame group of the first video includes: Performing target detection on the first video, and determining sampling points according to the detected target object; Sliding sampling is performed on the first video based on a preset sampling window to obtain a first sampled video segment; Determining a smoothness discrimination parameter of the first sampled video segment according to the sampling point; A second sampled video segment is selected from the first sampled video segment according to the smoothness discrimination parameter, and the video frames in the target video frame group include the video frames selected from the second sampled video segment.

3. The method according to claim 1, characterized in that The first transition frame includes X sub-transition frames; and generating a target video based on the first transition frame and the candidate video segment includes: Randomly sorting the candidate video segments; Sort the X sub-transition frames based on the arrangement order of the randomly sorted candidate video segments; The sorted X sub-transition frames are inserted into the randomly sorted candidate video segments to obtain the target video.

4. The method according to claim 1, characterized in that: The method further comprises: Based on the deviation comparison result, the video frames in the first transition frame are arranged in descending order of similarity; According to the sorting, calculating the deviation parameter between the video frame in the first transition frame and the reference standard frame, and determining the video frame whose deviation parameter is less than a preset deviation parameter threshold as the standard frame; A second transition frame is generated between the candidate video segment and the standard frame, and the target video is generated based on the first transition frame, the second transition frame, the candidate video segment, and the standard frame.

5. The method according to claim 4, characterized in that The generating a target video based on the first transition frame and the candidate video segment comprises: Randomly sorting the candidate video segments; Inserting a target material at a target position in the randomly sorted candidate video segments, wherein the target material includes a first candidate video segment and / or a target standard frame, wherein the first candidate video segment includes a video segment of a target object performing a preset action, and the target standard frame includes a video frame of the target object performing a preset action; Based on the first transition frame and the second transition frame, the candidate video segments after the target material is inserted are spliced ​​to obtain the target video.

6. The method according to claim 4, characterized in that The method further comprises: Identify the candidate video segment and the standard frame to obtain first identification information of the candidate video segment and second identification information of the standard frame; generating third identification information having a first index relationship with the first identification information, and identifying the first transition frame based on the third identification information; generating fourth identification information having a second index relationship with the first identification information and the second identification information, and identifying the second transition frame based on the fourth identification information; The generating the target video based on the first transition frame, the second transition frame, the candidate video segment and the standard frame includes: Determining third identification information of a first transition frame to be called and fourth identification information of a second transition frame to be called based on first identification information of the candidate video segment used to generate the target video and second identification information of the standard frame used to generate the target video; The first transition frame is called based on the third identification information, and the second transition frame is called based on the fourth identification information, and the target video is generated.

7. The method according to any one of claims 1 to 5, characterized in that The generating of the target video comprises: Determine a first duration of the generated target video; If the first duration is greater than a preset duration threshold, determining a first video frame sequence of the target video, the video frame sequence including M video frames; Based on the preset duration threshold, N video frames are selected from the M video frames to obtain a second video frame sequence, where the N video frames include the first transition frame, the second transition frame, and the standard frame; Based on the second video frame sequence, a video whose duration is less than or equal to the preset duration threshold is generated, and the generated video whose duration is less than or equal to the preset duration threshold is used as a new target video.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the video generation method according to any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the video generation method according to any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the video generation method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Video stitching method and device of array camera, and medium

    CN121486699A

  • Video stitching methods, equipment and media for array cameras

    CN121486699B