Dynamic photo generation method and device, electronic equipment and storage medium

By receiving user input in an electronic device and performing video processing, and generating dynamic photos with mirror-moving effects, the problem of requiring moving or rotating devices in the prior art to obtain mirror-moving effects is solved, and the convenience is improved.

CN119496993APending Publication Date: 2025-02-21VIVO MOBILE COMM CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411568973.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

When taking dynamic photos, existing electronic devices need to move or rotate the equipment in order to obtain the effect of using the mirror, resulting in less convenience.

Method used

By receiving user input, the video recorded within the preset time period is obtained before and after a specified time, and the video processing method corresponding to the mirror mode is used to process the video to generate dynamic photos with the mirror effect.

Benefits of technology

The device can be obtained without moving or rotating the device, which improves the convenience of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496993A_ABST
    Figure CN119496993A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic photo generation method and device, electronic equipment and a storage medium, and belongs to the technical field of communication. The method comprises the following steps: receiving first input of a user; in response to the first input, obtaining a first video recorded within a preset duration before and after a first moment, the first moment being a moment when the first input is received; performing video processing on the first video by adopting a video processing mode corresponding to the first mirror operation mode to obtain a second video; and generating a first dynamic photo according to the second video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a method, device, electronic device and storage medium for generating dynamic photos. Background Art

[0002] With the rapid development of photography technology, electronic devices generally have the function of taking dynamic photos. After the dynamic photo switch is turned on by the electronic device, when the user presses the shutter, the electronic device can use the image taken at the moment of pressing the shutter as the display image of the dynamic photo, and obtain a short video recorded before and after the user presses the shutter as the dynamic image content of the dynamic photo, and then associate the display image with the recorded video and save it in the album. When the user wants to view the dynamic photo, he can long press the display image of the dynamic photo to make the electronic device play the associated video.

[0003] However, when the user wants the dynamic photo to have some camera movement effects, the user needs to move or rotate the electronic device during the process of taking the dynamic photo with the electronic device to take the dynamic photo with the camera movement effects. In this way, the convenience of the electronic device to obtain the dynamic photo with the camera movement effects is low. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for generating dynamic photos, which can improve the convenience of electronic devices in obtaining dynamic photos with camera movement effects.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a dynamic photo, the method comprising: receiving a first input from a user; in response to the first input, obtaining a first video recorded within a preset time length before and after a first moment, the first moment being the moment when the first input is received; using a video processing method corresponding to a first camera movement mode to perform video processing on the first video to obtain a second video; and generating a first dynamic photo based on the second video.

[0006] In a second aspect, an embodiment of the present application provides a device for generating a dynamic photo, the device comprising a receiving module, an acquisition module, a processing module and a generating module. The receiving module is used to receive a first input from a user. The acquisition module is used to obtain a first video recorded within a preset time period before and after a first moment in response to the first input received by the receiving module, the first moment being the moment when the first input is received. The processing module is used to perform video processing on the first video acquired by the acquisition module using a video processing method corresponding to the first camera movement mode to obtain a second video. The generating module is used to generate a first dynamic photo based on the second video processed by the processing module.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program / program product, wherein the computer program / program product is stored in a storage medium, and the program / program product is executed by at least one processor to implement the method described in the first aspect.

[0011] In an embodiment of the present application, a first input from a user is received; in response to the first input, a first video recorded within a preset time length before and after a first moment is obtained, the first moment being the moment when the first input is received; the first video is processed by a video processing method corresponding to the first camera movement mode to obtain a second video; and a first dynamic photo is generated based on the second video. In this solution, after the electronic device obtains the first video, it can first use the video processing method corresponding to the first camera movement mode to process the first video, and then generate a first dynamic photo based on the second video obtained after the video processing, so that a dynamic photo with a camera movement shooting effect can be directly obtained. There is no need to move or rotate the electronic device in the process of taking dynamic photos to add a camera movement shooting effect to the dynamic photos. This improves the convenience of the electronic device in obtaining dynamic photos with a camera movement shooting effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is one of the flow charts of a method for generating a dynamic photo provided in an embodiment of the present application;

[0013] Figure 2 is a schematic diagram of an example of taking dynamic photos provided in an embodiment of the present application;

[0014] Figure 3 This is a second flow chart of a method for generating a dynamic photo provided in an embodiment of the present application;

[0015] Figure 4 This is one of the example schematic diagrams of determining a cropping area provided in an embodiment of the present application;

[0016] Figure 5 This is a second example schematic diagram of determining a cropping area provided in an embodiment of the present application;

[0017] Figure 6 This is a third example schematic diagram of determining a cropping area provided in an embodiment of the present application;

[0018] Figure 7 This is one of the example schematic diagrams of a video processing provided by an embodiment of the present application;

[0019] Figure 8 This is a second example schematic diagram of a video processing provided by an embodiment of the present application;

[0020] Fig. 9 This is a third flow chart of a method for generating a dynamic photo provided in an embodiment of the present application;

[0021] FIG. 10(A) is one of the schematic diagrams of an example of adjusting the camera movement mode of a dynamic photo provided by an embodiment of the present application;

[0022] FIG. 10(B) is a second schematic diagram of an example of adjusting the camera movement mode of a dynamic photo provided by an embodiment of the present application;

[0023] FIG. 11(A) is a third schematic diagram of an example of video processing provided in an embodiment of the present application;

[0024] FIG. 11(B) is a fourth schematic diagram of an example of video processing provided in an embodiment of the present application;

[0025] FIG. 11(C) is a fifth schematic diagram of an example of video processing provided in an embodiment of the present application;

[0026] FIG. 12(A) is one of the schematic diagrams of an example of adjusting the video content of a dynamic photo provided in an embodiment of the present application;

[0027] FIG. 12(B) is a second schematic diagram of an example of adjusting the video content of a dynamic photo provided by an embodiment of the present application;

[0028] FIG. 12(C) is a third schematic diagram of an example of adjusting the video content of a dynamic photo provided by an embodiment of the present application;

[0029] FIG. 12(D) is a fourth schematic diagram of an example of adjusting the video content of a dynamic photo provided in an embodiment of the present application;

[0030] FIG. 12(E) is a fifth schematic diagram of an example of adjusting the video content of a dynamic photo provided in an embodiment of the present application;

[0031] Fig.13This is the sixth example schematic diagram of a video processing provided by an embodiment of the present application;

[0032] Fig.14 It is a structural schematic diagram of a dynamic photo generation device provided in an embodiment of the present application;

[0033] Fig.15 This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;

[0034] Fig.16 This is the second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0036] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0037] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0038] The following is a detailed description of the method for generating dynamic photos provided in the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0039] The method for generating dynamic photos in the embodiment of the present application can be applied to the scene of taking dynamic photos.

[0040] At present, electronic device cameras generally have the function of taking dynamic photos. The implementation principle is to record a photo and a short video at the same time when the user presses the shutter. Generally, after turning on the dynamic photo switch, the camera will record a 1.5-second video before and after the user takes the photo, and this video and the photo are saved together in the album. When the user views the dynamic photo, the electronic device can play the associated video. However, when the user wants the dynamic photo to have some camera movement effects, the user needs to move the electronic device or rotate the electronic device during the process of taking the dynamic photo by the electronic device to take a dynamic photo with a camera movement effect. In this way, the convenience of the electronic device to obtain dynamic photos with camera movement effects is low.

[0041] In the method, device, electronic device and storage medium for generating dynamic photos provided in the embodiments of the present application, after the electronic device obtains the first video, it can first use the video processing method corresponding to the first camera movement mode to perform video processing on the first video, and then generate the first dynamic photo according to the second video obtained after the video processing, so that the dynamic photo with the camera movement shooting effect can be directly obtained. There is no need to move or rotate the electronic device in the process of taking the dynamic photo to add the camera movement shooting effect to the dynamic photo. Thereby, the convenience of the electronic device in obtaining the dynamic photo with the camera movement shooting effect is improved.

[0042] The execution subject of the method for generating dynamic photos provided in the embodiment of the present application may be a dynamic photo generating device, and the dynamic photo generating device may be an electronic device, or a functional module or entity in an electronic device. The technical solution provided in the embodiment of the present application is described below by taking an electronic device as an example.

[0043] The present application embodiment provides a method for generating a dynamic photo. Figure 1 A flow chart of a method for generating a dynamic photo provided by an embodiment of the present application is shown, and the method can be applied to electronic devices. Figure 1 As shown, the method for generating dynamic photos provided in the embodiment of the present application may include the following steps 201 to 204.

[0044] Step 201: The electronic device receives a first input from a user.

[0045] In some embodiments of the present application, the first input is used to take dynamic photos.

[0046] In some embodiments of the present application, the first input includes but is not limited to: a touch input performed by a user through a touch device such as a finger or a stylus, or a voice command input by a user, or a specific gesture input by a user, or a click input, or other feasible input. The specific input can be determined according to actual use requirements and is not limited in the embodiments of the present invention.

[0047] In some embodiments of the present application, the above-mentioned specific gesture can be any one of a single-click gesture, a sliding gesture, a drag gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture.

[0048] In some embodiments of the present application, the click input may be a single click input, a double click input, or any number of click inputs, and may also be a long press input or a short press input.

[0049] In some embodiments of the present application, the electronic device may receive a first input from a user in a shooting preview interface to take a dynamic photo.

[0050] In some embodiments of the present application, the first input may be an input to a shooting control in a shooting preview interface.

[0051] In some embodiments of the present application, the electronic device may receive user input of an application icon of a camera application and display the above-mentioned shooting preview interface.

[0052] Step 202: In response to a first input, the electronic device obtains a first video recorded within a preset time period before and after a first moment.

