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

By obtaining and analyzing the camera parameters and time correlation of the video frame, a video with a specific mirror effect is generated, solving the problem of users who need professional skills to shoot high -quality mirror videos, and realize the automation generating high -quality mirror video video. Effect.

CN119364142APending Publication Date: 2025-01-24BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411525491.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, users need to have professional shooting skills to capture high-quality mirror-moving videos by controlling camera movements. Users who lack professional skills find it difficult to generate high-quality mirror-moving videos.

Method used

By obtaining the first video and the target camera movement type, the target camera parameter characteristics are determined, the camera parameters corresponding to the video frames and their temporal correlation are characterized, and a second video with camera movement corresponding to the target camera movement type is generated based on these characteristics.

Benefits of technology

A video of accurately control the camera view of the camera during the video generation, automated the effect of automating the effect of high -quality mirrors, and reducing the dependence on professional shooting skills.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119364142A_ABST
    Figure CN119364142A_ABST
Patent Text Reader

Abstract

The invention relates to a video generation method and device, a medium, electronic equipment and a program product, and the method comprises the steps: obtaining a first video and a target moving mirror type, and enabling the target moving mirror type to carry camera parameters corresponding to video frames in the first video; according to the camera parameters corresponding to the video frames in the first video, target camera parameter features are determined, and the target camera parameter features are used for representing the time correlation between the camera parameters corresponding to the video frames in the first video and the camera parameters between the different video frames; according to the first video and the target camera parameter characteristics, generating a second video with a moving mirror corresponding to the target moving mirror type, not only considering camera parameters corresponding to video frames in the first video, but also considering time correlation of the camera parameters among different video frames in the first video; therefore, the visual angle of the camera is accurately controlled in the video generation process, and automatic generation of the mirror moving video with a high-quality mirror moving effect is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of electronic information technology, and in particular, to a video generation method, device, medium, electronic device and program product. Background Art

[0002] In movies, TV shows, short videos and other videos, there are usually camera effects such as screen rotation and screen advancement. In related technologies, users need to hold a shooting device and track the shooting target by controlling the movement of the camera of the shooting device, so as to shoot a video with camera effects. This shooting method can be referred to as camera movement. Professional shooting skills are required to control the speed and stability of the camera movement, so as to shoot a camera video with high-quality camera effects. For users without professional shooting skills, it is difficult to shoot a camera video with high-quality camera effects. Summary of the invention

[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, the present disclosure provides a video generation method, comprising: Obtaining a first video and a target camera movement type, wherein the target camera movement type carries camera parameters corresponding to a video frame in the first video; Determine target camera parameter features according to camera parameters corresponding to the video frames in the first video, where the target camera parameter features are used to characterize the camera parameters corresponding to the video frames in the first video and the temporal correlation of the camera parameters between different video frames; A second video having a camera movement corresponding to the target camera movement type is generated according to the first video and the target camera parameter characteristics.

[0005] In a second aspect, the present disclosure provides a video generation device, comprising: An acquisition module is configured to acquire a first video and a target camera movement type, wherein the target camera movement type carries camera parameters corresponding to a video frame in the first video; a determination module configured to determine target camera parameter features according to camera parameters corresponding to the video frames in the first video, wherein the target camera parameter features are used to characterize the camera parameters corresponding to the video frames in the first video and the temporal correlation of the camera parameters between different video frames; A generating module is configured to generate a second video having a camera movement corresponding to the target camera movement type according to the first video and the target camera parameter characteristics.

[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when the computer program is executed by a processing device.

[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method in the first aspect.

[0008] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0009] Through the above technical solution, during the video generation process, not only the camera parameters corresponding to the video frames in the first video are considered, but also the time correlation of the camera parameters between different video frames is considered, so that the camera viewing angle can be accurately controlled during the video generation process, and the automatic generation of camera movement videos with high-quality camera movement effects is achieved.

[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 The figure is a flowchart of a video generating method according to an exemplary embodiment of the present disclosure.

[0012] Figure 2 It is a schematic diagram of a training process of a video generation model according to an exemplary embodiment of the present disclosure.

[0013] Figure 3 It is a block diagram of a video generating device according to an exemplary embodiment of the present disclosure.

[0014] Figure 4 It is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0016] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0017] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0018] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0019] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0020] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0021] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0022] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0023] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0024] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0025] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0026] In the related art, professional shooting skills are required to control the speed and stability of the camera movement well, so as to shoot a camera movement video with high-quality camera movement effects. For users without professional shooting skills, it is difficult to shoot a camera movement video with high-quality camera movement effects.

