Method and device for generating video and electronic equipment
By acquiring and processing images and guiding information, performing mirror-operating and stylizing processing, and generating target videos, the problem of low efficiency and deviation from user wishes in the prior art is solved, and efficient and accurate video generation is achieved.
Patent Information
- Application Number
- CN202310952705.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, generating videos of mirrors requires manually generating image frames one frame after another, which is inefficient and easily deviate from user wishes.
By acquiring the first image and the first guidance information, processing the first image based on the guidance information, obtaining the second image, and performing the mirror processing and stylization processing as the first frame image, generating a multi-frame third image, and finally based on the first frame image. The two images and the multi-frame third images generate target video.
It realizes efficient generation of target videos, avoids videos from deviating from user wishes, and improves user experience.
Smart Images

Figure CN119484945A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of video processing technology, and in particular to a method, device and electronic device for generating a video. Background Art
[0002] With the continuous development of network technology and streaming media technology, videos are increasingly used in people's lives, providing entertainment services for people's lives and bringing many conveniences. At present, in order to improve the fun, a video can be made by camera movement. In related technologies, it is usually necessary to manually generate image frames of the video frame by frame. Therefore, a method for efficiently generating camera movement videos is needed. Summary of the invention
[0003] The present disclosure provides a method, device and electronic device for generating a video.
[0004] According to a first aspect, a method for generating a video is provided, the method comprising:
[0005] Acquire a first image and first guidance information;
[0006] Based on the first guidance information, processing the first image to obtain a second image;
[0007] The second image is used as a first frame image to be processed to perform camera movement processing and stylization processing to obtain multiple frames of third images;
[0008] A target video is generated based on the second image and the multiple frames of third images.
[0009] According to a second aspect, a device for generating a video is provided, the device comprising:
[0010] An acquisition module, used for acquiring a first image and first guidance information;
[0011] A first processing module, configured to process the first image based on the first guidance information to obtain a second image;
[0012] A second processing module is used to perform camera movement processing and stylization processing on the second image as a first frame image to be processed, so as to obtain multiple frames of third images;
[0013] A generation module is used to generate a target video based on the second image and the multiple frames of third images.
[0014] According to a third aspect, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of the above-mentioned first aspects is implemented.
[0015] According to a fourth aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the first aspects is implemented.
[0016] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0017] The embodiments of the present disclosure provide a method and device for generating a video, which obtains first guidance information, processes a first image based on the first guidance information, obtains a second image, uses the second image as the first frame image to be processed for camera movement processing and stylization processing, obtains multiple frames of third images, and generates a target video based on the second image and the multiple frames of third images. Since the first frame image to be processed is generated based on the first image under the guidance of the first guidance information, the generated target video is prevented from deviating from the user's intention, thereby providing a guiding direction for generating the target video towards the expected effect, and improving the user experience.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0020] Figure 1 A schematic diagram of an exemplary system architecture for applying an embodiment of the present disclosure;
[0021] Figure 2 is a schematic diagram of a link scenario for generating a video according to an exemplary embodiment of the present disclosure;
[0022] Figure 3 is a flowchart of a method for generating a video according to an exemplary embodiment of the present disclosure;
[0023] Figure 4 is a flowchart of another method for generating a video according to an exemplary embodiment of the present disclosure;
[0024] Figure 5 is a block diagram of a device for generating a video according to an exemplary embodiment of the present disclosure;
[0025] Figure 6 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure;
[0026] Figure 7 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure;
[0027] Figure 8 is a schematic diagram of a storage medium provided in some embodiments of the present disclosure. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0029] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are only examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.
[0030] The terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. The singular forms of "a", "the" and "the" used in this disclosure are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0031] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0032] See also Figure 1 , is a schematic diagram of an exemplary system architecture for applying an embodiment of the present disclosure.
[0033] like Figure 1 As shown, the system architecture 100 may include a terminal device 102, a network 103 and a server 104. It should be understood that Figure 1The number or type of terminal devices, networks, and servers in the embodiment are merely illustrative. Any number or type of terminal devices, networks, and servers may be provided as required.
[0034] The network 103 is used to provide a medium for communication links between terminal devices and servers. The network 103 may include various connection types, such as wired or wireless communication links or optical fiber cables.
[0035] The terminal device 102 can interact with the server through the network 103 to receive or send requests or information, etc. The terminal device 102 can be various electronic devices, including but not limited to smart phones, tablet computers, smart wearable devices, personal digital assistants, etc.
[0036] The server 104 can store, analyze, and process the received data, and can also send control commands or requests to terminal devices or other servers. The server can provide services in response to user service requests. It is understood that a server can provide one or more services, and the same service can also be provided by multiple servers.
[0037] based on Figure 1 The system architecture shown, in the embodiment of the present disclosure, the user 101 can input the first image and the first guidance information through the terminal device 102, and the terminal device 102 sends the first image and the first guidance information to the server 104 through the network 103. After receiving the first image and the first guidance information, the server 104 can process the first image based on the first guidance information to obtain the second image, and use the second image as the first frame image to perform mirror movement processing and stylization processing to obtain multiple frames of third images, and then generate a target video based on the second image and the multiple frames of third images. Finally, the server 104 can return the target video to the terminal device 102 through the network 103, so that the user 101 can watch the effect of the target video through the terminal device 102.
[0038] See also Figure 2 , is a schematic diagram of a link scenario for generating a video according to an exemplary embodiment.
[0039] like Figure 2As shown, first, the user can input image A and guide information through a third-party application installed on the terminal device. Then, the terminal device can send a request Q to the cloud editing platform of the video, wherein the request Q carries image A and guide information to upload image A and guide information to the cloud editing platform of the video. The cloud editing platform of the video can transmit image A and guide information to the algorithm server 1 under the instruction of request Q, and the algorithm server 1 processes image A based on the guide information to obtain image B. Algorithm server 1 returns image B to the cloud editing platform, and the cloud editing platform transmits image B to algorithm server 2. After receiving image B, algorithm server 2 can use image B as the first frame image, generate multi-frame video frame images frame by frame through mirror processing and stylization processing, and generate video C based on the generated multi-frame video frame images, and return video C to the cloud editing platform. The cloud editing platform can then reprocess video C based on a preset video template (for example, adding special effects, etc.) to obtain video D. Finally, the cloud editing platform can return video D to the terminal device, and the terminal device plays video D for the user to watch.
[0040] The present disclosure will be described in detail below in conjunction with specific embodiments.
[0041] Figure 3 The flowchart of a method for generating a video according to an exemplary embodiment is shown. The execution subject of the method can be implemented as any device, platform, server or device cluster with computing and processing capabilities. The method includes the following steps:
[0042] like Figure 3 As shown, in step 301, a first image and first guidance information are acquired.
[0043] In this embodiment, the first image is used to generate a target video. The first image can be a frame of image directly input by the user, a frame of image directly taken by the user, or a frame of image selected by the user from an existing video. It can be understood that this embodiment does not limit the specific method of obtaining the first image.
[0044] In this embodiment, the first guide information may be text information, image information, or text information plus image information. The first guide information is used to provide constraints for guiding the generation of the second image. For example, if the first guide information includes text information, the text information may include keywords corresponding to one or more of the following constraints: theme constraints, environment constraints, atmosphere constraints, color constraints, style constraints, distant view constraints, close view constraints, etc. If the first guide information includes image information, the image information may include, but is not limited to, image feature information that can reflect the following constraints: theme, environment, atmosphere, color, style, distant view, close view, etc.
[0045] In step 302, the first image is processed based on the first guidance information to obtain a second image.
[0046] In this embodiment, the first image can be processed based on the first guidance information. For example, the first guidance information and the first image can be input into a pre-trained model, and the model can stylize the first image based on the constraints provided by the first guidance information, thereby generating a second image. The second image can have a layout similar to that of the first image and satisfy the constraints provided by the first guidance information. It should be noted that the pre-trained model can be a diffusion model, and this embodiment does not limit the specific category of the model.
[0047] In step 303, the second image is used as the first frame image to be processed and subjected to camera movement processing and stylization processing to obtain multiple frames of third images.
[0048] In this embodiment, the second image can be used as the first frame image to be processed, and the camera movement processing and stylization processing can be performed to obtain multiple frames of third images. For example, if image 1 is the second image, image 1 can be processed first to generate image 2, then image 2 can be processed to generate image 3, then image 3 can be processed to generate image 4, then image 4 can be processed to generate image 5... and so on, and finally, part or all of the generated images can be used as the third image.
[0049] Specifically, in one implementation, the camera movement parameters input by the user can be obtained, and according to the camera movement parameters, multiple frames of third images are generated frame by frame based on the second image through camera movement processing and stylization processing. The camera movement parameters may include but are not limited to the translation coefficient, rotation coefficient, scaling coefficient, lens zoom coefficient, etc. of the image. The user can control the camera movement effect of the generated video through the input camera movement parameters. It should be noted that in the process of stylization processing, different stylization processing can be randomly performed according to a plurality of different stylization models trained in advance.
[0050] In another implementation, in addition to inputting the camera movement parameters, the user can also input the second guide information. Based on the camera movement parameters input by the user and the second guide information, multiple frames of the third image can be generated frame by frame based on the second image through camera movement processing and stylization processing. The second guide information includes a variety of constraints for guiding the generation of the third image. Since this embodiment refers to the second guide information input by the user when generating multiple frames of the third image, it is possible to generate multiple frames of the third image in the middle according to the user's wishes, thereby improving the user experience.
[0051] In step 304, a target video is generated based on the second image and a plurality of frames of third images.
[0052] In this embodiment, after generating multiple frames of the third image, a target video can be generated based on the second image and the multiple frames of the third image. In one implementation, if the first image is a frame of image uploaded separately, the first image can be used as the first frame of image, and the second image and the multiple frames of the third image can be synthesized into the target video.
[0053] In another implementation, if the first image is a frame of image selected from an existing video, the existing video, the second image, and multiple frames of third images may be synthesized into a target video.
[0054] In yet another implementation, after the second image and multiple frames of the third image are synthesized into a video, special effects may be added to the synthesized video to obtain a target video.
[0055] The present disclosure provides a method for generating a video, which obtains first guidance information, processes a first image based on the first guidance information, obtains a second image, uses the second image as a first frame image to be processed for camera movement processing and stylization processing, obtains multiple frames of third images, and generates a target video based on the second image and the multiple frames of third images. Since the first frame image to be processed is generated based on the first image under the guidance of the first guidance information, the generated target video is prevented from deviating from the user's intention, thereby providing a guiding direction for generating the target video towards the expected effect, and improving the user experience.
[0056] Figure 4 is a flowchart of another method for generating a video according to an exemplary embodiment. The embodiment describes a process of generating multiple frames of third images, including the following steps:
[0057] like Figure 4 As shown, in step 401, the camera movement parameters and the second guide information input by the user are obtained, and in step 402, multiple frames of third images are generated frame by frame based on the second image through camera movement processing and stylization processing according to the camera movement parameters and the second guide information.
[0058] In this embodiment, the user may input the camera movement parameters and the second guide information in advance, and the second guide information may include a variety of constraints for guiding the generation of the third image. The constraints may include, but are not limited to, themes, environments, atmospheres, tones, styles, distant views, close views, etc. The second guide information may be text information, image information, or a combination of text information and image information.
[0059] In this embodiment, the target operation can be performed by multiple iterations, so as to generate multiple frames of third images frame by frame based on the second image. Each target operation can include: first, obtaining the current image to be processed. Wherein, when the target operation is performed for the first time, the second image can be used as the current image to be processed, and when the target operation is not performed for the first time, the third image generated by the previous target operation can be used as the current image to be processed.
[0060] Then, the current image to be processed is subjected to a mirror movement process to obtain a mirror movement image. If the preset condition is not currently met, the mirror movement image can be determined as a third image. If the preset condition is currently met, the mirror movement image can be stylized based on the second guidance information to obtain a third image. Among them, the preset condition can be a condition set for the number of executions of the current target operation. For example, the 3nth (n is greater than or equal to 1) execution of the target operation can be set as a preset condition in advance, and then the preset condition is met when the target operation is executed for the 3rd, 6th, 9th...times. It can be understood that the preset condition can be any reasonable condition, and this embodiment does not limit the specific setting of the preset condition.
[0061] Taking image 1 as an example, image 1 is a second image generated according to the first image. First, the camera movement parameters and the second guide information input by the user are obtained. Then, in the first target operation, image 1 is processed based on the camera movement parameters to obtain camera movement image 2 as the third image. In the second target operation, camera movement image 2 is processed based on the camera movement parameters to obtain camera movement image 3 as the third image. In the third target operation, camera movement image 3 is processed based on the camera movement parameters to obtain camera movement image 4, and then, image 4 is stylized based on the second guide information to obtain image 5 as the third image. In the fourth target operation, image 5 is processed based on the camera movement parameters to obtain camera movement image 6 as the third image... And so on, the subsequent process will not be repeated here.
[0062] In this embodiment, when the preset conditions are currently met, the camera movement image can be stylized based on the second guidance information to obtain a third image in the following manner: some constraints can be obtained from the second guidance information according to preset rules, and the camera movement image can be stylized based on the some constraints to obtain the third image.
[0063] Specifically, since the second guidance information includes multiple constraints, only some of the constraints may be obtained each time the stylization process is performed. A preset rule for obtaining some of the constraints from the second guidance information may be set in advance for each stylization process. For example, the preset rule may indicate that some of the constraints are obtained from the second guidance information according to the category of the constraints and the number of stylization processes. It may also indicate that a preset number of constraints are selected each time according to the order of the constraints in the second guidance information. It may also indicate that a preset number of constraints are randomly obtained from the second guidance information, etc. It is understandable that the preset rule may be any reasonable rule, and this embodiment does not limit the specific content of the preset rule.
[0064] Since this embodiment generates multiple third images frame by frame through camera movement processing and stylization processing according to the camera movement parameters input by the user and the second guidance information, the multiple third images used to generate the target video can further avoid the generated target video from deviating from the user's intention, provide guidance direction for generating the target video towards the expected effect, and further enhance the user experience.
[0065] It should be noted that although the operations of the method of the disclosed embodiment are described in a specific order in the above embodiments, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flowchart can change the order of execution. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.
[0066] Corresponding to the aforementioned method embodiment for generating a video, the present disclosure also provides an embodiment of an apparatus for generating a video.
[0067] like Figure 5 As shown, Figure 5 is a block diagram of a device for generating a video according to an exemplary embodiment of the present disclosure. The device may include: an acquisition module 501, a first processing module 502, a second processing module 503 and a generation module 504.
[0068] The acquisition module 501 is used to acquire the first image and the first guidance information.
[0069] The first processing module 502 is used to process the first image based on the first guidance information to obtain a second image.
[0070] The second processing module 503 is used to perform camera movement processing and stylization processing on the second image as the first frame image to be processed, so as to obtain multiple frames of third images.
[0071] The generating module 504 is configured to generate a target video based on the second image and multiple frames of third images.
[0072] In some embodiments, the first guide information includes text information and / or image information.
[0073] In other embodiments, the first guidance information is used to provide one or more of the following constraints to guide the generation of the second image: subject constraints, environment constraints, atmosphere constraints, color constraints, style constraints, distant view constraints, and close view constraints.
[0074] In some other implementations, the second processing module 503 may include: an acquisition submodule and a generation submodule (not shown in the figure).
[0075] The acquisition submodule is used to acquire the camera movement parameters and the second guide information input by the user.
[0076] The generation submodule is used to generate multiple frames of third images frame by frame based on the second image through camera movement processing and stylization processing according to the camera movement parameters and the second guide information.
[0077] In some other embodiments, the generating submodule generates multiple frames of third images frame by frame based on the second image by means of camera movement processing and stylization processing according to the camera movement parameters and the second guide information, which may include performing the following target operations multiple times:
[0078] Obtain the current image to be processed. When the target operation is performed for the first time, the current image to be processed is the second image. When the target operation is not performed for the first time, the current image to be processed is the third image generated by the last target operation. Perform camera movement processing on the current image to be processed to obtain a camera movement image. If the preset condition is not met at present, the camera movement image is determined as the third image. If the preset condition is met at present, the camera movement image is stylized based on the second guide information to obtain the third image.
[0079] In other embodiments, the second guidance information may include a plurality of constraint conditions for guiding the generation of the third image.
[0080] In other embodiments, when the preset conditions are currently met, the generation submodule can stylize the camera movement image based on the second guidance information to obtain a third image in the following manner: obtain partial constraints from the second guidance information according to preset rules, and stylize the camera movement image based on the partial constraints to obtain the third image.
[0081] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment scheme of the present disclosure. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0082] Figure 6 A schematic block diagram of an electronic device provided in some embodiments of the present disclosure. Figure 6 As shown, the electronic device 910 includes a processor 911 and a memory 912, which can be used to implement a client or a server. The memory 912 is used to store computer executable instructions (e.g., one or more computer program modules) non-transiently. The processor 911 is used to run the computer executable instructions, and when the computer executable instructions are run by the processor 911, one or more steps in the method for generating a video described above can be executed, thereby implementing the method for generating a video described above. The memory 912 and the processor 911 can be interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0083] For example, the processor 911 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units having data processing capabilities and / or program execution capabilities. For example, the central processing unit (CPU) may be an X86 or ARM architecture, etc. The processor 911 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 910 to perform desired functions.
[0084] For example, the memory 912 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage medium, and the processor 911 may run one or more computer program modules to implement various functions of the electronic device 910. Various applications and various data, as well as various data used and / or generated by the application, etc. may also be stored in the computer-readable storage medium.
[0085] It should be noted that, in the embodiment of the present disclosure, the specific functions and technical effects of the electronic device 910 can refer to the description of the method for generating a video in the above text, and will not be repeated here.
[0086] Figure 7 A schematic block diagram of another electronic device provided for some embodiments of the present disclosure. The electronic device 920 is, for example, suitable for implementing the method for generating a video provided in an embodiment of the present disclosure. The electronic device 920 may be a terminal device, etc., and may be used to implement a client or a server. The electronic device 920 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-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. It should be noted that Figure 7 The electronic device 920 shown is only an example and does not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0087] like Figure 7 As shown, the electronic device 920 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 921, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 922 or a program loaded from a storage device 928 into a random access memory (RAM) 923. In the RAM 923, various programs and data required for the operation of the electronic device 920 are also stored. The processing device 921, the ROM 922, and the RAM 923 are connected to each other via a bus 924. An input / output (I / O) interface 925 is also connected to the bus 924.
[0088] Typically, the following devices may be connected to the I / O interface 925: an input device 926 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 927 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 928 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 929. The communication device 929 may allow the electronic device 920 to communicate with other electronic devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 920 is shown to have various devices, but it should be understood that it is not required to implement or possess all of the devices shown, and the electronic device 920 may alternatively implement or possess more or fewer devices.
[0089] For example, according to an embodiment of the present disclosure, the above-mentioned method for generating a video 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 includes a program code for executing the above-mentioned method for generating a video. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 929, or installed from a storage device 928, or installed from a ROM 922. When the computer program is executed by the processing device 921, the functions defined in the method for generating a video provided in an embodiment of the present disclosure can be implemented.
[0090] Figure 8 A schematic diagram of a storage medium provided in some embodiments of the present disclosure. Figure 8 As shown, the storage medium 930 may be a non-transitory computer-readable storage medium for storing non-transitory computer-executable instructions 931. When the non-transitory computer-executable instructions 931 are executed by a processor, the method for generating a video described in the embodiment of the present disclosure may be implemented. For example, when the non-transitory computer-executable instructions 931 are executed by a processor, one or more steps in the method for generating a video described above may be performed.
[0091] For example, the storage medium 930 may be applied to the above-mentioned electronic device. For example, the storage medium 930 may include a memory in the electronic device.
[0092] For example, the storage medium may include a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), flash memory, or any combination of the above storage media, or other applicable storage media.
[0093] For example, the description of the storage medium 930 can refer to the description of the memory in the embodiment of the electronic device, and the repeated parts are not repeated. The specific functions and technical effects of the storage medium 930 can refer to the description of the method for generating a video above, and are not repeated here.
[0094] It should be noted that in the context of the present disclosure, a computer-readable medium may be a tangible medium that may contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A 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 that contains or stores a program that may be used by an instruction execution system, device or device or used in combination with it. 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. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0095] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0096] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for generating a video, the method comprising: Acquire a first image and first guidance information; Based on the first guidance information, processing the first image to obtain a second image; The second image is used as a first frame image to be processed to perform camera movement processing and stylization processing to obtain multiple frames of third images; A target video is generated based on the second image and the multiple frames of third images.
2. The method according to claim 1, wherein: The first guide information includes text information and / or image information.
3. The method according to claim 1, wherein: The first guidance information is used to provide one or more of the following constraints for guiding the generation of the second image: Theme constraints, environment constraints, atmosphere constraints, tone constraints, style constraints, distant view constraints, close view constraints.
4. The method according to claim 1, wherein: The step of performing camera movement processing and stylization processing on the second image as the first frame image to be processed to obtain multiple frames of third images includes: Obtaining the camera movement parameters and second guidance information input by the user; According to the camera movement parameters and the second guide information, the multiple frames of third images are generated frame by frame based on the second image through camera movement processing and stylization processing.
5. The method according to claim 4, wherein: The step of generating the plurality of third images frame by frame based on the second image by means of camera movement processing and stylization processing according to the camera movement parameters and the second guide information includes performing the following target operations multiple times: Acquire a current image to be processed; wherein, when the target operation is performed for the first time, the current image to be processed is the second image; and when the target operation is not performed for the first time, the current image to be processed is the third image generated when the target operation was performed last time; Performing camera movement processing on the current image to be processed to obtain a camera movement image; If the preset condition is not met currently, the camera movement image is determined as a third image; if the preset condition is met currently, the camera movement image is stylized based on the second guide information to obtain a third image.
6. The method according to claim 5, wherein: The second guidance information includes a plurality of constraint conditions for guiding generation of the third image.
7. The method according to claim 6, wherein: When the preset condition is currently met, stylizing the camera movement image based on the second guide information to obtain a third image includes: Acquire some constraint conditions from the second guidance information according to preset rules; The camera movement image is stylized based on the partial constraint conditions to obtain a third image.
8. A device for generating a video, the device comprising: An acquisition module, used for acquiring a first image and first guidance information; A first processing module, configured to process the first image based on the first guidance information to obtain a second image; A second processing module is used to perform camera movement processing and stylization processing on the second image as a first frame image to be processed, so as to obtain multiple frames of third images; A generation module is used to generate a target video based on the second image and the multiple frames of third images.
9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 7 is implemented.