[0053] In the embodiment of the present application, the first moment is the moment when the first input is received.

[0054] In some embodiments of the present application, after displaying the above-mentioned shooting preview interface, the electronic device can receive the user's input on the dynamic photo switch and enter the dynamic photo shooting mode, and then when the electronic device receives the user's first input, the electronic device can obtain the first video recorded within a preset time length before and after the first moment.

[0055] It can be understood that when the dynamic photo switch is turned on, the electronic device can record the video in real time, so that when receiving the user's first input, the electronic device can obtain the first video recorded within a preset time length before and after the moment of the first input.

[0056] For example, Figure 2 As shown, when the user wants to take a dynamic photo, the user can click the shooting control in the shooting preview interface when the electronic device is in the dynamic photo shooting mode, that is, the first input mentioned above, so that the electronic device obtains the first video recorded within a preset time period before and after the user input moment.

[0057] In some embodiments of the present application, when the dynamic photo switch is turned on, the electronic device can record video in real time through an ultra-wide-angle camera to provide a larger field of view for subsequent cropping of video frames of the first video.

[0058] Step 203: The electronic device processes the first video using a video processing method corresponding to the first camera movement mode to obtain a second video.

[0059] In some embodiments of the present application, the first camera movement mode may be at least one of the following: a translation camera movement mode, a push camera mode, a pull camera mode, a rotation camera movement mode, and a focus mode.

[0060] In some embodiments of the present application, the above-mentioned translation mirror movement mode can be any one of the following: a panning mode and a lowering mode.

[0061] In some embodiments of the present application, the first video is processed using a video processing method corresponding to the translation mode, which can achieve the effect of translation shooting of the camera of the electronic device without moving the electronic device.

[0062] In some embodiments of the present application, the first video is processed using a video processing method corresponding to the panning mode, which can achieve the effect of shooting by panning the camera of the electronic device from left to right or from right to left without moving the electronic device.

[0063] In some embodiments of the present application, the first video is processed using a video processing method corresponding to the down-mirror mode, which can achieve the effect of shooting by moving the camera of the electronic device from top to bottom or from bottom to top without moving the electronic device.

[0064] In some embodiments of the present application, the first video is processed using a video processing method corresponding to the push-lens mode, which can achieve the effect of gradually approaching the main object for shooting with the camera of the electronic device without moving the electronic device.

[0065] In some embodiments of the present application, the first video is processed using a video processing method corresponding to the zoom mode, which can achieve the effect of gradually moving the camera of the electronic device away from the main object for shooting without moving the electronic device.

[0066] In some embodiments of the present application, the first video is processed using a video processing method corresponding to the rotating camera mode, which can achieve the effect of rotating the electronic device for shooting without moving the electronic device.

[0067] In some embodiments of the present application, the first video is processed using a video processing method corresponding to the focus mode, so that the subject object in the video screen gradually changes from blur to focus without the user operating the electronic device.

[0068] Step 204: The electronic device generates a first dynamic photo based on the second video.

[0069] In some embodiments of the present application, when the electronic device receives the first input from the user, it can also take a picture to obtain a first image taken at the first moment, and then the electronic device can generate the above-mentioned first dynamic photo based on the first image and the second video.

[0070] It can be understood that when the electronic device receives the first input from the user, it can capture the above-mentioned first image and obtain the first video recorded within a preset time period before and after the first moment.

[0071] In some embodiments of the present application, after the electronic device generates the first dynamic photo, the first video can be associated with the first dynamic photo and saved. It can also be understood that the electronic device associates and saves the first image, the first video, and the second video.

[0072] In some embodiments of the present application, when displaying an album interface, the electronic device can receive user input for a first dynamic photo displayed in the album interface and play a second video.

[0073] In some embodiments of the present application, the electronic device may also receive user input on the first dynamic photo, and share the first dynamic photo, that is, share the associated first image and second video.

[0074] In the method for generating dynamic photos provided in the embodiment of the present application, after acquiring the first video, the electronic device can first use the video processing method corresponding to the first camera movement mode to perform video processing on the first video, and then generate the first dynamic photo according to the second video obtained after the video processing, so that the dynamic photo with the camera movement shooting effect can be directly obtained. There is no need to move or rotate the electronic device in the process of taking the dynamic photo to add the camera movement shooting effect to the dynamic photo. Thereby, the convenience of the electronic device in acquiring the dynamic photo with the camera movement shooting effect is improved.

[0075] In some embodiments of the present application, before the above-mentioned step 201, the method for generating dynamic photos provided in the embodiments of the present application further includes any one of the following steps 301 to 305.

[0076] Step 301: When detecting that a first object is included in a shooting preview interface, the electronic device determines a camera movement mode that matches the first object as a first camera movement mode.

[0077] In some embodiments of the present application, the first object may be understood as a photographing subject object.

[0078] In some embodiments of the present application, the first object may be any one of the following: an animal, a plant, a person, a toy, a building, an electrical appliance, a table, etc. The embodiments of the present application do not limit this.

[0079] In some embodiments of the present application, when displaying a shooting preview interface, the electronic device may detect whether the shooting preview interface includes a first object. When the shooting preview interface includes the first object, the electronic device may determine a camera movement mode that matches the first object as the first camera movement mode.

[0080] For example, when the first object is a person, the camera movement mode matched with the first object may be any one of the following: focus mode, push-lens mode, and pull-lens mode. This embodiment of the present application does not limit this.

[0081] For example, when the first object is a plant, the camera movement mode matched with the first object may be any one of the following: a translation camera movement mode and a rotation camera movement mode. This embodiment of the present application does not limit this.

[0082] In some embodiments of the present application, when it is detected that the shooting preview interface includes a first object, the electronic device can focus on the first object and display a selection box in the display area of ​​the first object to indicate that the focused object is the first object in the shooting preview interface.

[0083] In some embodiments of the present application, when no obvious shooting subject object is detected in the shooting preview interface, the electronic device may determine the translation camera movement mode as the first camera movement mode.

[0084] In some embodiments of the present application, when no obvious shooting subject is detected in the shooting preview interface and it is detected that the shooting scene includes scenery (for example, sea, mountain, sunset), the electronic device can determine the translation movement mode as the first movement mode.

[0085] In some embodiments of the present application, when no obvious subject is detected in the shooting preview interface and the shooting scene is detected to be relatively messy (for example, a messy bedroom), the electronic device can enter a recording mode of a normal dynamic photo, and after acquiring the first video, directly generate a first dynamic photo based on the first video.

[0086] Step 302: When receiving a user input on a second object in the shooting preview interface, the electronic device determines a camera movement mode that matches the second object as a first camera movement mode.

[0087] In some embodiments of the present application, the second object may be any of the following: animals, plants, people, toys, buildings, electrical appliances, tables, etc. The embodiments of the present application do not limit this.

[0088] In some embodiments of the present application, the second object may be understood as an object that the user wants to photograph.

[0089] In some embodiments of the present application, when the electronic device receives user input on a second object in a shooting preview interface, the electronic device may focus on the second object and display a selection box in the display area of ​​the second object to indicate that the focused object is the second object in the shooting preview interface.

[0090] For example, when the second object is a person, the camera movement mode matched with the second object may be any one of the following: focus mode, push-lens mode, and pull-lens mode. This embodiment of the present application does not limit this.

[0091] For example, when the second object is a plant, the camera movement mode matched with the second object may be any one of the following: a translation camera movement mode and a rotation camera movement mode. This embodiment of the present application does not limit this.

[0092] Step 303: upon receiving a user input of a first camera movement mode identifier among at least one camera movement mode identifier displayed in the shooting preview interface, the electronic device determines the camera movement mode corresponding to the first camera movement mode identifier as the first camera movement mode.

[0093] In some embodiments of the present application, when the electronic device receives a user input to a dynamic photo switch and enters a dynamic photo shooting mode, the electronic device may display at least one camera movement mode identifier in a shooting preview interface.

[0094] In some embodiments of the present application, when the electronic device enters a dynamic photo shooting mode, the electronic device may display a first control in a shooting preview interface, and the electronic device may receive user input to the first control and display at least one camera movement mode identifier.

[0095] In some embodiments of the present application, the at least one camera movement mode identifier can be at least one of the following: a camera movement mode identifier corresponding to a translation camera movement mode, a camera movement mode identifier corresponding to a push camera mode, a camera movement mode identifier corresponding to a pull camera mode, a camera movement mode identifier corresponding to a rotation camera movement mode, and a camera movement mode identifier corresponding to a focus mode.

[0096] In some embodiments of the present application, the first camera movement mode identifier may be any camera movement mode identifier among at least one camera movement mode identifier.

[0097] It is understandable that the user can manually select a camera movement mode, so that after the electronic device captures a first video, the electronic device can use the video processing method corresponding to the camera movement mode selected by the user to process the first video to obtain a second video.

[0098] Step 304: The electronic device determines the camera movement mode corresponding to the first distance change information as the first camera movement mode.

[0099] In the embodiment of the present application, the first distance change information is the distance change information between the electronic device and the photographed subject.

[0100] In some embodiments of the present application, the first distance change information may be any one of the following: the distance between the electronic device and the subject object is gradually approaching, or the distance between the electronic device and the subject object is gradually getting farther away.

[0101] In some embodiments of the present application, when displaying the above-mentioned shooting preview interface, the electronic device can detect the change in the distance between the electronic device and the shooting subject object to obtain the above-mentioned first distance change information.

[0102] Exemplarily, the electronic device can determine that the distance between the electronic device and the photographed subject is gradually approaching when it detects that the display range of the photographed subject in the shooting preview interface is getting larger and larger; and can determine that the distance between the electronic device and the photographed subject is gradually becoming larger when it detects that the display range of the photographed subject in the shooting preview interface is getting smaller and smaller.