[0027] In view of this, the embodiments of the present disclosure provide a video generation method, device, medium, electronic device and program product, which accurately control the viewing angle of the camera during the video generation process and realize the automatic generation of videos with camera movement effects.

[0028] The embodiments of the present disclosure are further explained and illustrated below in conjunction with the accompanying drawings.

[0029] Figure 1 is a flowchart of a video generation method according to an exemplary embodiment of the present disclosure, the video generation method can be applied to an electronic device, and the method can be executed by a video generation device, wherein the video generation device can be implemented by software and / or hardware and can be configured in the electronic device. Figure 1 , the video generation method may include the following steps: Step 110, obtaining a first video and a target camera movement type, wherein the target camera movement type carries camera parameters corresponding to video frames in the first video.

[0030] The first video may be a video containing a preset number of frames obtained by preprocessing a video or image uploaded by a user. Among them, the target camera movement type can be specified by the user. After the user specifies the target camera movement type, the electronic device can generate camera parameters corresponding to the video frames in the first video according to the target camera movement type. The camera parameter sequence composed of the camera parameters corresponding to all video frames in the first video is used to describe the posture information of the camera during movement.

[0031] The target camera movement type can be specified from the following candidate camera movement types. Introducing the camera movement of the candidate camera movement type during the video generation process can achieve camera movement effects such as rotation, zooming, and translation of the image in the shot. The following introduces the playback effects of videos with camera movements corresponding to the candidate camera movement types for different candidate camera movement types.

[0032] 1) Push-in type. The camera movement corresponding to the push-in type can be understood as the camera moving farther away during the shooting process. The camera movement corresponding to the push-in type can present a process of gradually transforming from a larger scene to a local close-up scene, that is, the subject of the video can present a dynamic change process from small to large.

[0033] 2) The pull-in type is the opposite of the push-in type. It involves the camera zooming in during the shooting process. The pull-in type can present a process of gradual transition from a close-up to a distant view, and the subject being photographed can present a dynamic change from large to small.

[0034] 3) Rotation type: The camera rotates around one of its axes during the shooting process, and the subject being photographed rotates and changes in the picture.

[0035] The camera parameters may include at least one of the external parameters of the camera and the internal parameters of the camera. The external parameters of the camera are used to describe the position and direction of the camera in the world coordinate system, which are used to control the posture of the camera. The internal parameters of the camera are parameters that describe the characteristics of the camera itself, and the internal parameters may be focal length and principal point, etc. It is understandable that when the camera parameters include multiple parameters, the superposition of the camera movement can be achieved, for example, the dynamic change of the photographed subject from large to small is accompanied by a rotation change.

[0036] Step 120, determining target camera parameter features according to camera parameters corresponding to video frames in the first video, where the target camera parameter features are used to characterize the camera parameters corresponding to the video frames in the first video and the temporal correlation of camera parameters between different video frames.

[0037] It should be understood that the target camera parameter feature is an encoded representation of the camera parameters corresponding to the video frame.

[0038] Step 130: Generate a second video having a camera movement corresponding to the target camera movement type according to the first video and the target camera parameter characteristics.

[0039] It should be understood that the second video can be obtained by adding camera movements corresponding to the target camera movement type to the first video.

