Video generation method, device, electronic device and storage medium

By obtaining keyframes in the image editing process and generating target videos, it solves the problem that users find it difficult to record and share videos in the image editing process, and realizes automatic recording and efficient sharing of the image editing process.

JP2025511177AActive Publication Date: 2025-04-15BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2024558008
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-03-31
Filing Date
2023-03-17
Publication Date
2025-04-15
Estimated Expiration
2043-03-17

AI Technical Summary

Technical Problem

When performing image editing on a mobile terminal, it is difficult for users to record and share videos during image editing.

Method used

Through the generation method, keyframes in the image editing process are obtained, and target video is generated based on these keyframes to record the image editing process.

Benefits of technology

It realizes automatic recording and video generation during image editing, which is convenient for users to share or use as teaching resources, and improves the visualization and recording efficiency of image editing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025511177000001_ABST
    Figure 2025511177000001_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a video generating method, an apparatus, an electronic device, and a storage medium, the method including: obtaining an initial key frame in an image editing process of performing a series of image editing operations on an initial image to obtain a target image, the initial key frame being an intermediate state image between the initial image and the target image in the image editing process, where different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit editing effects of corresponding image editing operations; generating a target video based on the initial key frame to record the image editing process of the target image. The present disclosure can be used for recording the image editing process.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] [CROSS REFERENCE TO RELATED APPLICATIONS] This application is based on and claims priority from a Chinese application having application number 202210346589.5 and filing date March 31, 2022, the entire disclosure of which is incorporated herein by reference.

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

[0003] With the rapid development of network technology and mobile terminal technology, more and more applications suitable for mobile terminals have appeared, such as editing applications, which allow users to edit the original pictures they have taken.

[0004] In some application scenarios, users want to record the image editing process and obtain related videos, which can be used for sharing or teaching. Summary of the Invention [Problem to be solved by the invention]

[0005] To solve the above technical problem or at least partially solve the above technical problem, embodiments of the present disclosure provide a video production method, apparatus, electronic device, and storage medium that can be used to record an image editing process. [Means for solving the problem]

[0006] An embodiment of the present disclosure provides a video generation method, the method comprising: In an image editing process of performing a series of image editing operations on an initial image to obtain a target image, an initial key frame is obtained, the initial key frame being an intermediate state image between the initial image and the target image in the image editing process, wherein different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit the editing effects of the corresponding image editing operations and the editing actions when the corresponding image editing operations are triggered; generating a target video based on the initial keyframes to record an image editing process of the target image.

[0007] An embodiment of the present disclosure further provides a video generation device, the device comprising: an acquisition module for acquiring an initial key frame in an image editing process for performing a series of image editing operations on an initial image to obtain a target image, the initial key frame being an intermediate state image between the initial image and the target image in the image editing process, where different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit the editing effects of the corresponding image editing operations and the editing actions when the corresponding image editing operations are triggered; a generating module for generating a target video based on the initial keyframes to record an image editing process of the target image.

[0008] An embodiment of the present disclosure further provides an electronic device, the electronic device comprising: one or more processors; a storage device for storing one or more programs; The one or more programs, when executed by the one or more processors, cause the one or more processors to perform one or more steps in the video generation method described above.

[0009] An embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs one or more steps of the video generation method described above.

[0010] An embodiment of the present disclosure further provides a computer program, the computer program comprising: The computer readable instructions include computer readable instructions that, when executed by a processor, cause the processor to perform one or more steps in the video generation method described above.

[0011] An embodiment of the present disclosure further provides a computer program product, which includes computer readable instructions that, when executed by a processor, cause the processor to perform one or more steps of the video generation method described above. [Brief description of the drawings]

[0012] 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 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 that the originals and elements are not necessarily drawn to scale. [Figure 1] 1 is a flowchart of a video watermarking method in an embodiment of the present disclosure. [Diagram 2] 1 is a flowchart of triggering the preset frame extraction policy in an embodiment of the present disclosure. [Diagram 3] 1 is a flowchart for determining whether an extracted initial key frame is a valid frame in an embodiment of the present disclosure. [Figure 4] 11 is a flowchart illustrating a sparsification process according to an embodiment of the present disclosure. [Diagram 5] FIG. 2 is a structural schematic diagram of a video generating device in an embodiment of the present disclosure. [Figure 6] FIG. 2 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0013] Hereinafter, the embodiments of the present disclosure will be described in more detail with reference to the drawings. Although the drawings show some embodiments of the present disclosure, it should be understood that the present disclosure may be realized in various forms and should not be construed as being limited to the embodiments described herein, but rather, these embodiments are provided to provide a more transparent and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only used for illustrative purposes and are not intended to limit the protection scope of the present disclosure.

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