[0103] In some embodiments of the present application, when the first distance change information is: when the distance between the electronic device and the subject object is gradually approaching, the mirror movement mode corresponding to the first distance change information may be a push mirror mode.

[0104] In some embodiments of the present application, when the first distance change information is: when the distance between the electronic device and the subject object is gradually getting farther, the mirror movement mode corresponding to the first distance change information may be a pull-mirror mode.

[0105] It can be understood that in order to ensure the ease of shooting, the electronic device can judge the user's intention through the user's unconscious movements during the shooting process. When it is detected that the user is approaching the main object, the push-lens effect is executed to zoom in; conversely, when it is detected that the user is away from the main object, the pull-lens effect is executed to zoom out.

[0106] Step 305: The electronic device determines the camera movement mode corresponding to the first trajectory information as the first camera movement mode.

[0107] In an embodiment of the present application, the first trajectory information is used to indicate the movement trajectory of the electronic device.

[0108] It can be understood that before receiving the first input, the electronic device can detect the movement trajectory of the electronic device, and then determine the mirror movement mode of the electronic device based on the movement trajectory of the electronic device.

[0109] In some embodiments of the present application, when the first trajectory information indicates that the electronic device is rotating, the electronic device may determine the rotational camera movement mode as the first camera movement mode.

[0110] In some embodiments of the present application, when the first trajectory information indicates a translational movement of the electronic device, the electronic device may determine the translational movement mode as the first movement mode.

[0111] In some embodiments of the present application, when the first trajectory information indicates a translational motion of the electronic device and the distance between the electronic device and the photographed subject object is gradually approaching, the electronic device may determine the zoom mode as the first lens movement mode.

[0112] In some embodiments of the present application, when the first trajectory information indicates a translational motion of the electronic device and the distance between the electronic device and the subject object gradually becomes farther, the electronic device may determine the push-mirror mode as the first mirror movement mode.

[0113] In this way, since the electronic device can determine the first camera movement mode according to the first object detected in the shooting preview interface; or determine the first camera movement mode according to the second object selected by the user in the shooting preview interface; or determine the first camera movement mode according to the camera movement mode identifier selected by the user; or determine the first camera movement mode according to the change in the distance between the electronic device and the shooting subject object; or determine the first camera movement mode according to the movement trajectory of the electronic device; the diversity of the electronic device in determining the camera movement mode is improved, and the flexibility of the electronic device in processing the first video using the video processing method corresponding to the first camera movement mode is improved.

[0114] In some embodiments of the present application, the first camera movement mode is a panning camera movement mode; the first video includes at least two video frames; Figure 1 ,like Figure 3 As shown, the above step 203 can be specifically implemented through the following steps 203a and 203b.

[0115] Step 203a: The electronic device determines a cropping area for each of at least two video frames.

[0116] In the embodiment of the present application, the content in the cropping area of ​​any video frame is at least partially the same as the content in the cropping area of ​​any video frame adjacent to the video frame.

[0117] In some embodiments of the present application, the cropping area is the area retained after the electronic device crops the video frame. It can be understood that after determining the cropping area of ​​the video frame, the electronic device retains the video frame content in the cropping area and crops the video frame content outside the cropping area.

[0118] For example, when the video frame includes the cropping area A and the area B outside the cropping area, after the video frame is cropped according to the cropping area A, the cropped video frame only includes the content in the cropping area A.

[0119] In some embodiments of the present application, the cropped area of ​​the i+1th video frame moves a preset distance relative to the cropped area of ​​the i-th video frame; wherein the moving direction can be any of the following: left, right, up, down.

[0120] In some embodiments of the present application, the left edge of the cropped area of ​​the first video frame of the at least two video frames mentioned above can overlap with the left edge of the first video frame, that is, the cropped area moves from the leftmost side of the video frame to the rightmost side, thereby achieving the effect of the camera of the electronic device moving to the right for shooting.

[0121] In some embodiments of the present application, the right edge of the cropped area of ​​the first video frame of the at least two video frames mentioned above can overlap with the right edge of the first video frame, that is, the cropped area moves from the rightmost side of the video frame to the leftmost side, thereby achieving the effect of the camera of the electronic device moving to the left for shooting.

[0122] In some embodiments of the present application, the upper edge of the cropped area of ​​the first video frame of the at least two video frames mentioned above can overlap with the upper edge of the first video frame, that is, the cropped area moves from the top to the bottom of the video frame, thereby achieving the effect of the electronic device's camera moving downward to shoot.

[0123] In some embodiments of the present application, the lower edge of the cropped area of ​​the first video frame of the at least two video frames mentioned above can overlap with the upper edge of the first video frame, that is, the cropped area moves from the bottom to the top of the video frame, thereby achieving the effect of the electronic device's camera moving upward to shoot.

[0124] For example, the effect of moving the camera of an electronic device to the right to shoot is described as an example. Figure 4As shown, the left edge of the cropping area of ​​the first video frame overlaps with the left edge of the first video frame, the cropping area of ​​the second video frame moves a distance A relative to the position of the cropping area of ​​the first video frame, that is, the above-mentioned preset distance, and the content in the cropping area of ​​the second video frame is at least partially the same as the content in the cropping area of ​​the first video frame; the cropping area of ​​the i-th video frame moves a distance A relative to the position of the cropping area of ​​the i-1-th video frame, the cropping area of ​​the i-th video frame moves a distance (i-1)A relative to the position of the cropping area of ​​the 1st video frame, and the content in the cropping area of ​​the i-th video frame is at least partially the same as the content in the cropping area of ​​the i-1-th video frame; the cropping area of ​​the i+1-th video frame moves a distance A relative to the position of the cropping area of ​​the i-th video frame, the cropping area of ​​the i+1-th video frame moves a distance iA relative to the position of the cropping area of ​​the 1st video frame, and the content in the cropping area of ​​the i+1-th video frame is at least partially the same as the content in the cropping area of ​​the i-th video frame. Thereby, the effect of the camera of the electronic device moving to the right for shooting is achieved, but in fact the electronic device does not move.

[0125] Step 203b: The electronic device crops each video frame according to the cropping area of ​​each video frame, and generates a second video based on at least two cropped video frames.

[0126] In some embodiments of the present application, the electronic device crops the video frame according to the cropping area, which can be understood as: the electronic device retains the video frame content within the cropping area and removes the video frame content outside the cropping area.

[0127] In some embodiments of the present application, after the electronic device crops each video frame according to the cropping area of ​​each video frame, it can synthesize at least two cropped video frames to generate a second video.

[0128] Exemplarily, after cropping each video frame according to the cropping area of ​​each video frame, the electronic device can obtain the capture time of each video frame, and then arrange and combine at least two cropped video frames from early to late according to the capture time to generate a second video.

[0129] In some embodiments of the present application, the electronic device may crop any video frame according to the cropping area of ​​any video frame and then replace the any video frame with the cropped video frame, thereby generating a second video.

[0130] In this way, since the cropping area of ​​the i+1th video frame in at least two video frames determined by the electronic device moves a preset distance relative to the cropping area of ​​the i-th video frame, the content in the cropping area of ​​the i+1th video frame is at least partially identical to the content in the cropping area of ​​the i-th video frame. Therefore, the effect of camera translation of the electronic device can be achieved without moving the electronic device, thereby improving the convenience of the electronic device in obtaining dynamic photos with translation effect.

[0131] In some embodiments of the present application, the first camera movement mode is a push-camera mode or a pull-camera mode; the first video includes at least two video frames; and the step 203 can be specifically implemented through the following steps 203c and 203d.

[0132] Step 203c: The electronic device determines a cropping area for each of at least two video frames based on the position of the main subject in the video screen of the first video.

[0133] In the embodiment of the present application, the cropping area of ​​each video frame includes the main object.

[0134] In an embodiment of the present application, when the first camera movement mode is the push-camera mode, a cropping area of ​​any video frame is larger than a cropping area of ​​a next video frame of any video frame.

[0135] It is understandable that in order to adapt to the size of the electronic device screen, the cropped video frame needs to be magnified and displayed, and as the cropped area of ​​the video frame gradually shrinks, the magnification factor becomes larger and larger. Therefore, the subject object will be gradually magnified, thereby achieving the effect of the camera gradually approaching the subject object, but in fact the electronic device does not move.

[0136] For example, the effect of gradually approaching the subject object to shoot by the camera of the electronic device is described as follows. Figure 5 As shown, the cropped area of ​​the first video frame of the first video is larger than the cropped area of ​​the second video frame, and the cropped area of ​​the first video frame and the cropped area of ​​the second video frame both contain the "little girl", that is, the above-mentioned subject of the shooting; the cropped area of ​​the i-th video frame of the first video is larger than the cropped area of ​​the i+1-th video frame, and the cropped area of ​​the i-th video frame and the cropped area of ​​the i+1-th video frame both contain the "little girl". In order to adapt to the size of the electronic device screen, the cropped video frame needs to be enlarged and displayed, because the cropped video frame is getting smaller and smaller, so the magnification is getting larger and larger. Therefore, the "little girl" will be gradually enlarged, so as to achieve the shooting effect of the camera gradually approaching the "little girl", but in fact the electronic device has not moved.

[0137] In an embodiment of the present application, when the first camera movement mode is the zoom mode, the cropping area of ​​any video frame is smaller than the cropping area of ​​the next video frame of any video frame.