[0040] Through the above technical solution, during the video generation process, not only the camera parameters corresponding to the video frames in the first video are considered, but also the time correlation of the camera parameters between different video frames in the second video is considered, so that the camera viewing angle can be accurately controlled during the video generation process, and the automatic generation of camera movement videos with high-quality camera movement effects is achieved.

[0041] In some embodiments, the video frame may be each video frame in the first video. In other embodiments, the video frame may be a portion of the video frames in the first video, which is not limited in this embodiment.

[0042] In some embodiments, the step of determining the target camera parameter characteristics based on the camera parameters corresponding to the video frames in the first video can be implemented in the following manner: determining the camera parameter embedding representation based on the camera parameters corresponding to the video frames in the first video; encoding the camera parameter embedding representation through an encoder based on a temporal attention mechanism to obtain the target camera parameter characteristics.

[0043] The camera parameter embedding representation can be characterized by providing a geometric interpretation of each pixel in the first video in three-dimensional space. For example, the camera parameter embedding representation can be represented by a vector B*F*6*H*W, where B represents the number of first videos, that is, B is 1 in this embodiment, F represents the number of video frames in the second video, 6 represents six dimensions, and H*W represents the size of each video frame in the first video. The camera parameter embedding representation provides a six-dimensional vector for each pixel, which contains the direction and position information of the line segment from the camera center to the pixel, so that the camera posture information is fully expressed in each frame of the first video.

[0044] The encoder is an encoder including a temporal attention mechanism. As an example, the encoder may include a convolutional layer and a temporal attention layer, wherein the convolutional layer is used to encode the camera parameters corresponding to the video frames in the first video represented in the camera parameter embedding representation, and the temporal attention layer may capture the temporal relationship between the camera parameters corresponding to the video frames in the first video represented in the camera parameter embedding representation.

[0045] In the above manner, the encoder based on the temporal attention mechanism encodes the camera parameter embedding representation to obtain target camera parameter features for characterizing the camera parameters corresponding to the video frames in the first video and the temporal correlation of the camera parameters between different video frames in the first video, thereby providing a basis for accurately controlling the camera based on the camera parameters when subsequently generating the second video.

[0046] In some embodiments, the step of encoding the camera parameter embedding representation through an encoder based on a temporal attention mechanism to obtain target camera parameter features can be implemented in the following manner: encoding the camera parameter embedding representation through convolutional layers of different scales in the encoder to obtain first features of the corresponding scale output by the convolutional layer, and the first features are used to characterize the camera parameters corresponding to the video frames in the first video; encoding the corresponding first features through the temporal attention layers corresponding to the convolutional layers in the encoder to obtain second features of the corresponding scale output by the temporal attention layer, and the second features are used to characterize the temporal correlation of the camera parameters between different video frames in the first video; and obtaining the target camera parameter features based on all the first features and all the second features.

[0047] It should be understood that the target camera parameter feature is a multi-scale feature. The encoder includes multiple convolutional layers and a temporal attention layer corresponding to each convolutional layer. Different convolutional layers and temporal attention layers can extract features of different scales. As an example, the encoder includes three convolutional layers and a temporal attention layer corresponding to each convolutional layer.

[0048] In the above manner, the encoder obtains features of the camera parameters of the video frames in the first video and the time correlation of the camera parameters between different video frames in the first video at different scales, thereby improving the feature expression capability of the camera parameters, thereby providing a basis for accurately controlling the camera based on the camera parameters when subsequently generating the second video.

[0049] In some embodiments, the step of generating a second video having camera movement corresponding to a target camera movement type based on the first video and the target camera parameter features may include: determining a picture embedding vector corresponding to the picture features of the first video, and a camera parameter embedding vector corresponding to the target camera parameter features; performing a diffusion process based on the picture embedding vector and the camera parameter embedding vector through a pre-generated video generation model to generate a second video carrying camera movement corresponding to the target camera movement type; wherein the diffusion process includes a noise addition process and a denoising process, the camera parameter embedding vector is injected into the temporal attention layer involved in the denoising process of the video generation model in a manner based on a temporal attention mechanism, the noise addition process is used to perform noise processing on the picture embedding vector, and the denoising process is used to generate a denoised second video based on the camera parameter embedding vector and the denoised picture embedding vector.