[0015] As used herein, the term "comprises" and variations thereof are open inclusions, including but not limited to. The term "based on" means "based at least in part on." The term "in one embodiment" means "at least one embodiment," the term "in another embodiment" means "at least one other embodiment," and the term "in some embodiments" means "at least some embodiments." Relevant definitions of other terms are provided below in the description.

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

[0017] It should be noted that the modifications "a" and "a plurality" referred to in this disclosure are general rather than limiting, and that a person skilled in the art would understand to be understood as "one or more" unless the context clearly indicates otherwise.

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

[0019] 1 is a flowchart of a video generating method according to an embodiment of the present disclosure, which may be performed by a video generating device, which may be implemented in a software and / or hardware manner, which may be disposed in an electronic device, such as a terminal, including but not limited to a smartphone, a palmtop computer, a tablet computer, a wearable device with a display, a desktop computer, a notebook computer, an all-in-one device, a smart home device, etc., or which may be disposed in a server.

[0020] As shown in FIG. 1, the method specifically includes the following steps:

[0021] Step 110: in an image editing process of performing a series of image editing operations on an initial image to obtain a target image, an initial keyframe is obtained, the initial keyframe being an intermediate state image between the initial image and the target image in the image editing process, where different initial keyframes are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit the editing effects of the corresponding image editing operations.

[0022] Here, the initial image may be an image in a user album, an image downloaded from a network disk, or a video frame in a video waiting to be edited. When performing image editing on the initial image, it can be performed by using dedicated image editing software, for example, a user introduces an image in an album (i.e., an initial image) into the image editing software, and performs image editing on the initial image using the image editing software. Performing image editing on the initial image includes, but is not limited to, adjusting the brightness and contrast of the initial image, adding materials (e.g., stickers, text) to the initial image, adding effects or filters, etc.

[0023] Generally, the interaction interface of the dedicated image editing software has a relatively large number of editing controls, such as an image brightness adjustment control, an image contrast adjustment control, a material addition control, etc. The user can realize image editing of the initial image by triggering the corresponding control.

[0024] In some optional embodiments, in order to effectively record the process of a user editing an image on an initial image, the frame extraction time for acquiring an initial key frame is limited to ensure that the acquired initial key frame is an intermediate state image for recording a key editing operation, or an intermediate state image in which the editing effect changes relatively obviously.

[0025] Illustratively, in the above-mentioned image editing process of performing a series of image editing operations on an initial image to obtain a target image, obtaining an initial key frame includes: When performing an image editing operation on the initial image, determining a type of the image editing operation, obtaining an initial key frame at the time of triggering the image editing operation when the type of the image editing operation is a first type, and obtaining an initial key frame when receiving a confirmation activation command or an image editing operation switching command after triggering the image editing operation when the type of the image editing operation is a second type, the first type of image editing operation is an operation that changes the original content of the initial image, and the second type of image editing operation is an operation that superimposes an effect on the original content of the initial image but does not change the original content. For example, graffiti operations on the initial image and operations that realize facial reconstruction of a human figure by handwriting (such as modifying the shape of the face and enlarging the pupils of the eyes) belong to the first type of image editing operation, and operations of adjusting the brightness, contrast, and light sensitivity of the target image, adding materials (stickers or characters) to the target image, and adding filters belong to the second type of image editing operation.

[0026] Taking an image editing operation of adding a sticker to an initial image as an example, after a user selects a sticker option, when the user triggers the "OK" control, i.e., when the system receives a confirmation activation command, it triggers the frame extraction logic to obtain an intermediate state image at the current time (in which the added sticker is shown), i.e., obtains the initial key frame at the current time.