[0138] It is understandable that in order to adapt to the size of the electronic device screen, the cropped video frame needs to be enlarged and displayed. As the cropped area of ​​the video frame gradually increases, the magnification becomes smaller and smaller. Therefore, the subject of the shooting will gradually be reduced, so as to achieve the effect of the camera gradually moving away from the subject of the shooting, but in fact the electronic device does not move.

[0139] For example, the effect of realizing that the camera of an electronic device gradually moves away from the subject to be photographed is described as an example. Figure 6 As shown, the cropped area of ​​the first video frame of the first video is smaller than the cropped area of ​​the second video frame, and the cropped area of ​​the first video frame and the cropped area of ​​the second video frame both contain the "little girl", that is, the above-mentioned subject of the shooting; the cropped area of ​​the i-th video frame of the first video is smaller than the cropped area of ​​the i+1-th video frame, and the cropped area of ​​the i-th video frame and the cropped area of ​​the i+1-th video frame both contain the "little girl". In order to adapt to the size of the electronic device screen, the cropped video frame needs to be enlarged and displayed, because the cropped video frame changes from small to large, and the magnification becomes smaller and smaller. Therefore, the "little girl" will gradually be reduced, so as to achieve the shooting effect of the camera gradually moving away from the "little girl", but in fact the electronic device has not moved.

[0140] Step 203d: The electronic device crops each video frame according to the cropping area, and adjusts the size of the cropped video frame to the first size to obtain a second video.

[0141] In an embodiment of the present application, the first size is the size of a video frame included in the first video, and the second video includes at least two video frames after resizing.

[0142] It can be understood that in order to adapt to the size of the electronic device screen, the cropped video frame needs to be enlarged and displayed, and then the second video is generated based on the enlarged video frame.

[0143] In some embodiments of the present application, the first size may also be a preset size to ensure that the sizes of all cropped video frames are the same.

[0144] In some embodiments of the present application, after adjusting the size of the cropped video frame, the electronic device may synthesize at least two resized video frames to generate a second video.

[0145] Exemplarily, after adjusting the size of the cropped video frame, the electronic device may obtain the acquisition time of each video frame, and then arrange and combine at least two resized video frames according to the acquisition time from early to late to generate a second video.

[0146] In some embodiments of the present application, the electronic device may crop any video frame according to the cropping area of ​​any video frame and adjust the size of the cropped video frame to a first size, and then replace the any video frame with the resized video frame to generate a second video.

[0147] Thus, on the one hand, since the cropping area of ​​the video frame is getting smaller and smaller in at least two video frames determined by the electronic device, and the cropping area of ​​each video frame contains the subject object, in order to adapt to the size of the electronic device screen, the cropped video frame needs to be enlarged and displayed, and as the cropping area of ​​the video frame becomes smaller and smaller, the magnification of the video frame becomes larger and larger. Therefore, the subject object will be gradually enlarged, so as to achieve the shooting effect of the camera gradually approaching the subject object, but in fact the electronic device does not move. Thus, the convenience of the electronic device to obtain dynamic photos with the push mirror mode effect is improved. On the other hand, since the cropping area of ​​the video frame is getting larger and larger in at least two video frames determined by the electronic device, and the cropping area of ​​each video frame contains the subject object, in order to adapt to the size of the electronic device screen, the cropped video frame needs to be enlarged and displayed, and as the cropping area of ​​the video frame changes from small to large, the magnification of the video frame becomes smaller and smaller. Therefore, the subject object will be gradually reduced, so as to achieve the shooting effect of the camera gradually moving away from the subject object, but in fact the electronic device does not move. Thus, the convenience of the electronic device to obtain dynamic photos with the pull mirror mode effect is improved.

[0148] In some embodiments of the present application, the first camera movement mode is a push-camera mode, and the at least two video frames include: N first video frames and N second video frames captured by different cameras of the electronic device, where N is an integer greater than 1. The "electronic device determines the cropping area of ​​each of the at least two video frames" in the above step 203c can be specifically implemented by the following step 203c1, and the above step 203d can be specifically implemented by the following steps 203d1 and 203d2.

[0149] Step 203c1: The electronic device determines a cropping area for each first video frame.

[0150] In the embodiment of the present application, the cropping area of ​​each first video frame includes a subject object.

[0151] In some embodiments of the present application, when the first camera movement mode is a push-camera mode, a cropping area of ​​any first video frame is larger than a cropping area of ​​a next video frame of any first video frame.

[0152] It should be noted that, for the description of the electronic device determining the cropping area of ​​each of the N first video frames, please refer to the description of the electronic device determining the cropping area of ​​each of the at least two video frames included in the first video in the above step 203c, which will not be repeated here.

[0153] Step 203d1: The electronic device crops the first portion of video frames according to the cropping area of ​​the first portion of video frames in the N first video frames.

[0154] It can be understood that, for each video frame in the first part of video frames, the electronic device can retain the video frame content within the cropping area of ​​each video frame, and remove the video frame content outside the cropping area.

[0155] Step 203d2: When it is detected that the picture clarity of the second portion of the video frames in the N first video frames is less than a preset threshold, the electronic device crops the third portion of the video frames in the N second video frames according to the cropping area of ​​the second portion of the video frames in the N first video frames, and adjusts the sizes of the cropped first portion of the video frames and the cropped third portion of the video frames to the first size to obtain the second video.

[0156] In an embodiment of the present application, the number of video frames in the second portion of video frames is the same as the number of video frames in the third portion of video frames.

[0157] In some embodiments of the present application, the sorting position of the second portion of video frames in the N first video frames is the same as the sorting position of the third portion of video frames in the N second video frames.

[0158] For example, when the second part of video frames is the last video frame among the N first video frames, the third part of video frames is the last video frame among the N second video frames.

[0159] In an embodiment of the present application, the content in the cropped area of ​​the second portion of the video frame is the same as the content in the cropped area of ​​the third portion of the video frame.

[0160] In some embodiments of the present application, the cropped area of ​​the second portion of the video frame and the cropped area of ​​the third portion of the video frame both include the subject object.

[0161] In some embodiments of the present application, the electronic device crops the third portion of the N second video frames according to the cropping area of ​​the second portion of the video frames in the N first video frames. Specifically, the electronic device obtains the first content in the cropping area of ​​the second portion of the video frames, and then determines the cropping area of ​​the third portion of the video frames in the N second video frames based on the first content, and the second content in the cropping area of ​​the third portion of the video frames is the same as the first content. The first content and the second content both include the subject object in the video frame.

[0162] In some embodiments of the present application, the N first video frames may be captured by an ultra-wide-angle camera of an electronic device, and the N second video frames may be captured by a telephoto camera of an electronic device.

[0163] In some embodiments of the present application, the electronic device may, before receiving the user's first input, turn on the ultra-wide-angle camera and the telephoto camera to record video when it determines that the first camera movement mode is the push-camera mode, so that when the user's first input is received, the electronic device can obtain N first video frames and N second video frames captured by different cameras.

[0164] It can be understood that when the first camera movement mode is the push-camera mode, since the cropped area of ​​the video frame will gradually become smaller, the proportion of the subject object in the video frame will gradually increase. In order to ensure the clarity of the captured picture, when it is detected that the clarity of the second part of the video frames in the N first video frames captured by the ultra-wide-angle camera is less than a preset threshold, the electronic device can use the third part of the video frames in the N second video frames captured by the telephoto camera to replace the second part of the video frames, that is, the first part of the video frames shot by the ultra-wide-angle camera and the third part of the video frames shot by the telephoto camera are cropped to generate a second video, thereby avoiding the problem of unclear video under the ultra-wide-angle camera when the second video is generated by all N first video frames shot by the ultra-wide-angle camera due to the gradually increasing proportion of the subject object in the video frame.

[0165] For example, the effect of gradually approaching the camera of an electronic device to shoot a subject is described as follows. Figure 7 As shown, the electronic device crops the cropped areas of the first i first video frames captured by the ultra-wide-angle camera, and crops the cropped area of ​​the i+1th second video frame captured by the telephoto camera. The electronic device can then generate a second video based on the cropped video frames, so that the video images of each frame of the second video are clearer.

[0166] In an embodiment of the present application, the second video includes a first portion of video frames and a third portion of video frames after resizing.

[0167] In some embodiments of the present application, the electronic device may synthesize the resized first portion of video frames and the resized third portion of video frames after resizing the cropped first portion of video frames and the cropped third portion of video frames to a first size to generate a second video.

[0168] Exemplarily, the electronic device may obtain the acquisition time of the first portion of video frames and the third portion of video frames, and then arrange and combine the resized first portion of video frames and the third portion of video frames from early to late according to the acquisition time to generate the second video.

[0169] In this way, since the cropped area of ​​the video frame is small and the main object occupies a large proportion of the video screen, in order to avoid a decrease in the clarity of the video screen under the ultra-wide-angle camera, the video screen at the same position under the telephoto camera can be used instead, thereby ensuring the clarity of the captured image.

[0170] In some embodiments of the present application, when the first camera movement mode is the zoom mode, since the cropping area of ​​the video frame changes from small to large, the proportion of the subject object in the video frame changes from large to small. In order to ensure the clarity of the captured picture, when it is detected that the clarity of the second part of the video frames in N first video frames (for example, the first video frame in N first video frames) is less than a preset threshold, the electronic device can use the third part of the video frames in N second video frames taken by the telephoto camera (for example, the first video frame in N second video frames) to replace the second part of the video frames in N first video frames, that is, the third part of the video frames in the N second video frames taken by the telephoto camera and the first part of the video frames in the N first video frames taken by the ultra-wide-angle camera (for example, the video frames except the first video frame in the N first video frames) are cropped to generate a second video, thereby avoiding the problem of unclear video pictures under the ultra-wide-angle camera when all N first video frames are taken by the ultra-wide-angle camera due to the large initial proportion of the subject object in the video frame.