[0050] It should be understood that the picture embedding vector is a vectorized representation of the picture features of the video frame in the first video; the camera parameter embedding vector is a vectorized representation of the target camera parameter features. These vectorized representations can be obtained by processing the input data through a network layer for outputting vector representations. The network layer here is hereinafter referred to as the embedding module, and the embedding module can be integrated into the video generation model.

[0051] Among them, the video generation model can be a model based on the U-Net architecture. Similar to the above-mentioned embedding module, the above-mentioned encoder can be integrated into the video generation model, so that when the model is trained, the encoder, the embedding module and the U-Net architecture model can be jointly trained to improve the performance of the model. In addition, the training method of the video generation model can refer to the following embodiment, which will not be described in detail in this embodiment.

[0052] Since the movement of the camera usually causes changes in the picture between frames, through the above method, consider injecting the camera parameter embedding vector into the temporal attention layer involved in the denoising process of the video generation model in a manner based on the temporal attention mechanism, thereby improving the control ability of the camera motion in the entire video generation process.

[0053] In some embodiments, the above-mentioned video generation model is a model generated based on the following method: obtaining a training sample set, the training sample set includes multiple sample video data, the sample video data includes a sample camera video and sample camera parameters corresponding to a sample video frame in the sample camera video, the sample camera video is a camera video including a foreground motion image or a camera video not including a foreground motion image; training the initial model according to the training sample set to obtain a video generation model.

[0054] It should be understood that the foreground motion image refers to the image of the target moving in the foreground part of the video (i.e. the area closest to the camera), where the target can be a person or an animal, etc., and the motion can be the movement of the target in the picture. The camera-operated video containing the foreground motion image not only includes the moving target, but also captures the picture by moving the camera. The camera-operated video without the foreground motion image generally only includes the background image, and there is no moving target in the picture. The picture is captured by moving the camera (i.e. camera movement), thereby obtaining the camera-operated video without the foreground motion image.

[0055] The sample camera parameters include at least one of the camera's external parameters and the camera's internal parameters.

[0056] As can be seen from the above content, the above embedding module and encoder can be integrated into the video generation model. Therefore, corresponding to the model training process, the initial model can include the initial embedding module, the initial encoder and the model of the initial U-Net architecture. The initial embedding module, the initial encoder and the model of the initial U-Net architecture are jointly trained based on the training sample set to generate the video generation model. It can be understood that the initial embedding module, the initial encoder and the initial U-Net architecture are similar in function and structure to the above embedding module, the initial encoder and the initial U-Net architecture.

[0057] Figure 2 FIG. 1 is a schematic diagram of a training process of a video generation model according to an exemplary embodiment of the present disclosure. Figure 2 The initial model may include an initial embedding module, an initial encoder, and a model of an initial U-Net architecture, wherein the initial embedding module includes a first embedding module, a second embedding module, and a third embedding module. The training process of the model involved in the embodiment of the present disclosure is exemplarily described with reference to Figure 2 , the training process of the video generation model can be: First, the sample camera parameters are processed by the first embedding module to obtain the sample camera parameter embedding representation, and then the sample camera parameter embedding representation is encoded by the initial encoder to determine the corresponding sample camera parameter features, wherein the sample camera parameter embedding representation and the camera parameter embedding representation have the same physical meaning, and the sample camera parameter features and the target camera parameter features have the same physical meaning, which can be referred to the explanation and description of the above camera parameter embedding representation and the target camera parameter features.