[0027] For example, when a user performs a doodle operation on an initial image, an initial key frame is obtained at the time when the user triggers the doodle operation, and the initial key frame is an intermediate state image corresponding to the image editing operation trigger time, and the intermediate state image shows an editing effect (e.g., an image screen after doodle) corresponding to the image editing operation (e.g., the doodle operation). Furthermore, the intermediate state image may further show a trigger operation of the corresponding image editing operation (e.g., the user's doodle operation).

[0028] In the image editing process in which a series of image editing operations are performed on an initial image to obtain a target image, an initial key frame is obtained, and a target video is further generated based on the initial key frame, thereby achieving recording of the process in which a user performs image editing on the initial image.

[0029] Generally speaking, the initial keyframe is obtained in an image editing process, in which a series of image editing operations are performed on an initial image to obtain a target image based on a preset frame extraction policy.

[0030] For example, referring to the flowchart diagram of triggering a preset frame extraction policy shown in FIG. 2 , the process specifically includes: starting image editing on an initial image; generating an image editing operation; determining the type of the image editing operation; if it is a first type of image editing operation, directly triggering the frame extraction logic; if it is a second type of image editing operation, triggering the frame extraction logic when receiving a confirmation enable command or an editing operation switching command.

[0031] In some optional embodiments, obtaining the initial key frame may be sampling according to a fixed number of steps, for example, recording the number of image editing operations by a counter, adding one to the count value of the counter each time a user triggers an image editing operation, and executing the frame extraction logic once when the count value reaches a preset value (for example, the preset value is 3, which is adjustable).

[0032] Or, the smart model may determine the content change degree of the initial image, and execute the frame extraction logic once when the content change degree of the initial image reaches a preset value.

[0033] Alternatively, frame extraction may be performed according to a set fixed time length, for example running the frame extraction logic once every 10 seconds.

[0034] Step 120, generating a target video based on the initial keyframes to record the image editing process of the target image.

[0035] In order to further improve the quality of the initial key frame, realize effective recording of the process of image editing performed by a user on an initial image, and ensure that the acquired initial key frame is an intermediate state image for recording a key image editing operation, or an intermediate state image with a relatively obvious change in editing effect, after the initial key frame is acquired, filtering selection is performed on the initial key frame, so as to delete the initial key frame with an unclear editing effect, and reserve the initial key frame for recording a key image editing operation, or reserve the initial key frame with a relatively obvious change in editing effect.

[0036] Optionally, before generating a target video based on the initial keyframe, the method further comprises: For a target keyframe in the initial keyframe (i.e., the target keyframe is any one of the initial keyframes), the method further includes comparing pixel values ​​of pixel points in the target keyframe with pixel values ​​of pixel points in a history keyframe that is closest to the target keyframe, the history keyframe being an initial keyframe at a time immediately before the time corresponding to the target keyframe, and determining that the target keyframe is a valid frame when a number of pixel points whose pixel values ​​have changed reaches a second preset threshold. Accordingly, the generating a target video based on the initial keyframe includes generating a target video based on valid frames in the initial keyframe.

[0037] Here, when the target keyframe is the first initial keyframe to be obtained, the history keyframe and the target keyframe are the same keyframe, and when the target keyframe is not the first initial keyframe to be obtained, the history keyframe is a valid frame at the time just before the time corresponding to the target keyframe.

[0038] Take an example to describe the above process of determining whether an initial key frame is a valid frame. Suppose a first initial key frame is obtained, there is no history key frame to refer to, so the first initial key frame is determined as a valid frame, thereby obtaining the first valid frame. As time progresses, a second initial key frame is obtained next, and at this time, the pixel value of the pixel point in the second initial key frame is compared with the pixel value of the pixel point in the first valid frame, and if the number of pixel points whose pixel values ​​have changed reaches a second preset threshold, the second initial key frame is determined as a valid frame. As the comparison is made, the second initial key frame is determined as a valid frame, thereby obtaining the second valid frame. As time progresses, a third initial key frame is obtained next, and at this time, the pixel value of the pixel point in the third initial key frame is compared with the pixel value of the pixel point in the second valid frame (the distance between the second valid frame and the third initial key frame is the shortest), thereby determining whether the third initial key frame is a valid frame. By this analogy, all initial key frames are identified, and valid frames are reserved and invalid frames are deleted.

[0039] Furthermore, when the target key frame is determined to be a valid frame, the target key frame is transferred from the memory to a local magnetic disk for storage, thereby ensuring the storage stability of the valid frame and providing a basis for the generation of the subsequent target video.

[0040] For example, referring to the flowchart of determining whether the extracted initial key frame is a valid frame shown in FIG. 3, the method specifically includes triggering a frame extraction logic to obtain an initial key frame, and then using a pixel contrast filtering policy to determine whether the pixel value of a pixel point in this initial key frame is compared with the pixel value of a pixel point in a history key frame that is closest to this initial key frame and the number of changed pixels reaches a second preset threshold. If the second preset threshold is reached, the initial key frame is determined to be a valid frame and the initial key frame is stored; if the second preset threshold is not reached, the initial key frame is discarded and not stored.

[0041] In order to make the target video concise and efficient, when the number of initial key frames is relatively large, a sparsification process is performed on the initial key frames according to a certain policy to prevent the generated target video from being too redundant and having a poor viewing effect.

[0042] Furthermore, before generating a target video based on the initial keyframe, the method further comprises: The method further includes, when the number of the initial keyframes reaches a first preset threshold and all of the initial keyframes are acquired at a trigger time of a first type of image editing operation, performing a sparsification process on the initial keyframes to control the number of the initial keyframes to be smaller than the first preset threshold.

[0043] Taking the first type of image editing operation as an example, graffiti operation, generally, when performing graffiti operation on an initial image, the user will perform it continuously and constantly, and in this process, a relatively large number of initial key frames will be continuously extracted, and a sparsification process will be performed on these relatively large number of initial key frames in order to ensure the effect of the generated target video and make the target video concise and efficient.

[0044] Alternatively, the sparsification process can be performed according to the rule of selecting at equal intervals. For example, according to the number of the initial key frame to be acquired, the initial key frame with odd number is reserved and the initial key frame with even number is deleted, where the number of the initial key frame is determined based on the acquisition time of the initial key frame, and the earlier the acquisition time, the smaller the number of the initial key frame. Assuming that the first preset threshold is 40 (this value is adjustable), when the number of the acquired initial key frames is 39, when the 40th initial key frame is acquired, the previous 39 initial key frames are subjected to a uniform halving process, for example, the first initial key frame, the third initial key frame, the fifth initial key frame, etc. are selected at equal intervals to process the previous 39 initial key frames into 20 initial key frames, and the 40th initial key frame is the 21st initial key frame after processing, thereby realizing the sparsification process.

[0045] In general, two initial key frames adjacent in acquisition time are determined from the initial key frame, and one of the two initial key frames is filtered.

[0046] For example, referring to the flowchart of performing the sparsifying process shown in FIG. 4, when the image editing operation is a first type image editing operation, the process includes directly triggering the frame extraction logic, and in the process of executing the first type image editing operation, constantly triggering the frame extraction logic; determining whether the number of valid frames obtained for the first type image editing operation reaches a first preset threshold; and if so, performing a sparsifying process on the valid frames, so as to control the number of valid frames to be smaller than the first preset threshold.

[0047] In some optional embodiments, when the total number of the initial key frames reaches a third preset threshold, a sparsification process is performed on all the initial key frames. Specifically, before generating a target video based on the initial key frames, the method includes: The method further includes, when the number of the initial keyframes reaches a third preset threshold, performing a sparsification process on the initial keyframes based on a preset sparsification policy to control the number of the initial keyframes to be smaller than the third preset threshold.

[0048] The step of performing a sparsification process on the initial key frames based on a preset sparsification policy to control the number of the initial key frames to be smaller than the third preset threshold value includes: The method includes reserving odd-numbered initial key frames and deleting even-numbered initial key frames according to the number of the initial key frames, where the number of the initial key frames is determined based on an acquisition time of the initial key frames, and the earlier the acquisition time, the smaller the number of the initial key frames.

[0049] In general, the method of controlling the number of the initial key frames to be smaller than the third preset threshold by performing a sparsification process on the initial key frames based on a preset sparsification policy is as follows: The method includes determining, from the initial key frame, two initial key frames having adjacent acquisition times, and filtering one of the two initial key frames, where the initial key frame may refer to a valid frame.

[0050] In the video generating method according to the embodiment of the present disclosure, an initial key frame is extracted in the process of image editing on an initial image, and validity identification is performed on the extracted initial key frame, thereby ensuring that the user can effectively record the process of image editing on the initial image, and ensuring that the initial key frame obtained is an image for recording key editing operation or an image with a relatively obvious change in editing effect, providing a basis for obtaining a good target video. By controlling the number of valid frames, the target video can have the characteristics of being concise, efficient and having relatively strong visibility, and the target video can have the characteristics of being relatively strong social sharing, so as to enrich the Internet media content.

[0051] Optionally, the method may further include sharing the target video or sending the target video to a preset social media platform.

[0052] Optionally, the presentation format of the target video may be a moving image, a video, a moving picture, a sequence of frames, or a moving picture effect, etc. The target video can be an image editing tutorial to guide users who are not familiar with image editing. The target video has a relatively good record of the complete image modification process and has a relatively strong content visibility.

[0053] 5 is a structural schematic diagram of a video generation device according to an embodiment of the present disclosure. The video generation device according to an embodiment of the present disclosure may be disposed in a client. Specifically, the video generation device includes: The present invention includes an acquisition module 510 for acquiring an initial key frame in an image editing process of performing a series of image editing operations on an initial image to obtain a target image, the initial key frame being an intermediate state image between the initial image and the target image in the image editing process, where different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit editing effects of corresponding image editing operations; and a generation module 520 for generating a target video based on the initial key frame to record the image editing process of the target image.

[0054] Optionally, the acquisition module 510 includes: The image editing system includes a determination unit for determining a type of an image editing operation when performing an image editing operation on the initial image, and a frame extraction unit for obtaining an initial key frame at a time when the image editing operation is triggered if the type of the image editing operation is a first type, and obtaining an initial key frame when a confirmation activation command or an image editing operation switching command is received after triggering the image editing operation if the type of the image editing operation is a second type, wherein the first type of image editing operation is an operation that changes an original content of the initial image, and the second type of image editing operation is an operation that superimposes an effect on the original content of the initial image but does not change the original content.

[0055] Optionally, the image processing device further includes a first processing module for performing a sparsifying process on the initial keyframes to control the number of the initial keyframes to be smaller than the first preset threshold when the number of the initial keyframes reaches a first preset threshold and all of the initial keyframes are obtained at a trigger time of a first type of image editing operation.

[0056] Optionally, the comparison module further includes: for a target keyframe in the initial keyframe, a comparison module for comparing a pixel value of a pixel point in the target keyframe with a pixel value of a pixel point in a history keyframe that is closest to the target keyframe, the history keyframe being an initial keyframe at a time immediately before the time corresponding to the target keyframe; and an identification module for determining that the target keyframe is a valid frame when the number of pixel points whose pixel values ​​have changed reaches a second preset threshold. Accordingly, the generation module 520 is specifically used for generating a target video according to the valid frame in the initial keyframe.

[0057] Alternatively, when the target keyframe is the first initial keyframe to be obtained, the history keyframe and the target keyframe are the same keyframe, and when the target keyframe is not the first initial keyframe to be obtained, the history keyframe is a valid frame at a time immediately before the time corresponding to the target keyframe.

[0058] Optionally, the method further includes a second processing module for performing a sparsification process on the initial keyframes based on a preset sparsity policy when the number of the initial keyframes reaches a third preset threshold, thereby controlling the number of the initial keyframes to be smaller than the third preset threshold.

[0059] Optionally, the second processing module includes a determining unit for determining, from the initial key frame, two initial key frames whose acquisition times are adjacent to each other, and a filtering unit for filtering one of the two initial key frames.

[0060] Optionally, the intermediate state image further exhibits a triggering action for a corresponding image editing operation.

[0061] A video generation device according to an embodiment of the present disclosure can perform steps performed by a client in a video generation method according to an embodiment of the present disclosure, and the execution steps and beneficial effects it has will not be described further here.

[0062] FIG. 6 is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. Hereinafter, referring specifically to FIG. 6, a structural schematic diagram for realizing an electronic device 500 in an embodiment of the present disclosure is shown. The electronic device 500 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet personal computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and wearable electronic devices, and fixed terminals such as digital TVs, desktop personal computers, and smart home devices. The electronic device shown in FIG. 6 is merely an example and does not impose any limitations on the functions and scope of use of the embodiment of the present disclosure.

[0063] As shown in Fig. 6, the electronic device 500 may include a processing unit (e.g., a central processor, a graphics processor, etc.) 501 to implement the method of the embodiments described in the present disclosure, which can perform various appropriate operations and processes based on a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 stores various programs and data required for the operation of the electronic device 500. The processing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0064] Typically, input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyro, etc., output devices 507 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc., storage devices 508 including, for example, a magnetic tape, hard disk, etc., and communication devices 509 can be connected to the I / O interface 505. The communication devices 509 can enable the electronic device 500 to exchange data by wireless or wired communication with other devices. Although FIG. 6 shows the electronic device 500 having various devices, it should be understood that it is not necessary for the electronic device 500 to implement or include all of the devices shown. More or fewer devices can be implemented or included.