[0171] Exemplarily, when the first camera movement mode is the zoom mode, the second portion of video frames may be the first video frame among N first video frames, and the third portion of video frames may be the first video frame among N second video frames.

[0172] In some embodiments of the present application, the first camera movement mode is a rotating camera movement mode; the first video includes at least two video frames; and the step 203 can be specifically implemented through the following steps 203e and 203f.

[0173] Step 203e: The electronic device determines a rotation angle of each of the at least two video frames based on the number of video frames included in the first video.

[0174] In an embodiment of the present application, the rotation angle of any video frame is smaller than the rotation angle of the next video frame of any video frame.

[0175] In some embodiments of the present application, the electronic device may determine the rotation angle of each video frame based on the maximum rotation angle of the video frame and the number of video frames included in the first video.

[0176] In some embodiments of the present application, the maximum rotation angle of the video frame may be any one of the following: 360°, 270°, 180°, etc. This embodiment of the present application does not limit this.

[0177] For example: when the maximum rotation angle of the video frame is 360° and the number of video frames contained in the first video is 36 frames, since 360÷36=10, it can be determined that the rotation angle of the first video frame is 10°, the rotation angle of the second video frame is 20°, ..., the rotation angle of the i-th video frame is i×10°, ..., and the rotation angle of the last video frame is 360°.

[0178] In some embodiments of the present application, the rotation direction of the at least two video frames may be any one of the following: right rotation, left rotation.

[0179] For example, the effect of rotating an electronic device to take a photo is described as follows. Figure 8 As shown, the rotation angle of the first video frame of the first video is smaller than that of the second video frame, and the rotation angle of the i-th video frame is smaller than that of the i+1-th video frame. Because the rotation angles of the video frames progress in sequence, the effect of rotating the electronic device for shooting can be achieved, but in fact the electronic device is not rotated.

[0180] Step 203f: The electronic device rotates each video frame according to the determined rotation angle of each video frame, and generates a second video based on at least two rotated video frames.

[0181] In some embodiments of the present application, after rotating each video frame according to the determined rotation angle of each video frame, the electronic device may synthesize at least two rotated video frames to generate a second video.

[0182] Exemplarily, after rotating each video frame according to the determined rotation angle of each video frame, the electronic device can obtain the capture time of each video frame, and then arrange and combine at least two rotated video frames from early to late according to the capture time to generate a second video.

[0183] In some embodiments of the present application, the electronic device may rotate any video frame according to a rotation angle determined for any video frame, and may replace the any video frame with the rotated video frame, thereby generating a second video.

[0184] In this way, since the electronic device can rotate each of the at least two video frames by a certain angle and generate a second video based on the at least two rotated video frames, the effect of rotating the electronic device for shooting can be achieved without the electronic device moving, thereby improving the convenience of the electronic device in obtaining dynamic photos with a rotating camera effect.

[0185] In some embodiments of the present application, the above-mentioned first camera movement mode is a focus mode; the first video includes at least two video frames, and the first video includes depth information, which is used to adjust the focus distance of each video frame; the above-mentioned step 203 can be specifically implemented by the following steps 203g and 203h.

[0186] Step 203g: The electronic device adjusts the focus distance of each video frame in at least two video frames based on the depth information.

[0187] In an embodiment of the present application, the focus distance of any video frame is greater than the focus distance of the next video frame of any video frame.

[0188] In some embodiments of the present application, the difference between the focus distance of any video frame and the focus distance of the next video frame of any video frame is a preset value.

[0189] In some embodiments of the present application, the above-mentioned depth information may also be referred to as depth of field information.

[0190] In some embodiments of the present application, as the focus distance of the video frame gradually decreases, the main object in the video screen can present a gradual effect from blurry to clear.

[0191] Step 203h: The electronic device generates a second video based on at least two video frames after adjusting the focus distance.

[0192] In some embodiments of the present application, after adjusting the focus distance of each video frame according to the determined focus distance of each video frame, the electronic device may synthesize at least two video frames after the focus distance is adjusted to generate a second video.

[0193] In this way, by adjusting the focus distance of each video frame, the subject object in the video screen can be gradually changed from blurred to clearly focused without the user operating the electronic device, thereby improving the convenience of the electronic device in obtaining dynamic photos with a focus effect.

[0194] In some embodiments of the present application, Figure 1 ,like Fig. 9 As shown, after the above step 204, the method for generating dynamic photos provided in the embodiment of the present application also includes the following steps 401 to 403.

[0195] Step 401: When displaying a first dynamic photo, the electronic device receives a second input from a user regarding a second camera movement mode identifier among at least one camera movement mode identifier.

[0196] In an embodiment of the present application, the second camera movement mode identifier corresponds to the second camera movement mode.

[0197] In some embodiments of the present application, the electronic device may receive user input on a second control in a display interface of the first dynamic photo, and display at least one camera movement mode identifier.

[0198] In some embodiments of the present application, the second input is used to adjust the video effect of the dynamic photo.

[0199] In some embodiments of the present application, the second input includes but is not limited to: a user touch inputting the second camera movement mode identifier through a touch device such as a finger or a stylus, or a voice command inputted by the user, or a specific gesture inputted by the user, or a click input, or other feasible input. The specific input can be determined according to actual use requirements and is not limited in the embodiments of the present invention.

[0200] In some embodiments of the present application, the second camera movement mode identifier may be a camera movement mode identifier corresponding to any one of a translation camera movement mode, a push camera mode, a pull camera mode, a rotation camera movement mode, and a focus mode.

[0201] In some embodiments of the present application, the second camera movement mode may be any one of the following: a translation camera movement mode, a push camera mode, a pull camera mode, a rotation camera movement mode, and a focus mode.

[0202] It can be understood that when the user is not satisfied with the video effect of the first dynamic photo, the user can reselect a camera movement mode to update the video effect of the dynamic photo.

[0203] For example, as shown in Figure 10(A), when the user views the first dynamic photo in the album, if the user is not satisfied with the camera movement effect of the first dynamic photo, the user can click on the "camera movement mode" control 22 in the display interface 21 of the first dynamic photo, that is, the above-mentioned second control, as shown in Figure 10(B), so that the electronic device displays a drop-down window 23, which includes: "shaking mode, lowering mode, pushing mode, pulling mode, rotating camera mode, focusing mode" and other modes corresponding to the camera movement mode identifier, that is, at least one of the above-mentioned camera movement mode identifiers, and then the user can click on the camera movement mode identifier 24 corresponding to the rotating camera movement mode, that is, the above-mentioned second camera movement mode identifier, so that the electronic device obtains the first video associated with the first dynamic photo, and adopts the video processing method corresponding to the rotating camera movement mode to process the first video to obtain a third video, and then generates a second dynamic photo with a new camera movement effect based on the third video.

[0204] Step 402: The electronic device obtains a first video associated with the first dynamic photo in response to the second input, and processes the first video using a video processing method corresponding to the second camera movement mode to obtain a third video.

[0205] It should be noted that, for the description of the electronic device adopting the video processing method corresponding to the second camera movement mode to process the first video, please refer to the description of the electronic device adopting the video processing method corresponding to the first camera movement mode to process the first video in the above embodiment, which will not be repeated here.

[0206] Step 403: The electronic device generates a second dynamic photo based on the third video.

[0207] In some embodiments of the present application, the electronic device may generate the second dynamic photo based on the third video and the first image in the first dynamic photo.

[0208] Exemplarily, the electronic device may associate the first image with the third video and save them in an album to generate the second dynamic photo.

[0209] In some embodiments of the present application, the electronic device may replace the second video in the first dynamic photo with the third video to generate the second dynamic photo.

[0210] In this way, after the electronic device obtains a dynamic photo with a camera movement effect, if the user is not satisfied with the camera movement effect of the dynamic photo, the user can reselect a camera movement mode through input, and reprocess the first video using the video processing method corresponding to the reselected camera movement mode. Thus, a dynamic photo with a new camera movement effect can be obtained, thereby improving the flexibility of the electronic device in obtaining dynamic photos with camera movement effects.

[0211] In some embodiments of the present application, when displaying a first dynamic photo, when the electronic device receives input from the user to a second control in the display interface of the first dynamic photo, it can also display an identifier corresponding to the loop playback mode, and then the electronic device can receive input from the user to the identifier corresponding to the loop playback mode and adjust the playback mode of the first video to loop playback.

[0212] It can be understood that after the playback mode of the first video is adjusted to loop playback, when the user views the first dynamic photo, the electronic device can play the first video in a loop until the display interface of the first dynamic photo is exited.

[0213] In some embodiments of the present application, the camera movement mode corresponding to the second camera movement mode identifier is a focus mode; before "the electronic device obtains a third video" in the above step 402, the method for generating dynamic photos provided in the embodiment of the present application also includes the following steps 501 to 503.

[0214] Step 501: The electronic device displays a video screen of the first video after video processing.

[0215] Step 502: The electronic device receives a third input from a user regarding a third object in a video screen of the first video.

[0216] In some embodiments of the present application, the third object may be any one of the following: animals, plants, people, toys, buildings, electrical appliances, tables, etc. The embodiments of the present application do not limit this.

[0217] In some embodiments of the present application, the third input is used to select a focused photographic subject.

[0218] In some embodiments of the present application, the third input includes but is not limited to: a touch input performed by a user through a touch device such as a finger or a stylus, or a voice command input by a user, or a specific gesture input by a user, or a click input, or other feasible input. The specific input can be determined according to actual use requirements and is not limited in the embodiments of the present invention.

[0219] Step 503: The electronic device determines the third object as the photographing subject object in response to the third input.