[0058] Next, the second embedding module is used to process the sample camera parameter features to obtain a sample camera parameter embedding vector, and the third embedding module is used to process the sample camera motion video to obtain a sample picture embedding vector, wherein the sample camera parameter embedding vector has the same physical meaning as the camera parameter embedding vector, and the sample picture embedding vector has the same physical meaning as the picture embedding vector. For related explanations, please refer to the explanations and descriptions of the above-mentioned camera parameter embedding vector and picture embedding vector.

[0059] Next, a denoising process and a denoising process are performed based on the sample camera parameter embedding vector and the sample picture embedding vector through the initial U-Net architecture to generate a predicted camera movement video carrying the camera movement corresponding to the sample camera parameters, and a loss value is determined based on the difference between the predicted camera movement video and the sample camera movement video. The parameters of the above-mentioned initial embedding module, initial encoder and initial U-Net architecture are iteratively updated based on the loss value until the stop iteration condition is met, and the initial embedding module, initial encoder and initial U-Net architecture when the stop iteration condition is met are used as the generated video generation model.

[0060] Among them, the condition for stopping the iteration may be that the loss value is less than a preset threshold, or the number of iterations of the parameters of the initial embedding module, the initial encoder and the initial U-Net architecture reaches a preset number, which is not described in detail in this embodiment.

[0061] In other embodiments, a loss value may be determined based on the difference between the noise used in the denoising process and the noise predicted in the denoising process, and the parameters of the initial embedding module, the initial encoder, and the initial U-Net architecture may be iteratively updated based on the loss value until the iteration stop condition is met.

[0062] Through the above method, sample camera videos including foreground motion images and sample camera videos excluding foreground motion images are constructed and used together for model training, so as to avoid the model learning the bias that there is no foreground motion in some camera videos; in addition, the sample camera parameters include at least one of the camera's extrinsic parameters and the camera's intrinsic parameters. In particular, the sample camera parameters include the camera's extrinsic parameters and the camera's intrinsic parameters, so as to improve the richness of the sample video data, and then improve the generalization of the model trained based on the sample video data.

[0063] In some embodiments, before the initial model is trained according to the training sample set to obtain the video generation model, the video generation method may further include: deleting the target sample video data in the training sample set to obtain an updated training sample set, wherein the sample camera video corresponding to the target sample video data is a camera video with a sudden change in the screen content. On this basis, the initial model is trained based on the updated training sample set to obtain the video generation model.

[0064] Among them, feature extraction can be performed on adjacent frames in the sample camera-moving video, and the similarity between adjacent frames can be calculated based on the extracted features. When the similarity corresponding to any adjacent frames is less than or equal to a preset similarity threshold, the sample camera-moving video is determined to be a camera-moving video with a sudden change in screen content, that is, the corresponding sample video data is the target sample video data. When the similarities corresponding to all adjacent frames are greater than the preset similarity threshold, the sample camera-moving video is determined to be a camera-moving video without a sudden change in screen content, that is, the corresponding sample video data is not the target sample video data.

[0065] It should be understood that for camera movement videos with sudden changes in picture content, the changes are sudden and cannot be characterized by camera parameters. Therefore, such sample videos are noise data. Therefore, through the above method, camera movement videos with sudden changes in picture content are detected and deleted to reduce noise during model training, thereby improving the performance of the trained model.

[0066] Based on the same inventive concept, the embodiment of the present disclosure also provides a video generating device, Figure 3 is a block diagram of a video generating device according to an exemplary embodiment of the present disclosure, referring to Figure 3 , the video generating device 300 comprises: An acquisition module 301 is configured to acquire a first video and a target camera movement type, wherein the target camera movement type carries camera parameters corresponding to a video frame in the first video; A determination module 302 is configured to determine a target camera parameter feature according to the camera parameters corresponding to the video frames in the first video, wherein the target camera parameter feature is used to characterize the camera parameters corresponding to the video frames in the first video and the temporal correlation of the camera parameters between different video frames; The generating module 303 is configured to generate a second video having a camera movement corresponding to the target camera movement type according to the first video and the target camera parameter characteristics.