[0065] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowcharts 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, the computer program including program code for executing the method shown in the flowcharts, thereby implementing the video generation method described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 509, or may be installed from the storage device 508, or may be installed from the ROM 502. When the computer program is executed by the processing device 501, it performs the above-mentioned functions defined in the method of the embodiment of the present disclosure.

[0066] It should be explained that the computer-readable medium of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of both. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of more than one. More specific examples of the computer-readable storage medium may include, but are not limited to, an electrical connection having one or more conductors, a portable computer magnetic 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 memory device, a magnetic memory device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in combination with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium may include, but is not limited to, a propagated data signal having computer-readable program code carried thereon, either in baseband or as part of a carrier. Such a 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. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, which may transmit, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium may be transmitted by any suitable medium, including but not limited to, electrical wire, optical cable, RF (radio frequency), or the like, or any suitable combination of the above.

[0067] In some embodiments, the clients and servers may communicate using any network protocol now known or later developed, such as HyperText Transfer Protocol (HTTP), and may be communicatively connected (e.g., via a communications network) with digital data in any form or medium. Examples of communications networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet, and an end-to-end network (e.g., an ad hoc end-to-end network), and any network now known or later developed.

[0068] The computer readable medium may be included in the electronic device or may exist separately and not integrated into the electronic device.