[0220] In an embodiment of the present application, the third video is a video focused on a third object.

[0221] It can be understood that after the user inputs the third object, the electronic device will determine the third object as the main object of the shooting, and then when playing the third video, the third object in the video screen can present a gradual effect from blurry to clear.

[0222] In some embodiments of the present application, upon receiving user input for a blank position in a video screen of a first video, the electronic device determines a default object as a subject object.

[0223] In some embodiments of the present application, when the electronic device receives user input on a third object in a video screen of a first video, a preview of a gradual change from blurry to clear of the third object can be displayed to facilitate the user to preview the focus effect.

[0224] For example, as shown in FIG11(A), the electronic device displays a video screen 25 of the first video after the first video is processed by the video processing method corresponding to the second camera movement mode, wherein in the video screen 25, the default display is that the shooting subject object is out of focus; as shown in FIG11(B), the user can long press the object 26 in the video screen 25, so that the electronic device determines the object 26 as the shooting subject object, and displays a preview of the gradual change effect of the object 26 from blurry to clear; as shown in FIG11(C), the user can also long press the object 27 in the video screen 25, so that the electronic device determines the object 27 as the shooting subject object, and displays a preview of the gradual change effect of the object 27 from blurry to clear.

[0225] In this way, when the user selects the focus mode for the dynamic photo, the user can also select the focus object according to the user's preference, so that when the dynamic photo with the focus shooting effect is played subsequently, the object selected by the user in the video screen can present a gradual effect from blurry to clear, thereby improving the flexibility of the electronic device in obtaining dynamic photos with focus shooting effects.

[0226] In some embodiments of the present application, after the above step 204, the method for generating dynamic photos provided in the embodiments of the present application further includes the following steps 601 to 604.

[0227] Step 601: While displaying the first dynamic photo, receive a fourth input from the user.

[0228] In some embodiments of the present application, the fourth input is used to edit the first dynamic photo.

[0229] Step 602: In response to a fourth input, the electronic device displays a third video frame and performs a first process on the third video frame to obtain a processed third video frame.

[0230] In an embodiment of the present application, the third video frame is the first video frame and the last video frame of the first video associated with the first dynamic photo.

[0231] In an embodiment of the present application, the first processing includes at least one of the following: cropping the third video frame, rotating the third video frame.

[0232] In some embodiments of the present application, the fourth input includes a first sub-input, a second sub-input, and a third sub-input; the electronic device can receive the user's first sub-input for the first dynamic photo, enter an editing state, and display a first video frame of the first video, and then the electronic device can receive the user's second sub-input for the first video frame, perform a first process on the first video frame, obtain the processed first video frame, and display the last video frame contained in the first video, and then the electronic device can receive the user's third sub-input for the last video frame contained in the first video, perform a first process on the last video frame, and obtain the processed last video frame.

[0233] In some embodiments of the present application, the first sub-input may be any of the following: input to an editing control in a display interface of the first dynamic photo, input to the first dynamic photo (eg, two-finger relative sliding). The present application does not limit this.

[0234] In some embodiments of the present application, the second sub-input may be at least one of the following: a zoom input, a drag input, and a rotation input of the first video frame included in the first video.

[0235] In some embodiments of the present application, the third sub-input may be at least one of the following: a zoom input, a drag input, and a rotation input of the last video frame included in the first video.

[0236] For example, as shown in FIG12(A), when the user is viewing the first dynamic photo in the album, if the user is not satisfied with the cropped area of ​​the video in the first dynamic photo, the user can click the editing control in the display interface 21 of the first dynamic photo, that is, the first sub-input mentioned above, as shown in FIG12(B), so that the electronic device enters the editing state and displays the first video frame 31 of the first video. Then the user can zoom in, drag, etc. on the first video frame 31, that is, the second sub-input mentioned above, as shown in FIG12(C), so that the video picture desired as the starting position of the camera movement fills the entire screen, and then the user can click the "Confirm starting point" control in the display interface 21 , so that the electronic device obtains the video picture displayed on the screen, and uses the video picture as the video picture content of the first video frame after processing; and as shown in Figure 12 (D), the last video frame 32 contained in the first video is displayed, and then the user can zoom in, drag, and other inputs on the last video frame 32, that is, the above-mentioned third sub-input, as shown in Figure 12 (E), so that the video picture desired as the end position of the camera movement fills the entire screen, and then the user can click the "Confirm End" control in the display interface 21, so that the electronic device obtains the video picture displayed on the screen, and uses the video picture as the video picture content of the last video frame after processing.

[0237] Step 603: The electronic device processes the fourth video frame of the first video according to the processed third video frame.

[0238] In an embodiment of the present application, the fourth video frame is a video frame other than the third video frame among the at least two video frames included in the first video.

[0239] In some embodiments of the present application, the electronic device may adaptively process the fourth video frame based on the processed third video frame.

[0240] For example: assuming that the first video contains 18 video frames, when receiving the fourth input from the user to rotate the first video frame by 10° and the 18th video frame by 180°, the electronic device can adaptively rotate the i-th video frame by (i×10)°.

[0241] For example, Fig.13 As shown, when receiving the fourth input from the user and determining that the video picture of the first video frame after processing is the video picture in area 41 and the video picture of the last video frame after processing is the video picture in area 42, the electronic device can adaptively process other video frames, for example: cropping the second video frame so that the video picture of the second video frame is the video picture in area 43, the cropping area of ​​the second video frame is smaller than the cropping area of ​​the first video frame, and the cropping area of ​​the first video frame and the cropping area of ​​the second video frame both contain "little girl", ... cropping the ith video frame so that the video picture of the ith video frame is the video picture in area 44, the cropping area of ​​the ith video frame is larger than the cropping area of ​​the last video frame, and the cropping area of ​​the ith video frame and the cropping area of ​​the last video frame both contain "little girl". Thus, the electronic device obtains the effect that the camera of the electronic device gradually approaches the subject object to shoot.

[0242] Step 604: The electronic device obtains a fourth video according to the processed third video frame and the processed fourth video frame, and generates a third dynamic photo according to the fourth video.

[0243] In some embodiments of the present application, the camera movement effect of the third dynamic photo is the same as that of the first dynamic photo, and the video screen of the third dynamic photo is different from that of the first dynamic photo.

[0244] In some embodiments of the present application, the electronic device may synthesize the processed third video frame and the processed fourth video frame to generate a fourth video.

[0245] It should be noted that, for the description of the electronic device generating the third dynamic photo tone according to the fourth video, please refer to the description of the electronic device generating the first dynamic photo according to the second video in the above step 204, which will not be repeated here.

[0246] In this way, after the electronic device obtains a dynamic photo with a rotation shooting effect or a translation shooting effect, if the user is not satisfied with the dynamic photo, the dynamic photo can be readjusted according to the user's needs, thereby improving the flexibility of the electronic device in obtaining dynamic photos with a movement shooting effect.

[0247] It should be noted that the above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0248] It should be noted that the dynamic photo generation method provided in the embodiment of the present application can be executed by a dynamic photo generation device. In the embodiment of the present application, the dynamic photo generation method performed by the dynamic photo generation device is taken as an example to illustrate the dynamic photo generation device provided in the embodiment of the present application.

[0249] Fig.14 A possible structural diagram of a device for generating dynamic photos involved in an embodiment of the present application is shown. Fig.14 As shown, the dynamic photo generation device 70 may include: a receiving module 71, an acquisition module 72, a processing module 73 and a generation module 74.

[0250] The receiving module 71 is used to receive a first input from a user.

[0251] The acquisition module 72 is used to respond to the first input received by the receiving module 71 and acquire a first video recorded within a preset time period before and after a first moment, where the first moment is the moment when the first input is received.

[0252] The processing module 73 is used to process the first video acquired by the acquisition module 72 using a video processing method corresponding to the first camera movement mode to obtain a second video.

[0253] The generating module 74 is used to generate a first dynamic photo according to the second video processed by the processing module 73.

[0254] The embodiment of the present application provides a device for generating dynamic photos. After acquiring a first video, the device for generating dynamic photos can first use a video processing method corresponding to a first camera movement mode to perform video processing on the first video, and then generate a first dynamic photo based on a second video obtained after the video processing. Therefore, a dynamic photo with a camera movement shooting effect can be directly obtained. There is no need to move or rotate the device for generating dynamic photos in the process of taking dynamic photos to add a camera movement shooting effect to the dynamic photos. This improves the convenience of the device for generating dynamic photos in obtaining dynamic photos with a camera movement shooting effect.

[0255] In a possible implementation, the dynamic photo generation device 70 provided in the embodiment of the present application further includes: a determination module, the determination module being configured to perform any of the following before receiving the first input from the user:

[0256] In a case where it is detected that the shooting preview interface includes a first object, determining a camera movement mode matching the first object as a first camera movement mode;

[0257] In the case of receiving a user input on a second object in the shooting preview interface, determining a camera movement mode matching the second object as a first camera movement mode;

[0258] In a case where a user input is received for a first camera movement mode identifier among at least one camera movement mode identifier displayed in the shooting preview interface, determining the camera movement mode corresponding to the first camera movement mode identifier as the first camera movement mode;

[0259] Determine a camera movement mode corresponding to the first distance change information as a first camera movement mode, wherein the first distance change information is distance change information between the electronic device and the photographed subject;

[0260] The camera movement mode corresponding to the first trajectory information is determined as the first camera movement mode, and the first trajectory information is used to indicate the movement trajectory of the electronic device.

[0261] In a possible implementation, the first camera movement mode is a translation camera movement mode; the first video includes at least two video frames; the processing module 73 is specifically used to determine the cropping area of ​​each video frame in the at least two video frames, and the content in the cropping area of ​​any video frame is at least partially the same as the content in the cropping area of ​​a video frame adjacent to any video frame; and each video frame is cropped according to the cropping area of ​​each video frame, and a second video is generated based on the at least two cropped video frames.