[0067] Optionally, the determining module 302 includes: A first determination submodule is configured to determine a camera parameter embedding representation according to camera parameters corresponding to the video frame in the first video; The encoding submodule is configured to encode the camera parameter embedding representation through an encoder based on a temporal attention mechanism to obtain target camera parameter features.

[0068] Optionally, the encoding submodule is further configured as follows: Encoding the camera parameter embedding representation through convolution layers of different scales in an encoder to obtain a first feature of a corresponding scale output by the convolution layer, wherein the first feature is used to characterize a camera parameter corresponding to the video frame in the first video; Encoding the corresponding first features through the temporal attention layers respectively corresponding to the convolutional layers in the encoder to obtain second features of the corresponding scale output by the temporal attention layers, where the second features are used to characterize the temporal correlation of camera parameters between different video frames in the first video; A target camera parameter feature is obtained according to all the first features and all the second features.

[0069] Optionally, the generating module 303 includes: A second determination submodule is configured to determine a picture embedding vector corresponding to the picture feature of the first video and a camera parameter embedding vector corresponding to the target camera parameter feature; A generation submodule is configured to perform a diffusion process based on the picture embedding vector and the camera parameter embedding vector through a pre-generated video generation model to generate a second video carrying a camera movement corresponding to the target camera movement type; Among them, the diffusion process includes a denoising process and a denoising process, the camera parameter embedding vector is injected into the temporal attention layer involved in the denoising process of the video generation model in a manner based on a temporal attention mechanism, the denoising process is used to perform denoising on the picture embedding vector, and the denoising process is used to generate a denoised second video based on the camera parameter embedding vector and the picture embedding vector after the denoising process.

[0070] Optionally, the video generation model is a model generated based on the following method: Acquire a training sample set, the training sample set including a plurality of sample video data, the sample video data including a sample camera movement video and sample camera parameters corresponding to a sample video frame in the sample camera movement video, the sample camera movement video being a camera movement video including a foreground motion image or a camera movement video not including a foreground motion image; The initial model is trained according to the training sample set to obtain the video generation model.

[0071] Optionally, the video generating device 300 further includes: A deletion module is configured to delete the target sample video data in the training sample set to obtain an updated training sample set, wherein the sample camera movement video corresponding to the target sample video data is a camera movement video with a sudden change in picture content, and the initial model is trained based on the updated training sample set to obtain the video generation model.

[0072] Optionally, the camera parameters include at least one of the following: The camera's external parameters; The camera's intrinsic parameters.

[0073] The implementation of each module in the above-mentioned video generating device 300 may refer to the above-mentioned method embodiment, and this embodiment will not be described in detail here.

[0074] Based on the same inventive concept, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processing device, the steps of the above method are implemented.

[0075] Based on the same inventive concept, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0076] Based on the same inventive concept, the present disclosure also provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the above method.

[0077] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 400 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0078] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0079] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0080] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0081] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0082] In some embodiments, the electronic devices may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0083] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0084] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a first video and a target camera movement type, wherein the target camera movement type carries camera parameters corresponding to video frames in the first video; determines target camera parameter characteristics according to the camera parameters corresponding to the video frames in the first video, wherein the target camera parameter characteristics are used to characterize the camera parameters corresponding to the video frames in the first video and the temporal correlation of the camera parameters between different video frames; generates a second video having camera movement corresponding to the target camera movement type according to the first video and the target camera parameter characteristics.

[0085] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0086] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0087] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.

[0088] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0089] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0090] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0091] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0092] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A video generation method, characterized in that: include: Obtaining a first video and a target camera movement type, wherein the target camera movement type carries camera parameters corresponding to a video frame in the first video; Determine target camera parameter features according to camera parameters corresponding to the video frames in the first video, where the target camera parameter features are used to characterize the camera parameters corresponding to the video frames in the first video and the temporal correlation of the camera parameters between different video frames; A second video having a camera movement corresponding to the target camera movement type is generated according to the first video and the target camera parameter characteristics.