[0069] The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: obtain an initial keyframe in an image editing process of performing a series of image editing operations on an initial image to obtain a target image, the initial keyframe being an intermediate state image between the initial image and the target image in the image editing process, where different initial keyframes are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit editing effects of corresponding image editing operations; and generate a target video based on the initial keyframe to record the image editing process of the target image.

[0070] Optionally, when the one or more programs are executed by the electronic device, the electronic device can further execute other steps described in the above embodiments.

[0071] Computer program code for carrying out the operations of the present disclosure can be written in one or more program design languages ​​or combinations thereof, including, but not limited to, object-oriented program design languages ​​such as Java, Smalltalk, C++, and may further include general procedural program design languages ​​such as "C" or similar program design 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. When referring to a remote computer, the remote computer may be connected to the user's computer via 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., via the Internet using an Internet Service Provider).

[0072] The flowcharts and block diagrams in the drawings illustrate possible system architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams may represent a module, program segment or part of code, which includes one or more executable instructions for implementing the specified logical function. It should be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from the order marked in the drawings. For example, two blocks shown in succession may actually be executed essentially in parallel or in the reverse order, depending on the functionality involved. It should be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented in a dedicated hardware-based system that performs the specified functions or operations, or in a combination of dedicated hardware and computer instructions.