[0262] In a possible implementation, the first camera movement mode is a push mode or a pull mode; the first video includes at least two video frames; the processing module 73 is specifically used to determine the cropping area of ​​each video frame in the at least two video frames based on the position of the subject object in the video screen of the first video, and the cropping area of ​​each video frame includes the subject object; and each video frame is cropped according to the cropping area of ​​each video frame, and the size of the cropped video frame is adjusted to a first size to obtain a second video, the first size is the size of the video frames included in the first video, and the second video includes at least two video frames after the size is adjusted; wherein, when the first camera movement mode is the push mode, the cropping area of ​​any video frame is larger than the cropping area of ​​the next video frame of any video frame; when the first camera movement mode is the pull mode, the cropping area of ​​any video frame is smaller than the cropping area of ​​the next video frame of any video frame.

[0263] In a possible implementation, the first camera movement mode is a push-to-camera mode, and the at least two video frames include: N first video frames and N second video frames captured by different cameras of the electronic device, where N is an integer greater than 1; a processing module 73 is specifically used to determine a cropping area of ​​each first video frame, and the cropping area of ​​each first video frame includes a photographed subject object; the processing module 73 is specifically used to crop the first portion of video frames according to the cropping area of ​​the first portion of video frames in the N first video frames; and when it is detected that the picture clarity of the second portion of video frames in the N first video frames is less than a preset threshold, the third portion of video frames in the N second video frames are cropped according to the cropping area of ​​the second portion of video frames in the N first video frames, and the sizes of the cropped first portion of video frames and the cropped third portion of video frames are adjusted to the first size to obtain a second video; wherein the number of video frames of the second portion of video frames is the same as the number of video frames of the third portion of video frames, and the content of the cropping area of ​​the second portion of video frames is the same as the content of the cropping area of ​​the third portion of video frames; the second video includes the resized first portion of video frames and the third portion of video frames.

[0264] In a possible implementation, the first camera movement mode is a rotation camera movement mode; the first video includes at least two video frames; the processing module 73 is specifically used to determine the rotation angle of each of the at least two video frames based on the number of video frames contained in the first video, and the rotation angle of any video frame is smaller than the rotation angle of the next video frame of any video frame; and each video frame is rotated according to the determined rotation angle of each video frame, and a second video is generated based on the at least two rotated video frames.

[0265] In a possible implementation, the first camera movement mode is a focus mode; the first video includes at least two video frames, and the first video includes depth information, and the depth information is used to adjust the focus distance of each video frame; the processing module 73 is specifically used to adjust the focus distance of each video frame in the at least two video frames based on the depth information, and the focus distance of any video frame is greater than the focus distance of the next video frame of any video frame; and generate a second video based on the at least two video frames after adjusting the focus distance.

[0266] In a possible implementation, the receiving module 71 is further used to receive a second input from a user for a second camera movement mode identifier in at least one camera movement mode identifier, and the second camera movement mode identifier corresponds to a second camera movement mode, after the generating module 74 generates the first dynamic photo according to the second video, while displaying the first dynamic photo. The processing module 73 is used to obtain the first video associated with the first dynamic photo in response to the second input received by the receiving module 71, and perform video processing on the first video using a video processing method corresponding to the second camera movement mode to obtain a third video. The generating module 74 is used to generate a second dynamic photo according to the third video obtained by the processing module.

[0267] In a possible implementation, the camera movement mode corresponding to the second camera movement mode identifier is a focus mode; the dynamic photo generation device 70 provided in the embodiment of the present application further includes: a display module and a determination module; the display module is used to display the video screen of the first video after video processing before the processing module 73 processes the third video. The receiving module 71 is used to receive the third input of the user on the third object in the video screen of the first video; the determination module is used to determine the third object as the shooting subject object in response to the third input received by the receiving module 71; wherein the third video is a video focused on the third object.

[0268] In a possible implementation, the dynamic photo generation device 70 provided in the embodiment of the present application further includes: a display module; a receiving module 71, which is also used to receive a fourth input from the user when the first dynamic photo is displayed after the generation module 74 generates the first dynamic photo according to the second video. The display module is used to display a third video frame in response to the fourth input received by the receiving module 71. The processing module 73 is used to perform a first processing on the third video frame displayed by the display module, the third video frame being the first video frame and the last video frame of the first video associated with the first dynamic photo, and the first processing includes at least one of the following: cropping the third video frame, rotating the third video frame; and processing the fourth video frame of the first video according to the processed third video frame, the fourth video frame being a video frame other than the third video frame in at least two video frames included in the first video; and obtaining a fourth video according to the processed third video frame and the processed fourth video frame. The generation module 74 is also used to generate a third dynamic photo according to the fourth video obtained by the processing module 73.

[0269] The device for generating dynamic photos in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0270] The dynamic photo generation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0271] The dynamic photo generation device provided in the embodiment of the present application can implement each process implemented in the above method embodiment. To avoid repetition, it will not be repeated here.

[0272] Alternatively, if Fig.15 As shown, an embodiment of the present application also provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores programs or instructions that can be executed on the processor 901, and when the program or instructions are executed by the processor 901, the various steps of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0273] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0274] Fig.16 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0275] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0276] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.16 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0277] The user input unit 107 is used to receive a first input from a user.

[0278] The processor 110 is used to respond to the first input received by the user input unit 107, obtain a first video recorded within a preset time length before and after a first moment, and the first moment is the moment when the first input is received; and use the video processing method corresponding to the first camera movement mode to process the first video to obtain a second video; and generate a first dynamic photo based on the second video.

[0279] The embodiment of the present application provides an electronic device. After acquiring a first video, the electronic device can first use a video processing method corresponding to a first camera movement mode to perform video processing on the first video, and then generate a first dynamic photo according to a second video obtained after the video processing. Therefore, a dynamic photo with a camera movement shooting effect can be directly acquired. There is no need to move or rotate the electronic device in the process of taking a dynamic photo to add a camera movement shooting effect to the dynamic photo. This improves the convenience of the electronic device in acquiring dynamic photos with a camera movement shooting effect.

[0280] In some embodiments of the present application, the processor 110 is further configured to perform any of the following before receiving the first input from the user:

[0281] In a case where it is detected that the shooting preview interface includes a first object, determining a camera movement mode matching the first object as a first camera movement mode;

[0282] In the case of receiving a user input on a second object in the shooting preview interface, determining a camera movement mode matching the second object as a first camera movement mode;

[0283] In a case where a user input is received for a first camera movement mode identifier among at least one camera movement mode identifier displayed in the shooting preview interface, determining the camera movement mode corresponding to the first camera movement mode identifier as the first camera movement mode;

[0284] Determine a camera movement mode corresponding to the first distance change information as a first camera movement mode, wherein the first distance change information is distance change information between the electronic device and the photographed subject;

[0285] The camera movement mode corresponding to the first trajectory information is determined as the first camera movement mode, and the first trajectory information is used to indicate the movement trajectory of the electronic device.

[0286] In some embodiments of the present application, the first camera movement mode is a translation camera movement mode; the first video includes at least two video frames; the processor 110 is specifically used to determine a cropping area of ​​each of the at least two video frames, and the content in the cropping area of ​​any video frame is at least partially the same as the content in the cropping area of ​​a video frame adjacent to any video frame; and each video frame is cropped according to the cropping area of ​​each video frame, and a second video is generated based on the at least two cropped video frames.

[0287] In some embodiments of the present application, the first camera movement mode is a push mode or a pull mode; the first video includes at least two video frames; the processor 110 is specifically used to determine the cropping area of ​​each video frame in the at least two video frames based on the position of the subject object in the video screen of the first video, and the cropping area of ​​each video frame includes the subject object; and crop each video frame according to the cropping area of ​​each video frame, and adjust the size of the cropped video frame to the first size to obtain a second video, the first size is the size of the video frames included in the first video, and the second video includes at least two video frames after the size is adjusted; wherein, when the first camera movement mode is the push mode, the cropping area of ​​any video frame is larger than the cropping area of ​​the next video frame of any video frame; when the first camera movement mode is the pull mode, the cropping area of ​​any video frame is smaller than the cropping area of ​​the next video frame of any video frame.

[0288] In some embodiments of the present application, the first camera movement mode is a push-camera mode, and at least two video frames include: N first video frames and N second video frames captured by different cameras of the electronic device, where N is an integer greater than 1; the processor 110 is specifically used to determine a cropping area for each first video frame, and the cropping area of ​​each first video frame includes a subject object.

[0289] The processor 110 is specifically used to crop the first part of the video frames according to the cropping area of ​​the first part of the video frames in the N first video frames; and when it is detected that the picture clarity of the second part of the video frames in the N first video frames is less than a preset threshold, crop the third part of the video frames in the N second video frames according to the cropping area of ​​the second part of the video frames in the N first video frames, and adjust the size of the cropped first part of the video frames and the cropped third part of the video frames to the first size to obtain a second video; wherein the number of video frames of the second part of the video frames is the same as the number of video frames of the third part of the video frames, and the content in the cropping area of ​​the second part of the video frames is the same as the content in the cropping area of ​​the third part of the video frames; the second video includes the resized first part of the video frames and the third part of the video frames.

[0290] In some embodiments of the present application, the first camera movement mode is a rotation camera movement mode; the first video includes at least two video frames; the processor 110 is specifically used to determine the rotation angle of each of the at least two video frames based on the number of video frames included in the first video, and the rotation angle of any video frame is smaller than the rotation angle of the next video frame of any video frame; and each video frame is rotated according to the determined rotation angle of each video frame, and a second video is generated based on the at least two rotated video frames.