2. The method according to claim 1, characterized in that The determining target camera parameter features according to the camera parameters corresponding to the video frame in the first video includes: Determining a camera parameter embedding representation according to camera parameters corresponding to the video frame in the first video; The camera parameter embedding representation is encoded through an encoder based on a temporal attention mechanism to obtain the target camera parameter features.

3. The method according to claim 2, characterized in that The camera parameter embedding representation is encoded by an encoder based on a temporal attention mechanism to obtain target camera parameter features, including: Encoding the camera parameter embedding representation through convolution layers of different scales in an encoder to obtain a first feature of a corresponding scale output by the convolution layer, wherein the first feature is used to characterize a camera parameter corresponding to the video frame in the first video; Encoding the corresponding first features through the temporal attention layers respectively corresponding to the convolutional layers in the encoder to obtain second features of the corresponding scale output by the temporal attention layers, where the second features are used to characterize the temporal correlation of camera parameters between different video frames in the first video; A target camera parameter feature is obtained according to all the first features and all the second features.

4. The method according to claim 1, characterized in that: The step of generating, according to the first video and the target camera parameter feature, a second video having a camera movement corresponding to the target camera movement type comprises: Determine a picture embedding vector corresponding to the picture feature of the first video and a camera parameter embedding vector corresponding to the target camera parameter feature; Performing a diffusion process based on the picture embedding vector and the camera parameter embedding vector through a pre-generated video generation model to generate a second video carrying a camera movement corresponding to the target camera movement type; Among them, the diffusion process includes a denoising process and a denoising process, the camera parameter embedding vector is injected into the temporal attention layer involved in the denoising process of the video generation model in a manner based on a temporal attention mechanism, the denoising process is used to perform denoising on the picture embedding vector, and the denoising process is used to generate a denoised second video based on the camera parameter embedding vector and the picture embedding vector after the denoising process.

5. The method according to claim 4, characterized in that The video generation model is a model generated based on the following method: Acquire a training sample set, the training sample set including a plurality of sample video data, the sample video data including a sample camera movement video and sample camera parameters corresponding to a sample video frame in the sample camera movement video, the sample camera movement video being a camera movement video including a foreground motion image or a camera movement video not including a foreground motion image; The initial model is trained according to the training sample set to obtain the video generation model.

6. The method according to claim 5, characterized in that The method further comprises: The target sample video data in the training sample set is deleted to obtain an updated training sample set, the sample camera movement video corresponding to the target sample video data is a camera movement video with a sudden change in picture content, and the initial model is trained based on the updated training sample set to obtain the video generation model.

7. The method according to any one of claims 1 to 6, wherein the camera parameters include at least one of the following: The camera's external parameters; The camera's intrinsic parameters.

8. A video generating device, characterized in that: include: An acquisition module is configured to acquire a first video and a target camera movement type, wherein the target camera movement type carries camera parameters corresponding to a video frame in the first video; a determination module configured to determine target camera parameter features according to camera parameters corresponding to the video frames in the first video, wherein the target camera parameter features are used to characterize the camera parameters corresponding to the video frames in the first video and the temporal correlation of the camera parameters between different video frames; A generating module is configured to generate a second video having a camera movement corresponding to the target camera movement type according to the first video and the target camera parameter characteristics.

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

10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.

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

Citation Information

Cited By

  • Multi-device image editing method and device and storage medium

    CN120658924A

  • Video generation method and device with controllable mirror operation mode, and electronic equipment

    CN121099153A

  • A video generation method, apparatus, and electronic device with controllable camera movement.

    CN121099153B

  • Video generation control method and system based on multi-mode lens trend

    CN122248236A

  • Video generation method and apparatus, medium, electronic device and program product

    WO2026092380A1