[0073] The units described in the embodiments of the present disclosure may be implemented in a software manner or a hardware manner, and the names of the units do not constitute limitations on the units themselves in some cases.

[0074] The functionality described herein may be performed, at least in part, by one or more hardware logic components. For example, and 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 general purpose products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), etc.

[0075] In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain or store a program used by or in combination with an instruction execution system, device, or apparatus. 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 apparatus, or any suitable combination of the above. More specific examples of machine-readable storage media include one or more wire-based electrical connections, portable computer disks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fibers, compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0076] According to one or more embodiments of the present disclosure, the present disclosure provides a video generation method, the video generation method including: obtaining an initial key frame in an image editing process of performing a series of image editing operations on an initial image to obtain a target image, the initial key frame being an intermediate state image between the initial image and the target image in the image editing process, where different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit editing effects of corresponding image editing operations; and generating a target video based on the initial key frame to record the image editing process of the target image.

[0077] According to one or more embodiments of the present disclosure, in the video generation method of the present disclosure, optionally, in the image editing process of performing a series of image editing operations on an initial image to obtain a target image, obtaining an initial key frame includes: determining a type of image editing operation when performing the image editing operation on the initial image; if the type of image editing operation is a first type, obtaining an initial key frame at a time to trigger the image editing operation; and if the type of image editing operation is a second type, obtaining an initial key frame when a confirmation activation command or an image editing operation switching command is received after triggering the image editing operation, wherein the first type of image editing operation is an operation that changes an original content of the initial image, and the second type of image editing operation is an operation that superimposes an effect on the original content of the initial image but does not change the original content.

[0078] According to one or more embodiments of the present disclosure, in the video generation method of the present disclosure, optionally, before generating a target video based on the initial keyframes, the method further includes: when the number of the initial keyframes reaches a first preset threshold and all of the initial keyframes are obtained at a trigger time of a first type of image editing operation, performing a sparsification process on the initial keyframes to control the number of the initial keyframes to be smaller than the first preset threshold.