[0291] In some embodiments of the present application, the first camera movement mode is a focus mode; the first video includes at least two video frames, and the first video includes depth information, and the depth information is used to adjust the focus distance of each video frame; the processor 110 is specifically used to adjust the focus distance of each video frame in the at least two video frames based on the depth information, and the focus distance of any video frame is greater than the focus distance of the next video frame of any video frame; and generate a second video based on the at least two video frames after adjusting the focus distance.

[0292] In some embodiments of the present application, the user input unit 107 is also used to receive a second input from the user for a second camera movement mode identifier among at least one camera movement mode identifier after the processor 110 generates a first dynamic photo based on the second video, while displaying the first dynamic photo, and the second camera movement mode identifier corresponds to a second camera movement mode.

[0293] The processor 110 is also used to respond to the second input received by the user input unit 107, obtain the first video associated with the first dynamic photo, and use the video processing method corresponding to the second camera movement mode to process the first video to obtain a third video; and generate a second dynamic photo based on the third video.

[0294] In some embodiments of the present application, the camera movement mode corresponding to the second camera movement mode identifier is a focus mode; the display unit 106 is used to display the video screen of the first video after video processing before the processor 110 processes the third video.

[0295] The user input unit 107 is further configured to receive a third input from a user on a third object in the video screen of the first video.

[0296] The processor 110 is further configured to determine the third object as the subject object in response to the third input received by the user input unit 107; wherein the third video is a video focused on the third object.

[0297] In some embodiments of the present application, the user input unit 107 is further used to receive a fourth input from the user after the processor 110 generates the first dynamic photo based on the second video and when the first dynamic photo is displayed.

[0298] The display unit 106 is further configured to display the third video frame in response to a fourth input received by the user input unit 107 .

[0299] The processor 110 is also used to perform a first processing on the third video frame displayed by the display unit 106, where the third video frame is the first video frame and the last video frame of the first video associated with the first dynamic photo, and the first processing includes at least one of the following: cropping the third video frame, rotating the third video frame; and processing the fourth video frame of the first video based on the processed third video frame, where the fourth video frame is a video frame other than the third video frame among the at least two video frames included in the first video; and obtaining a fourth video based on the processed third video frame and the processed fourth video frame, and generating a third dynamic photo based on the fourth video.

[0300] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0301] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.

[0302] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0303] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0304] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0305] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0306] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0307] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0308] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0309] An embodiment of the present application provides a computer program / program product, which is stored in a storage medium. The program / program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0310] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0311] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0312] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for generating a dynamic photo, characterized in that: The method comprises: receiving a first input from a user; In response to the first input, obtaining a first video recorded within a preset time period before and after a first moment, where the first moment is a moment when the first input is received; Using a video processing method corresponding to the first camera movement mode, the first video is processed to obtain a second video; A first dynamic photo is generated based on the second video.

2. The method according to claim 1, characterized in that Before receiving the first input from the user, the method further includes any of the following: In a case where it is detected that the shooting preview interface includes a first object, determining a camera movement mode matching the first object as the first camera movement mode; When receiving a user input on a second object in the shooting preview interface, determining a camera movement mode matching the second object as the first camera movement mode; When receiving a user input of a first camera movement mode identifier among at least one camera movement mode identifier displayed in the shooting preview interface, determining the camera movement mode corresponding to the first camera movement mode identifier as the first camera movement mode; determining a camera movement mode corresponding to first distance change information as the first camera movement mode, wherein the first distance change information is distance change information between the electronic device and the photographing subject; A camera movement mode corresponding to first trajectory information is determined as the first camera movement mode, and the first trajectory information is used to indicate the movement trajectory of the electronic device.

3. The method according to claim 1, characterized in that The first camera movement mode is a panning camera movement mode; the first video includes at least two video frames; The step of using a video processing method corresponding to the first camera movement mode to process the first video to obtain a second video includes: Determine a cropping region of each of the at least two video frames, wherein content in the cropping region of any video frame is at least partially identical to content in the cropping region of a video frame adjacent to the any video frame; Each video frame is cropped according to the cropping area of ​​each video frame, and the second video is generated based on the at least two cropped video frames.

4. The method according to claim 1, characterized in that: The first camera movement mode is a push-cam mode or a pull-cam mode; the first video includes at least two video frames; The step of using a video processing method corresponding to the first camera movement mode to process the first video to obtain a second video includes: Determine, based on a position of a subject object in a video screen of the first video, a cropping region of each of the at least two video frames, wherein the subject object is included in the cropping region of each video frame; Cropping each video frame according to the cropping region of each video frame, and adjusting the size of the cropped video frame to a first size to obtain the second video, where the first size is the size of the video frames included in the first video, and the second video includes at least two video frames after the size is adjusted; Wherein, when the first camera movement mode is the push-camera mode, a cropping area of ​​any video frame is larger than a cropping area of ​​a next video frame of any video frame; When the first camera movement mode is the zoom mode, a cropping area of ​​any video frame is smaller than a cropping area of ​​a next video frame of the any video frame.

5. The method according to claim 4, characterized in that The first camera movement mode is the push-camera mode, and the at least two video frames include: N first video frames and N second video frames captured by different cameras of the electronic device, where N is an integer greater than 1; The determining of the cropping region of each of the at least two video frames comprises: Determine a cropping region of each first video frame, wherein the cropping region of each first video frame includes the subject object; The step of cropping each video frame according to the cropping region of each video frame and adjusting the size of the cropped video frame to the first size to obtain the second video includes: Cropping the first part of video frames according to the cropping area of ​​the first part of video frames in the N first video frames; When it is detected that the picture definition of the second part of the video frames in the N first video frames is less than a preset threshold, cropping the third part of the video frames in the N second video frames according to the cropping area of ​​the second part of the video frames, and adjusting the sizes of the cropped first part of the video frames and the cropped third part of the video frames to the first size, so as to obtain the second video; Among them, the number of video frames in the second part of the video frames is the same as the number of video frames in the third part of the video frames, and the content in the cropped area of ​​the second part of the video frames is the same as the content in the cropped area of ​​the third part of the video frames; the second video includes the resized first part of the video frames and the third part of the video frames.

6. The method according to claim 1, characterized in that The first camera movement mode is a rotating camera movement mode; the first video includes at least two video frames; The step of using a video processing method corresponding to the first camera movement mode to process the first video to obtain a second video includes: Determine a rotation angle of each of the at least two video frames based on the number of video frames included in the first video, wherein the rotation angle of any video frame is smaller than the rotation angle of a next video frame of any video frame; Each video frame is rotated according to the determined rotation angle of each video frame, and the second video is generated based on the at least two rotated video frames.

7. The method according to claim 1, characterized in that The first camera movement mode is a focus mode; the first video includes at least two video frames, the first video includes depth information, and the depth information is used to adjust the focus distance of each video frame; The step of using a video processing method corresponding to the first camera movement mode to process the first video to obtain a second video includes: Based on the depth information, adjusting the focus distance of each of the at least two video frames, wherein the focus distance of any one of the video frames is greater than the focus distance of a next video frame of the any one of the video frames; The second video is generated based on the at least two video frames after the focus distance is adjusted.

8. The method according to claim 1, characterized in that After generating the first dynamic photo according to the second video, the method further includes: In the case of displaying the first dynamic photo, receiving a second input of a second camera movement mode identifier among at least one camera movement mode identifier from a user, wherein the second camera movement mode identifier corresponds to a second camera movement mode; In response to the second input, the first video associated with the first dynamic photo is acquired, and the first video is processed using a video processing method corresponding to the second camera movement mode to obtain a third video; A second dynamic photo is generated based on the third video.

9. The method according to claim 8, characterized in that The camera movement mode corresponding to the second camera movement mode identifier is a focus mode; before obtaining the third video, the method further includes: Displaying a video screen of the first video after video processing; receiving a third input from a user regarding a third object in a video screen of the first video; In response to the third input, determining the third object as a subject object; The third video is a video focused on the third object.

10. The method according to claim 1, characterized in that After generating the first dynamic photo according to the second video, the method further includes: In the case of displaying the first dynamic photo, receiving a fourth input from the user; In response to the fourth input, display a third video frame, and perform a first process on the third video frame, the third video frame being a first video frame and a last video frame of the first video associated with the first dynamic photo, the first process comprising at least one of the following: cropping the third video frame, rotating the third video frame; Processing a fourth video frame of the first video according to the processed third video frame, where the fourth video frame is a video frame other than the third video frame among the at least two video frames included in the first video; A fourth video is obtained based on the processed third video frame and the processed fourth video frame, and a third dynamic photo is generated based on the fourth video.

11. A device for generating dynamic photos, characterized in that: The device comprises: a receiving module, an acquiring module, a processing module and a generating module; The receiving module is used to receive a first input from a user; The acquisition module is configured to acquire, in response to the first input received by the receiving module, a first video recorded within a preset time period before and after a first moment, where the first moment is a moment when the first input is received; The processing module is used to process the first video acquired by the acquisition module using a video processing method corresponding to the first camera movement mode to obtain a second video; The generating module is used to generate a first dynamic photo according to the second video obtained by processing by the processing module.

12. An electronic device, characterized in that: It includes a processor and a memory, the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for generating a dynamic photo as described in any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Dynamic photo generation method and device and readable storage medium

    CN113077532A

  • Video processing method and related device

    CN114979785A

  • Video recording method and device, electronic equipment and storage medium

    CN116156076A

  • Video processing method, device and equipment, computer readable storage medium and product

    CN116782019A