[0079] According to one or more embodiments of the present disclosure, in the video generating method according to the present disclosure, optionally, before generating a target video based on the initial keyframe, the method further includes: for a target keyframe in the initial keyframe, comparing pixel values ​​of pixel points in the target keyframe with pixel values ​​of pixel points in a history keyframe that is closest to the target keyframe, where the history keyframe is an initial keyframe at a time just before a time corresponding to the target keyframe; and determining that the target keyframe is a valid frame when a number of pixel points whose pixel values ​​have changed reaches a second preset threshold; and accordingly, generating a target video based on the initial keyframe includes generating a target video based on the valid frames in the initial keyframe.

[0080] According to one or more embodiments of the present disclosure, in the video generation method of the present disclosure, optionally, when the target keyframe is an initial keyframe to be obtained first, the history keyframe and the target keyframe are the same keyframe, and when the target keyframe is not the initial keyframe to be obtained first, the history keyframe is a valid frame at a time just before the time corresponding to the target keyframe.

[0081] According to one or more embodiments of the present disclosure, in the video generation method of the present disclosure, optionally, before generating a target video based on the initial keyframes, the method further includes: when the number of the initial keyframes reaches a third preset threshold, performing a sparsification process on the initial keyframes based on a preset sparsification policy, so as to control the number of the initial keyframes to be smaller than the third preset threshold.

[0082] According to one or more embodiments of the present disclosure, in the video generation method of the present disclosure, optionally, performing a sparsification process on the initial keyframes based on a preset sparsity policy to control the number of the initial keyframes to be smaller than the third preset threshold includes determining, from the initial keyframe, two initial keyframes whose acquisition times are adjacent to each other, and filtering one of the two initial keyframes.

[0083] According to one or more embodiments of the present disclosure, in the video generating method of the present disclosure, optionally, the intermediate state image is further provided with a trigger action corresponding to an image editing operation.

[0084] According to one or more embodiments of the present disclosure, the present disclosure provides a video generation apparatus, the video generation apparatus including: an acquisition module for acquiring an initial key frame in an image editing process of performing a series of image editing operations on an initial image to obtain a target image, the initial key frame being an intermediate state image between the initial image and the target image in the image editing process, where different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit editing effects of corresponding image editing operations; and a generation module for generating a target video based on the initial key frame to record the image editing process of the target image.

[0085] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, the electronic device comprising: one or more processors; and a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, they cause the one or more processors to implement any one of the video generation methods described herein.

[0086] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, realizes any one of the video generation methods described herein.

[0087] According to one or more embodiments of the present disclosure, the present disclosure provides a computer program, the computer program comprising: The method includes computer readable instructions which, when executed by a processor, cause the processor to perform one or more steps in any one of the preceding video generation methods.

[0088] According to one or more embodiments of the present disclosure, the present disclosure provides a computer program product, the computer program product including computer readable instructions that, when executed by a processor, cause the processor to perform one or more steps of any one of the video generation methods described above.

[0089] The technical solution according to the embodiment of the present disclosure has at least the following advantages over the related art: In the video generating method according to the embodiment of the present disclosure, in an image editing process of performing a series of image editing operations on an initial image to obtain a target image, an initial key frame is obtained, the initial key frame is an intermediate state image between the initial image and the target image in the image editing process, where different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit the editing effects of the corresponding image editing operations and the editing actions when the corresponding image editing operations are triggered, and a target video is generated based on the initial key frame, and recording of the image editing process of the target image is realized by a technical means of recording the image editing process of the target image.

[0090] The above description is merely a description of the preferred embodiments of the present disclosure and the technical principles used. It should be understood by those skilled in the art that the disclosure scope of the present disclosure is not limited to the technical solution configured by the specific combination of the above technical features, but should also include other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure idea, such as the above features and technical features having similar functions disclosed in the present disclosure (but not limited to these) substituted with each other.

[0091] It should be noted that although operations are illustrated using a particular sequence, this should not be understood as requiring that these operations be performed in the particular sequence or order shown. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although the above discussion includes some specific implementation details, these should not be construed as limitations on the scope of the disclosure. Some features that are described in the context of a single embodiment may also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment may be implemented in multiple embodiments alone or in any suitable subcombination.

[0092] Although the present subject matter has been described using language specific to structural features and / or methodological logical operations, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or operations described above. Rather, the specific features and operations described above are merely example forms for implementing the claims.

Claims

1. 1. A method for generating video, comprising: In an image editing process of performing a series of image editing operations on an initial image to obtain a target image, an initial key frame is obtained, the initial key frame being an intermediate state image between the initial image and the target image in the image editing process, where different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit the editing effects of the corresponding image editing operations; generating a target video based on the initial keyframe to record an image editing process of the target image; A video generation method comprising:

2. In the image editing process of performing a series of image editing operations on an initial image to obtain a target image, obtaining an initial key frame includes: determining a type of image editing operation to be performed on the initial image; If the type of the image editing operation is a first type, obtaining an initial key frame at a time to trigger the image editing operation; When the type of the image editing operation is a second type, an initial key frame is obtained when a confirmation activation command or an image editing operation switching command is received after triggering the image editing operation, and the first type of image editing operation is an operation that changes an original content of the initial image, and the second type of image editing operation is an operation that superimposes an effect on the original content of the initial image but does not change the original content. The video generation method of claim 1 , comprising:

3. Before generating a target video based on the initial keyframe, the method includes:

3. The video generating method of claim 2, further comprising: when a number of the initial key frames reaches a first preset threshold and all of the initial key frames are obtained at a trigger time of a first type of image editing operation, performing a sparsification process on the initial key frames to control the number of the initial key frames to be smaller than the first preset threshold.

4. Before generating a target video based on the initial keyframe, the method includes: For a target key frame in the initial key frame, a pixel value of a pixel point in the target key frame is compared with a pixel value of a pixel point in a history key frame that is closest to the target key frame, the history key frame being an initial key frame at a time immediately before the time corresponding to the target key frame; determining that the target key frame is a valid frame when a number of pixels whose pixel values ​​have changed reaches a second preset threshold; Further comprising: Accordingly, generating a target video based on the initial keyframes includes: The method of claim 1 , further comprising generating a target video based on valid frames at the initial keyframe.

5. When the target keyframe is the first acquired initial keyframe, the history keyframe and the target keyframe are the same keyframe; The video generating method according to claim 4 , wherein if the target keyframe is not a first obtained initial keyframe, the history keyframe is a valid frame at a time immediately preceding the time corresponding to the target keyframe.

6. Before generating a target video based on the initial keyframe, the method includes: The video generation method according to claim 1 , further comprising: when the number of the initial key frames reaches a third preset threshold, performing a sparsification process on the initial key frames based on a preset sparsification policy to control the number of the initial key frames to be smaller than the third preset threshold.

7. The step of performing a sparsification process on the initial key frames based on a preset sparsification policy to control the number of the initial key frames to be smaller than the third preset threshold value includes: determining, from the initial key frame, two initial key frames whose acquisition times are adjacent to each other; filtering one of the two initial key frames; The video generation method of claim 6 , comprising:

8. 4. A method according to claim 1, wherein the intermediate state images further exhibit triggering actions for corresponding image editing operations.

9. 1. A video generation device, comprising: an acquisition module for acquiring an initial key frame in an image editing process for performing a series of image editing operations on an initial image to obtain a target image, the initial key frame being an intermediate state image between the initial image and the target image in the image editing process, where different initial key frames are intermediate state images when different image editing operations in the series of image editing operations are triggered in the image editing process, and the intermediate state images exhibit editing effects of corresponding image editing operations; a generating module for generating a target video based on the initial keyframes to record an image editing process of the target image; 23. A video generating device comprising:

10. An electronic device, one or more processors; a storage device for storing one or more programs; An electronic device, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement one or more steps of the video generation method according to any one of claims 1 to 8.

11. A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements one or more steps of the video generation method according to any one of claims 1 to 8.

12. A computer program comprising: A computer program comprising computer readable instructions which, when executed by a processor, cause the processor to perform one or more steps of the video generation method of any one of claims 1 to 8.

13. 9. A computer program product comprising computer readable instructions which, when executed by a processor, cause the processor to perform one or more steps of the video generation method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Video file production method, device and apparatus and readable storage medium

    CN110087123A

  • Video production method and device

    CN114025103A

  • Photo sticker creation device, control method for photo sticker creation device, and management device

    JP2015179224A

  • Video editing method, its terminal and recording medium

    JP2016504790A

  • Image processing device and image processing method

    JP2019029810A