Method for video editing and related apparatus
By automatically adding keyframes with consistent parameters during the video trimming process, the problem of not being able to generate keyframe animations after video trimming is solved, reducing user editing operations and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2023-07-12
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technology cannot generate keyframe animations after deleting keyframes when capturing video, forcing users to re-add keyframes and edit, which increases their workload.
During the video capture process, new keyframes are automatically added at the locations of deleted keyframe frames, and their parameters are set to match those of the deleted keyframe frames, thus preserving the keyframe animation effects in the captured video.
It reduces the number of steps users need to take in video editing, ensuring that the extracted video retains the keyframe animation effects of the original video, thus improving the user experience.
Smart Images

Figure CN119316661B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video editing technology, and in particular to video editing methods and related apparatus. Background Technology
[0002] When a video contains two or more keyframes, electronic devices can generate a series of animation effects on the footage between the two keyframes. Electronic devices can also trim the video. How to add keyframes to the trimmed video is a problem that urgently needs to be solved in this field. Summary of the Invention
[0003] In a first aspect, this application provides a video editing method and related apparatus. The method includes: displaying a first user interface, the first user interface including: a preview area, a first track, and a pointer with a fixed position; the first track displays multiple frames of a first video; the preview area displays the first frame of the first track pointed to by the pointer; keyframe markers are displayed at a first position and a second position of the first track; the first position is before the second position; the effect of the frame at the first position of the first track is a first effect; and the effect of the frame at the second position of the first track is a second effect. Upon receiving a video trimming operation applied to the first track, the first track is adjusted to a second track, the second track including a start position to a third position of the first track; the third position is located between the first position and the second position; and keyframe markers are displayed at both the first position and the third position of the second track. Upon receiving a playback command, a second video is played in the preview area starting from the first screen. The second video includes multiple screens from the start screen to the third screen of the first video. The start screen is the screen at the start position of the first track, and the third screen is the screen at the third position of the first track. In the second video, multiple screens before the second screen are presented as the first effect, and multiple screens from the second screen to the third screen gradually transition from the first effect to the second effect. The second screen is the screen at the first position of the second track.
[0004] By implementing the above method, electronic devices can trim videos with added keyframe animations. Furthermore, even if the trimmed portion includes keyframe frames, the device can add a new keyframe at the trimmed location in the resulting video, ensuring that the effect of the newly added keyframe is consistent with the effect of the deleted keyframe. This preserves the user's editing capabilities and reduces their workload.
[0005] In conjunction with the first aspect, in some embodiments, the first track also includes a right handle on the right edge, and the video capture operation includes a left swipe operation on the right handle.
[0006] Secondly, this application provides a video editing method, which includes: displaying a first user interface, the first user interface including: a preview area, a first track, and a pointer with a fixed position, the first track displaying multiple frames of a first video, the preview area displaying the first frame of the first track pointed to by the pointer, keyframe markers displayed at a first position and a second position of the first track, the first position preceding the second position, the effect of the frame at the first position of the first track being a first effect, and the effect of the frame at the second position of the first track being a second effect. Upon receiving a video trimming operation applied to the first track, the first track is adjusted to a second track, the second track including a third position to the end position of the first track, the third position being located between the first position and the second position, and keyframe markers displayed at both the second and third positions of the second track. Upon receiving a playback command, a second video is played in the preview area starting from the first screen. The second video includes multiple screens from the third screen to the end screen of the first video. The third screen is the screen at the third position of the first track, and the end screen is the screen at the end position of the first track. In the second video, the multiple screens from the third screen to the second screen gradually transition from the first effect to the second effect. The multiple screens after the second screen are presented with the second effect. The second screen is the screen at the second position of the second track.
[0007] By implementing the above method, electronic devices can trim videos with added keyframe animations. Furthermore, even if the trimmed portion includes keyframe frames, the device can add a new keyframe at the trimmed location in the resulting video, ensuring that the effect of the newly added keyframe is consistent with the effect of the deleted keyframe. This preserves the user's editing capabilities and reduces their workload.
[0008] In conjunction with the second aspect, in some embodiments, the first track also includes a left handle on the left edge, and the video capture operation includes a right-slide operation on the left handle.
[0009] In conjunction with the first and second aspects, in some embodiments, the first effect includes displaying at a first display position, the editing operation being used to adjust the image from the first display position to a second display position, and the second effect includes displaying at the second display position. And / or the first effect includes displaying at a first size, the editing operation being used to adjust the image from the first size to a second size, and the second effect includes displaying at the second size. And / or the first effect includes displaying at a first display angle, the editing operation being used to adjust the image from the first display angle to a second display angle, and the second effect includes displaying at the second display angle. And / or the first effect includes displaying at a first opacity, the editing operation being used to adjust the image from the first opacity to a second opacity, and the second effect includes displaying at the second opacity.
[0010] In conjunction with the first and second aspects, in some embodiments, before displaying the first user interface, the method includes: displaying a second user interface, the second user interface including: a preview area, the first track, and a pointer with a fixed position, the preview area displaying an image of the first position of the first track pointed to by the pointer. Receiving an operation to select the first track. Receiving an operation to add a keyframe, displaying a keyframe identifier at the first position. Receiving a left swipe operation on the first track, moving the first track to the left, and displaying an image of the second position of the first track pointed to by the pointer in the preview area. Receiving an editing operation applied to the image of the second position in the preview area, adjusting the effect of the image of the second position to the second effect, and displaying a keyframe identifier at the second position. Receiving a right swipe operation on the first track, moving the first track to the right. Thus, after the first video is cropped, two keyframes can be added using the above method.
[0011] In conjunction with the first and second aspects, in some embodiments, after receiving the operation to add a keyframe, the method further includes: acquiring parameters of the image at the first position, the parameters of the image at the first position being used to indicate the first effect. After receiving the editing operation applied to the image at the second position in the preview area, the method further includes: acquiring parameters of the image at the second position, the parameters of the image at the second position being used to indicate the second effect.
[0012] In conjunction with the first and second aspects, in some embodiments, after receiving the operation of selecting the first track, the method further includes: displaying a first control in the second user interface, the operation of adding a keyframe including an operation performed on the first control.
[0013] In conjunction with the first and second aspects, in some embodiments, after playing the second video from the first screen in the preview area, the method further includes: receiving a user action to export the video; and storing the second video.
[0014] In conjunction with the first and second aspects, in some embodiments, the first track displays all or part of the first video.
[0015] In conjunction with the first and second aspects, in some embodiments, after playing the second video from the first frame in the preview area, the method further includes: receiving a pause playback operation; receiving an operation to add a third track, the third track displaying multiple frames of the first material, the preview area displaying a fourth frame of the second track pointed to by the pointer and a fifth frame of the third track pointed to by the pointer, both the fourth and fifth positions of the third track displaying keyframe markers, the fourth position preceding the fifth position, the effect of the frame at the fourth position of the third track being a third effect, and the effect of the frame at the fifth position of the third track being a fourth effect; receiving a video trimming operation applied to the third track, adjusting the third track to a fourth track, the fourth track including the start position to the sixth position of the third track, the sixth position being located between the fourth and fifth positions, both the fourth and sixth positions of the third track displaying keyframe markers. Upon receiving a playback command, the second video is played starting from the fourth screen in the preview area, and the second material is played starting from the fifth screen. The second material includes multiple screens between the sixth and seventh screens of the first material. The sixth screen is the screen at the beginning position of the third track, and the seventh screen is the screen at the sixth position of the third track. In the second material, the multiple screens from the sixth to the seventh screen gradually transition from the third effect to the fourth effect, and the multiple screens after the seventh screen are presented with the fourth effect.
[0016] Thirdly, this application provides an electronic device including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, which includes computer instructions. When the one or more processors execute the computer instructions, the electronic device causes the electronic device to perform the method described in the first aspect or any embodiment of the first aspect, or the second aspect or any embodiment of the second aspect.
[0017] Fourthly, embodiments of this application provide a chip including one or more processors. When the one or more processors execute computer instructions, they cause an electronic device to perform the method described in the first aspect, the second aspect, or any embodiment of the second aspect.
[0018] Fifthly, embodiments of this application provide a computer storage medium including computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect, the second aspect, or any embodiment of the second aspect. Attached Figure Description
[0019] Figure 1A-Figure 1B This application provides a user interface for capturing video using an electronic device.
[0020] Figures 2A-2D A user interface for playing the captured video on an electronic device provided in this application embodiment;
[0021] Figures 3A-3E This application provides a user interface for capturing video using an electronic device.
[0022] Figures 4A-4D A user interface for playing the captured video on an electronic device provided in this application embodiment;
[0023] Figure 5 A flowchart illustrating a video editing method provided in an embodiment of this application;
[0024] Figure 6 This application provides an OS interaction diagram corresponding to a video editing method provided in an embodiment of the present application.
[0025] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0026] Figure 8 A software structure block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0027] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0028] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0029] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with a user. It realizes the conversion between the internal form of information and the form that the user can accept. The user interface is source code written in a specific computer language such as Java or Extensible Markup Language (XML). The interface source code is parsed and rendered on the electronic device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the screen of an electronic device.
[0030] First, let's introduce two related terms used in the embodiments of this application:
[0031] Keyframe: This is a computer animation term referring to a specific frame in a character's or object's movement where a crucial action occurs. A frame is the smallest unit of visual impact in animation, equivalent to a single shot on film. In this embodiment, a keyframe can be represented by a marker added to a specific location on the media track in the user interface of a video editing application on an electronic device. Essentially, the frame containing that marker can be considered a keyframe. Adding a keyframe means marking a particular frame as a keyframe.
[0032] Tracks: These are used to place footage and for editing it. The length of a track represents the duration of the footage, and each position within the track represents a frame of the footage. Different tracks can be created by placing different footage. For example, a main video track can display multiple frames of the main video, while a text track can display text, and so on.
[0033] Electronic devices can edit videos. For example, they can add two keyframes to a video and edit the keyframes, including moving, resizing, rotating, and changing their opacity. Multiple frames between the two keyframes can also be edited to create keyframe animations. Electronic devices can also trim videos containing keyframes to remove unwanted portions.
[0034] The following section describes the process of capturing and playing the captured video, using the user interface provided by the electronic device.
[0035] Figure 1A-Figure 1B An example is shown of a user interface for capturing video on an electronic device.
[0036] like Figure 1A As shown, user interface 20 is a user interface provided by a video editing application in an electronic device. User interface 20 may include, but is not limited to: a video preview interface 201, a video track 202, a pointer 203, keyframes 204 and 205, playback controls 206, a left handle 207, and a right handle 208. The video track 202 has a length of S1 seconds, keyframe 204 is located at frame A of video track 202, and keyframe 205 is located at frame B of video track 202. The user interface may also include: an effects options bar, a track options bar, keyframe addition controls, etc. The electronic device can edit the video displayed in the video preview interface 201 using user interface 20. The effects options bar may include, but is not limited to: split, trim, volume conditions, speed adjustment, deletion, cropping, single-frame export, filters, adjustment parameters (such as color correction, brightness, contrast, etc.), opacity, picture-in-picture switching, replacement, etc. The track options bar may include, but is not limited to: templates, clipping, filters, music, text, stickers, effects, picture-in-picture, aspect ratio, background, etc.
[0037] The video track 202 includes keyframes 204 and 205. This means the electronic device has completed the video editing operation by adding keyframes to the video track 202. In this embodiment, the editing operation includes rotating the frame of keyframe 205 of the video track 202 90 degrees counterclockwise. This ensures that the frames on the video track 202 between keyframes 204 and 205 rotate sequentially according to the playback order; this rotation of multiple frames can be referred to as keyframe animation.
[0038] The electronic device can respond to a long press and a press on the right handle 208. Figure 1A The sliding operation in the direction indicated by the middle arrow will trim video track 202 and display it as shown. Figure 1BThe user interface 21 is shown. In this embodiment, the above-described long-press and slide operation for the right handle is only an example, and other operations may also be included to capture video, which are not limited thereto.
[0039] For example, the above sliding operation can end when sliding to the right handle 213. The duration of video track 211 in user interface 21 is S2 seconds, which means that the electronic device deleted the footage from second S2 to second S1 in the video track based on the above-mentioned cropping operation on user interface 20, and generated video track 211. Figure 1B As shown, video track 211 includes keyframe 212. Keyframe 212 is located at frame A of video track 211.
[0040] Figures 2A-2D An example is shown of a user interface for an electronic device to play a captured video.
[0041] like Figure 2A As shown, pointer 301 in user interface 30 points to frame A in video track 302. The electronic device can respond to a click on the playback control 303 to play the captured video in video preview area 304. At this time, frame A is displayed in video preview area 303. Frame A displayed in video preview area 304 is not rotated.
[0042] When the rotated video reaches frame C, the electronic device can display as follows: Figure 2B The user interface 31 is shown. Pointer 311 in user interface 31 points to frame C in video track 312, and frame C is displayed in video preview area 313. Frame C displayed in video preview area 313 is not rotated.
[0043] When the rotated video reaches frame D, the electronic device can display as follows: Figure 2C The user interface 32 is shown. In user interface 32, pointer 321 points to frame D in video track 322, and frame D is displayed in video preview area 323. Frame D displayed in video preview area 323 is not rotated.
[0044] When the rotated video plays to frame B (i.e., frame S2), the electronic device can display as follows: Figure 2D The user interface 33 is shown. In user interface 33, pointer 331 points to frame B in video track 332, and frame B is displayed in video preview area 333. Frame B displayed in video preview area 333 has not been rotated.
[0045] As can be seen from the above process of playing the extracted video, since the extracted video track only contains one keyframe, and one keyframe cannot generate keyframe animation in video track 211, the extracted video track does not retain the editing operations for the original video.
[0046] In some implementations, if an electronic device performs a cropping operation on a video containing two keyframes, deleting one of the keyframes, the cropped video will only contain one keyframe. Since a video with only one keyframe cannot generate keyframe animation, the electronic device will display the original video (without keyframe animation) during playback. If the user needs the cropped video to have the same edited effect as the original video, they will need to add and edit the keyframes again to generate keyframe animation. In other words, cropping video can disable video editing. This increases the burden on users editing videos and results in a poor user experience.
[0047] To address the aforementioned problems, this application provides a video editing method. In this method, an electronic device can perform cropping processing on a first video. If the deleted portion of the video includes keyframe frames, the electronic device can add a keyframe at the time corresponding to the cropping position in the cropped video, and set the parameters of the newly added keyframe to the parameters of the cropped keyframe. These parameters may include, but are not limited to, the frame's position, size, rotation angle, opacity, etc. This preserves the keyframe animation of the original video, allowing the cropped video to include keyframe animation without user intervention, thus reducing user steps.
[0048] The following section details the expression format of parameters used to describe the image. Electronic devices can store various parameters as float (floating-point) types.
[0049] For example, the position parameter can be represented by coordinates relative to the default screen position, moving along the x and y axes. A negative x-axis or y-axis movement is indicated by a "-", and a positive x-axis or y-axis movement by a "+". The unit of the coordinates is pixels (px). The size parameter can be represented by the scale relative to the default screen size. The rotation angle parameter can be represented by the degree of rotation relative to the default screen, either clockwise or counter-clockwise. A counter-clockwise rotation is indicated by a "-", and a clockwise rotation by a "+". The unit of the degree is degrees (°). The opacity parameter can be represented by a value indicating an increase or decrease in opacity relative to the default screen opacity. The value used to represent the opacity parameter ranges from 0 to 100.
[0050] In the embodiments of this application, the parameters used to describe the image are not limited to the above-mentioned types, and may include more types of parameters, without limitation.
[0051] For example, when the screen displayed by the electronic device is the default, that is, when the electronic device does not edit the screen, the display position of the screen can be represented as (0px, 0px), the size of the screen can be represented as 1, the rotation degree of the screen can be represented as 0°, and the opacity of the screen can be represented as 100.
[0052] In some implementations, image parameters can be used to describe the image's effect.
[0053] The following describes the process of capturing and playing the captured video provided in the embodiments of this application, using the user interface provided by the electronic device.
[0054] Figures 3A-3E The user interface for capturing video on an electronic device is illustrated in two examples.
[0055] Scenario 1: Extracting the latter part of the video.
[0056] like Figure 3A As shown, user interface 40 is a user interface provided by a video editing application in an electronic device. Similarly, user interface 40 may include, but is not limited to: a video preview interface 401, a video track 402, a pointer 403, keyframes 404 and 405, playback controls 406, a left handle 407, and a right handle 408. The video track 402 has a length of S1 seconds, keyframe 404 is located at frame A of video track 402, and keyframe 405 is located at frame B of video track 402.
[0057] Since video track 402 includes two keyframes, the electronic device has already completed the video editing operation by adding keyframes to video track 402. In this embodiment, the editing operation includes rotating the frame of keyframe 405 of video track 402 90 degrees counterclockwise. This allows the frames of video track 402 between keyframes 404 and 405 to rotate sequentially in playback order; the rotation of these multiple frames can be referred to as keyframe animation.
[0058] The electronic device can respond to a long press and a press of the right handle 408. Figure 3A The sliding operation in the direction indicated by the middle arrow will crop video track 402 and display it as shown. Figure 3B The user interface 41 is shown. In this embodiment of the application, the above-described long press and slide operation for the right handle is only an example, and other operations may also be included to capture video, which are not limited thereto.
[0059] For example, the above sliding operation can end when the slider reaches the position shown by the right handle 414. The duration of video track 411 in user interface 41 is S2 seconds, which means that the electronic device deleted the footage from second S2 to second S1 in the video track based on the above-mentioned cropping operation on user interface 40, and generated video track 411. Figure 3B As shown, video track 411 includes keyframe 412 and keyframe 413. Keyframe 412 is located at frame A of video track 411, and keyframe 413 is located at frame S2 of video track 411. Furthermore, the parameters of keyframe 412 are consistent with the parameters of keyframe 404, and the parameters of keyframe 413 are consistent with the parameters of the clipped keyframe 405.
[0060] Scenario 2: Extract the first part of the video.
[0061] like Figure 3C As shown, the user interface 42 is the user interface provided by a video editing application in a 42-bit electronic device. Similarly, the user interface 42 may include, but is not limited to: a video preview interface 421, a video track 422, a pointer 423, keyframes 424 and 425, playback controls 426, a left handle 427, and a right handle 428. The video track 422 has a length of S1 seconds, keyframe 424 is located at frame A of the video track 422, and keyframe 425 is located at frame B of the video track.
[0062] The electronic device can respond to the action on the left handle 427 and press Figure 3CThe sliding operation in the direction indicated by the middle arrow is used to crop video track 422. In this embodiment, the above-described long-press and slide operation for the left handle is only illustrative and may include other operations to crop video, which are not limited thereto.
[0063] For example, the sliding operation described above can end when the slider reaches the position shown on the left handle 431. Before the sliding operation ends when the slider reaches the position shown on the left handle 431, the electronic device displays as shown on the left handle 431. Figure 3D The user interface 43 is shown. When the swipe operation ends, the electronic device jumps to display as shown... Figure 3E The user interface shown is 44.
[0064] The duration of video track 441 in user interface 44 is S3 seconds. This indicates that the electronic device deleted the footage from second 0 to second S3 in the video track based on the aforementioned cropping operation performed on user interface 42, and generated video track 441. Figure 3E As shown, video track 441 includes keyframe 442 and keyframe 443. Keyframe 442 is located at frame 0 of video track 441, and keyframe 443 is located at frame B-(S1-S3) of video track 441. Furthermore, the parameters of keyframe 442 are consistent with the parameters of the aforementioned cropped keyframe 424, and the parameters of keyframe 443 are consistent with the parameters of the aforementioned keyframe 425.
[0065] This is because the cropped portion is the first half of the video, but subsequent playback of the cropped video generally does not play the deleted portion. Therefore, the electronic device needs to automatically align the cropped video. That is, at the end of the swipe operation, the electronic device switches from displaying user interface 43 to displaying user interface 44.
[0066] Figures 4A-4D An example is shown of a user interface for an electronic device to play a captured video.
[0067] For example, the following describes the process of extracting and playing a video segment for the first scenario described above.
[0068] like Figure 4A As shown, pointer 501 in user interface 50 points to frame A in video track 502. The electronic device can respond to a click on playback control 503 and play the captured video in video preview area 504. At this time, frame A is displayed in video preview area 503. Frame A displayed in video preview area 504 is rotated 0 degrees counterclockwise relative to frame A in the unrotated video.
[0069] When the captured video reaches frame C, the electronic device can display something like this. Figure 4B The user interface 51 is shown. Pointer 511 in user interface 51 points to frame C in video track 512, and this frame C is displayed in video preview area 513. The frame C displayed in video preview area 513 is rotated counterclockwise by 'a' degrees relative to the unrotated frame C in the video. Where 'a' is greater than 0.
[0070] When the captured video reaches frame D, the electronic device can display something like this. Figure 4C The user interface 52 is shown. In user interface 52, pointer 521 points to frame D in video track 522, and frame D is displayed in video preview area 523. Frame D displayed in video preview area 523 is rotated counterclockwise by b degrees relative to frame D in the unrotated video. Where b is greater than a.
[0071] When the captured video is played to frame B (i.e., frame S2), the electronic device can display as follows: Figure 4D The user interface 53 is shown. In user interface 53, pointer 531 points to frame B in video track 532, and this frame B is displayed in video preview area 533. The frame B displayed in video preview area 533 is rotated counterclockwise by c degrees relative to the frame B in the unrotated video. Where c is greater than b.
[0072] As can be seen from the above process of playing the extracted video, because the extracted video track contains two keyframes, and the parameters of these two keyframes are consistent with the parameters of the two keyframes in the original video track, the extracted video track can retain the editing operations performed on the original video.
[0073] Based on the user interface for capturing and playing the captured video described above, the following is a schematic diagram of the process for adding keyframes provided in the embodiments of this application.
[0074] Figure 5 An exemplary implementation of a video editing method flow is provided. Among them, Figure 5 The method shown is based on a single track, which contains two keyframes, as an example.
[0075] like Figure 5 As shown, the method includes:
[0076] S501. Display a first user interface. The first user interface includes a first track, which displays multiple frames of a first video. The first track includes two keyframes, wherein the first keyframe is located before the second keyframe.
[0077] The aforementioned first user interface can refer to a user interface in an electronic device used for capturing video. For example, the first user interface can be a user interface provided by a video editing application in the electronic device. In the embodiments of this application, the application to which the first user interface belongs can be a system application or a third-party application, without limitation. Furthermore, the name of the application to which the first user interface belongs is not limited. The aforementioned first track and the aforementioned first video can be a video stored in the electronic device or a video captured by the electronic device.
[0078] In some implementations, the electronic device can respond to user actions and display a first user interface. These user actions can include clicks, swipes, voice commands, gestures, and so on. For example, the electronic device can respond to a click on an editing control for a first video in a gallery application to access the first user interface.
[0079] In some implementations, the electronic device can play a first video in a first user interface, or edit the first video in the first user interface. Playing the first video can refer to continuously displaying each frame of the first video; editing the first video can refer to editing one or more frames of the first video. For example, the electronic device can play the first video in a video preview area of the first user interface, or edit a single frame of the first video displayed in the video preview area.
[0080] In some implementations, the first video included in the electronic device can refer to a video that has undergone editing. For example, the electronic device can first add a keyframe at a certain moment in the first video before editing, and then edit the footage at another moment in the first video before editing, which is equivalent to adding another keyframe. Thus, the first video includes two keyframes, with the first keyframe preceding the second keyframe.
[0081] In some implementations, the identifier of the first keyframe is located at the first position of the first track, and the identifier of the second keyframe is located at the second position of the first track.
[0082] In some implementations, after adding keyframes, the electronic device can not only display a marker for the first keyframe at a specific point in the video track, but also store the timestamp information of that first keyframe. For example, if the first keyframe is located at 2.5 seconds into the first video, its timestamp might be 2500 ms. This video track is used to display multiple frames of the first video on the user interface.
[0083] For example, the first user interface may refer to Figure 3A The user interface 40 shown. The first track may refer to... Figure 3A The video track 402, the first keyframe may refer to keyframe 404, and the second keyframe may refer to keyframe 405. In the embodiments of this application, the content included in the above-described first user interface is only illustrative and may include more or less content.
[0084] S502, An operation to crop the first video was detected.
[0085] The aforementioned cropping can refer to an electronic device cropping or deleting a portion of the first video while retaining another portion. In some implementations, the electronic device can crop the first part of the first video while retaining the second part; conversely, the electronic device can also crop the second part of the first video while retaining the first part.
[0086] For example, the above operation could refer to the aforementioned long press of the right handle 408 and pressing... Figure 3A The sliding operation is indicated by the middle arrow. This operation can also refer to the long press of the left handle 427 and pressing... Figure 3C The sliding operation is indicated by the middle arrow.
[0087] In some implementations, after the electronic device detects an operation that trims the first video, the first track in the first user interface is adjusted to a second track. For example, the aforementioned second track could refer to... Figure 3B Video track 411 in the video. The second track mentioned above can also refer to... Figure 3E Video track 441.
[0088] S503. Determine whether the keyframes of the first video have been captured.
[0089] In some implementations, after detecting a cropping operation on the first video, the electronic device needs to determine whether the cropped portion contains keyframes. Specifically, the electronic device can determine whether the cropped portion contains keyframes based on the data from the cropping operation. For example, the electronic device can determine the specific location of the cropped portion in the first video based on the location data of the cropping operation. The determination result can include the following:
[0090] Scenario 1: The captured portion does not contain keyframe images.
[0091] In one possible implementation, the electronic device may crop out either the first portion or the second portion of the first video. Neither the cropped portion nor the second portion of the first video includes keyframes. If the electronic device determines the outcome as Case 1, S504-1 is executed.
[0092] Scenario 2: The captured portion includes a keyframe.
[0093] In one possible implementation, the electronic device may cut off the first part of the video or the second part of the video.
[0094] If the electronic device cuts out the first portion of the first video, and the cut-out portion includes a keyframe, then S504-2 is executed. For example, the above situation can be referred to the one described above based on... Figures 3A-3B The process of interception described herein.
[0095] If the electronic device truncates the latter part of the first video, and the truncated part includes a keyframe, then S504-3 is executed. For example, the above situation can be referred to the one described above based on... Figures 3C-3D The process of interception described herein.
[0096] Scenario 3: The captured portion includes two keyframe frames.
[0097] When the portion captured by the electronic device includes two keyframes, meaning that the first video after capture does not contain any keyframes, a second video is generated that does not contain any keyframes.
[0098] S504-1, Generate a second video including the first keyframe and the second keyframe.
[0099] In some implementations, after the electronic device determines that the captured portion does not include keyframes, it can generate a second video based on the captured first video. The second video retains both the first and second keyframes. However, since the duration of the second video differs from that of the first video, and the timestamps of the first and second keyframes may also differ between the two videos, the electronic device may need to update the timestamps of the first and second keyframes in the second video.
[0100] For example, suppose the length of the first video is S1 seconds, the first keyframe is located at second A in the first video, the second keyframe is located at second B in the first video, and the length of the second video is S2.
[0101] When the electronic device cuts out the first part of the first video, and the first part does not include keyframe images, the first keyframe is located at A-(S1-S2) seconds in the second video, and the second keyframe is located at B-(S1-S2) seconds in the second video.
[0102] When the electronic device cuts out the latter part of the first video, and the former part does not include keyframe images, the first keyframe is located at second A in the second video, and the second keyframe is located at second B in the second video.
[0103] It's worth noting that the parameters of the first keyframe in the first video are identical to those of the first keyframe in the second video, and the parameters of the second keyframe in the first video are identical to those of the second keyframe in the second video. In other words, the effect of the first keyframe in the first video is the same as the effect of the first keyframe in the second video, and the effect of the second keyframe in the first video is the same as the effect of the second keyframe in the second video.
[0104] In some implementations, before generating the second video, the electronic device needs to obtain the parameters of each frame in the second video based on the parameters of the keyframe frames, and then generate the second video. Specifically, the parameters of the frames before the first keyframe frame in the second video are the parameters of the first keyframe frame; the parameters of the frames between the first and second keyframe frames in the second video change uniformly from the parameters of the first keyframe frame to the parameters of the second keyframe frame; and the parameters of the frames after the second keyframe frame in the second video are the parameters of the second keyframe frame. Based on the parameters of these frames, the electronic device can generate a second video containing both the first and second keyframe frames.
[0105] In some implementations, S504-1 is executed, followed by S505.
[0106] S504-2. Generate a second video including a second keyframe and a third keyframe. The second video has a third keyframe added at its starting position, and the parameters of the third keyframe are identical to those of the first keyframe.
[0107] In some implementations, after the electronic device determines that the captured portion is the first part and includes the first keyframe, it can generate a second video based on the captured first video. The second video retains the second keyframe. However, since the duration of the second video differs from that of the first video, and the timestamps of the second keyframes may also differ between the two videos, the electronic device needs to update the timestamps of the second keyframes in the second video. Furthermore, the electronic device can add a third keyframe at the beginning of the second video. The parameters of the third keyframe are identical to those of the first keyframe. This preserves the effect of adding keyframes to the first video.
[0108] For example, suppose the length of the first video is S1 seconds, the first keyframe is located at second A in the first video, the second keyframe is located at second B in the first video, and the length of the second video is S2.
[0109] When the electronic device captures the first portion of the first video, and that first portion includes the first keyframe, the third keyframe is located at second 0 of the second video, and the second keyframe is located at second B-(S1-S2) of the second video. The third keyframe is located before the second keyframe.
[0110] It's worth noting that the parameters of the first keyframe in the first video are the same as those of the third keyframe in the second video, and the parameters of the second keyframe in the first video are the same as those of the second keyframe in the second video. In other words, the effect of the first keyframe in the first video is the same as the effect of the third keyframe in the second video, and the effect of the second keyframe in the first video is the same as the effect of the second keyframe in the second video.
[0111] In some implementations, before generating the second video, the electronic device needs to obtain the parameters of each frame in the second video based on the parameters of the keyframe frames, and then generate the second video. Specifically, the parameters of the frames between the third keyframe frame and the second keyframe frame in the second video change uniformly from the parameters of the first keyframe frame to the parameters of the second keyframe frame, and the parameters of the frames after the second keyframe frame in the second video are the parameters of the second keyframe frame. Based on the parameters of the aforementioned frames, the electronic device can generate a second video that includes the third keyframe and the second keyframe.
[0112] For example, the second video generated in S504-2 may refer to Figure 3E The video represented by video track 441 shown.
[0113] In some implementations, S505 is executed after S504-2.
[0114] S504-3. Generate a second video including a first keyframe and a third keyframe. A third keyframe is added at the end of the second video, and the parameters of the third keyframe are identical to those of the second keyframe.
[0115] In some implementations, after the electronic device determines that the captured portion is the latter part and includes the second keyframe, it can generate a second video based on the captured first video. The second video retains the first keyframe. However, since the duration of the second video differs from that of the first video, and the timestamp of the first keyframe may also differ between the two videos, the electronic device needs to update the timestamp of the first keyframe in the second video. Furthermore, the electronic device can add a third keyframe at the end of the second video. The parameters of the third keyframe are identical to those of the second keyframe. This preserves the effect of adding keyframes to the first video.
[0116] For example, suppose the length of the first video is S1 seconds, the first keyframe is located at second A in the first video, the second keyframe is located at second B in the first video, and the length of the second video is S2.
[0117] When the electronic device captures the latter part of the first video, and this latter part includes the second keyframe, the first keyframe is located at second A in the second video, and the third keyframe is located at second S2 in the second video. The first keyframe is located before the third keyframe.
[0118] It's worth noting that the parameters of the first keyframe in the first video are the same as those in the second video, and the parameters of the second keyframe in the first video are the same as those in the third keyframe in the second video. In other words, the effect of the first keyframe in the first video is the same as that of the first keyframe in the second video, and the effect of the second keyframe in the first video is the same as that of the third keyframe in the second video.
[0119] In some implementations, before generating the second video, the electronic device needs to obtain the parameters of each frame in the second video based on the parameters of the keyframe frames, and then generate the second video. Specifically, the parameters of the frames before the first keyframe frame in the second video are the parameters of the first keyframe frame, and the parameters of the frames between the first and third keyframe frames in the second video change uniformly from the parameters of the first keyframe frame to the parameters of the second keyframe frame. Based on the parameters of these frames, the electronic device can generate a second video that includes the first and third keyframe frames.
[0120] For example, the second video generated in S504-3 may refer to Figure 3B The video represented by video track 411 shown.
[0121] In some implementations, S505 is executed after S504-3.
[0122] S505, Play the second video.
[0123] In some implementations, after the electronic device generates the second video, the second track included in the first user interface can display multiple frames from the second video. Furthermore, the electronic device can play the second video within the first user interface. Specifically, the electronic device can start playing from the beginning of the second video or from a specific frame within it. In some implementations, the effect of each frame of the second video played by the electronic device can be based on the parameters of each frame obtained in the aforementioned steps, which will not be elaborated upon here.
[0124] For example, the electronic device can respond to a sliding operation on the second track, changing the position of the second track pointed to by the pointer, that is, changing the position where the second video starts playing. As another example, the electronic device can play the second video by sliding the second track in a first user interface, or by responding to a click operation on the playback control. For example, the electronic device can respond to a sliding operation on the second track... Figure 4A Clicking the playback control 503 in the middle will play the second video.
[0125] From the above Figure 5 As shown in the process, electronic devices can trim videos with keyframe animations, and even if the trimmed portion includes keyframe frames, they can add new keyframes to the trimmed portion of the video at the trimmed location, ensuring that the effect of the newly added keyframe is consistent with the effect of the deleted keyframe. This preserves the user's editing capabilities and reduces their workload.
[0126] In one possible implementation, Figure 5 The cropping process shown is also applicable to video scenarios with multiple media tracks. Media tracks can include, but are not limited to, text tracks, sticker tracks, and picture-in-picture tracks. In some implementations, the electronic device can crop a media track containing two keyframes. If the deleted portion of the media includes keyframes, the electronic device can add a keyframe at the time corresponding to the cropped position of the edited media, and set the parameters of the newly added keyframe to the parameters of the cropped keyframe. The electronic device uses the video editing method provided in this application to crop media tracks. Figure 5 The method shown is similar; for details, please refer to [link / reference]. Figure 5 The process shown is not described in detail here.
[0127] Specifically, after playing the second video, the electronic device can pause its playback. First, the electronic device can add a third track to the first user interface. This third track displays multiple frames of the first source material. The preview area in the first user interface displays the fourth frame of the second track and the fifth frame of the third track, both pointed to by the pointer. Keyframe markers are displayed at the fourth and fifth positions of this third track, with the fourth position preceding the fifth position. The fourth frame displays the third effect, and the fifth frame displays the fourth effect. Then, the electronic device adjusts the third track to a fourth track. This fourth track includes the first six positions of the first track, with the sixth position located between the fourth and fifth positions. Keyframe markers are also displayed at the fourth and sixth positions of this third track. Finally, the electronic device plays the video containing the second source material and the second video. In the preview area, the second video is played starting from the fourth screen, and the second material is played starting from the fifth screen. The second material includes multiple screens between the sixth and seventh screens of the first material. The sixth screen is the screen at the beginning of the third track, and the seventh screen is the screen at the sixth position of the third track. In the second material, multiple screens between the sixth and seventh screens gradually transition from the third effect to the fourth effect, and multiple screens after the seventh screen are presented with the fourth effect.
[0128] In this way, the electronic device can add other material tracks when the main track video exists in the user interface, and can use the video editing method provided in the embodiments of this application for the other newly added material tracks so that the effect of the picture can be retained after the other newly added material tracks are cut.
[0129] Next, combine Figure 6 Introduction Figure 5 The method flow in the diagram corresponds to the operating system (OS) interaction diagram of the electronic device.
[0130] Figure 6 The user operation module, data control module, data storage module, and data rendering module shown are modules included in the electronic device for managing video capture and adding keyframes. For the definitions of these modules, please refer to the detailed description in the electronic device software architecture section below. The specific functions of these modules are detailed in the following process and will not be repeated here.
[0131] S601, The user operation module detects the operation of capturing the first video.
[0132] In some implementations, the capture operation may include a right swipe operation on the left handle at the left edge of the first video, or a left swipe operation on the right handle at the right edge of the first video.
[0133] S602, The user operation module sends the intercepted data to the key frame data processing layer in the data storage module.
[0134] S603, the keyframe data processing layer determines whether a keyframe image has been captured based on the captured data.
[0135] S604, the keyframe data processing layer determines that the first keyframe image has been captured, and adds a third keyframe based on the captured data.
[0136] S605, the keyframe data processing layer sends the instruction information for deleting the parameters of the first keyframe image and the parameter information of the added third keyframe image to the data storage module in the data storage module.
[0137] S606, The data storage module deletes the parameters of the first keyframe, updates the timestamp of the parameters of the second keyframe, and adds the parameters of the third keyframe.
[0138] S607, The user operation module detects video playback operations.
[0139] For example, the user operation module can detect click operations on the playback control. For a detailed description of S607, please refer to the above-described S505.
[0140] S608, The user operation module sends an instruction message for playing the second video to the data rendering layer of the data rendering module.
[0141] S609, The data rendering layer sends indication information for calculating the parameters of the Nth frame in the second video to the keyframe data processing layer in the data storage module.
[0142] Before executing S609, the data rendering layer also needs to determine whether the parameters of the first keyframe and the third keyframe are valid.
[0143] The term "effective" actually refers to the parameters of the first keyframe and the third keyframe. In other words, the first video has undergone effective editing. This is because a video containing only one keyframe for a given period is not functional. To generate automatically edited multi-frame videos by having the user edit one or two frames, the video needs to contain two or more keyframes.
[0144] Where N is a non-negative integer, and the Nth frame is any frame in the second video. Since the second video consists of multiple frames, each frame in the second video needs to be rendered and generated as the video plays.
[0145] S610, the keyframe data processing layer determines whether the Nth frame is between the third keyframe and the second keyframe, and obtains the parameters of the Nth frame in the second video according to the first parameter and the second parameter.
[0146] In some implementations, when the Nth frame is before the first moment, the parameters of the Nth frame are the first parameters; when the Nth frame is after the second moment, the parameters of the Nth frame are the second parameters; when the Nth frame is between the first and second moments, the parameters of the Nth frame can be determined according to the above. Figure 6 The calculations obtained using the two formulas introduced will not be elaborated upon here.
[0147] S611, The keyframe data processing layer sends the parameter information of the Nth frame of the second video to the data storage layer.
[0148] S612, The data storage layer stores the parameters of the Nth frame in the second video.
[0149] In some implementations, the data storage layer stores the parameters of the Nth frame in the second video in the material data class through data listening, so that it can be directly read when the second video is played again without executing S610.
[0150] S613, The data storage layer sends the parameters of the Nth frame in the second video to the Animation in the data rendering module.
[0151] In some implementations, the data storage layer can send the parameters of the Nth frame in the second video and the content of the second moment to Animation via the data rendering layer.
[0152] S614, Animation, draws the Nth frame of the second video based on the parameters of the Nth frame in the second video.
[0153] In some implementations, Animation can render and generate the edited Nth frame of the second video based on the parameters and content of the Nth frame in the second video.
[0154] Repeat steps S609-S614 until the second video finishes playing.
[0155] In some implementations, the editing process for multiple media tracks can refer to the above. Figure 6 The OS diagram shown is not described in detail here.
[0156] Figure 7 A schematic diagram of the structure of the electronic device 100 is shown.
[0157] Electronic device 100 can be a portable terminal device running iOS®, Android®, Microsoft®, Harmony®, or other operating systems. Electronic device 100 can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, vehicle, in-vehicle device, smart home device, and / or smart city device. It is not limited to these; electronic device 100 can also include non-portable terminal devices such as laptops and desktop computers with touch-sensitive surfaces or touch panels. This application does not impose any special limitations on the specific type of electronic device.
[0158] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0159] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0160] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0161] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0162] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0163] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0164] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.
[0165] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0166] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.
[0167] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.
[0168] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0169] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0170] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0171] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0172] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0173] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0174] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0175] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0176] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0177] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 2.
[0178] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0179] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0180] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0181] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0182] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0183] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0184] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0185] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0186] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs can enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0187] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).
[0188] Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), and double data rate synchronous dynamic random access memory (DDR SDRAM, such as fifth-generation DDR SDRAM, which is generally called DDR5 SDRAM). Non-volatile memory can include disk storage devices and flash memory.
[0189] Flash memory can be classified according to its operating principle, including NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multimedia card (eMMC), etc.
[0190] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.
[0191] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.
[0192] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.
[0193] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0194] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0195] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.
[0196] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.
[0197] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0198] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0199] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0200] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.
[0201] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0202] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.
[0203] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.
[0204] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.
[0205] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.
[0206] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0207] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.
[0208] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.
[0209] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0210] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.
[0211] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0212] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0213] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0214] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0215] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0216] Figure 8 This is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.
[0217] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0218] The application layer can include a series of application packages.
[0219] like Figure 8 As shown, the application package may include applications such as video editing, camera, and gallery. The video editing application includes a user operation module, a data control module, a data storage module, and a data rendering module.
[0220] Specifically, the user operation module is used to receive various user operations, such as detecting the addition of keyframes, detecting the capture operation, detecting the playback operation, and so on.
[0221] The data control module is used to convert user operations into data that can be transmitted between various modules.
[0222] The data storage module includes a data transmission layer, a data storage module layer, and a keyframe data processing layer. The data transmission layer receives data from other modules and transmits it to the data storage layer and the keyframe data processing layer (also known as the data processing layer). The data storage layer includes a data monitor and a material data class. The data monitor listens for and identifies data sent to the data storage layer, while the material data class stores, deletes, and modifies frame parameters, as well as storing various frame content information, such as keyframe timestamps and parameters for each keyframe. The keyframe data processing layer calculates the parameters of other frames in the video or material based on the keyframe frame parameters and sends these parameters to the data rendering module. It also determines whether a keyframe frame has been captured.
[0223] The data rendering module includes a data rendering layer and Animation. Animation is used to render and generate the images displayed in the user interface in real time based on the parameters and content of various images.
[0224] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0225] like Figure 8As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0226] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0227] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0228] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0229] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0230] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0231] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0232] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0233] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0234] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0235] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0236] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0237] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0238] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0239] A 2D graphics engine is a graphics engine for 2D drawing.
[0240] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0241] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 100.
[0242] When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a touch click as an example, where the corresponding control is the camera application icon, the camera application calls the application framework layer's interface to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.
[0243] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.
[0244] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0245] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0246] In summary, the above description is merely an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made according to the disclosure of the present invention should be included within the scope of protection of the present invention.
Claims
1. A video editing method, characterized in that, The method includes: The first user interface is displayed, which includes a preview area, a first track, and a pointer with a fixed position. The first track displays multiple frames of the first video. The preview area displays the first frame of the first track pointed to by the pointer. Keyframe markers are displayed at the first position and the second position of the first track. The first position is before the second position. The effect of the frame at the first position of the first track is the first effect, and the effect of the frame at the second position of the first track is the second effect. Upon receiving a video capture operation applied to the first track, the first track is adjusted to the second track; In response to adjusting the first track to the second track, adjusting the first video to the second video, and adding a keyframe at the moment when the second video presents the third frame, the second track includes the start position to the third position of the first track, the third position is located between the first position and the second position, the first position and the third position of the second track are both marked with keyframes, the second video includes multiple frames from the start frame of the first video to the third frame, the start frame is the frame at the start position of the first track, the third frame is the frame at the third position of the first track, in the second video, the multiple frames before the second frame are presented as the first effect, the multiple frames from the second frame to the third frame gradually transition from the first effect to the second effect, the second frame is the frame at the first position of the second track; Upon receiving a playback command, the second video is played in the preview area, starting from the first screen.
2. The method according to claim 1, characterized in that, The first track also includes a right handle on the right edge, and the video capture operation includes a left swipe operation on the right handle.
3. A video editing method, characterized in that, The method includes: The first user interface is displayed, which includes a preview area, a first track, and a pointer with a fixed position. The first track displays multiple frames of the first video. The preview area displays the first frame of the first track pointed to by the pointer. Keyframe markers are displayed at the first position and the second position of the first track. The first position is before the second position. The effect of the frame at the first position of the first track is the first effect, and the effect of the frame at the second position of the first track is the second effect. Upon receiving a video capture operation applied to the first track, the first track is adjusted to the second track; In response to adjusting the first track to the second track, adjusting the first video to the second video, and adding a keyframe at the moment when the third frame of the second video is displayed, the second track includes the third position to the end position of the first track, the third position is located between the first position and the second position, the second position and the third position of the second track are both marked with keyframes, the second video includes multiple frames between the third frame and the end frame of the first video, the third frame is the frame at the third position of the first track, the end frame is the frame at the end position of the first track, in the second video, the multiple frames from the third frame to the second frame gradually transition from the first effect to the second effect, the multiple frames after the second frame are presented with the second effect, and the second frame is the frame at the second position of the second track; Upon receiving a playback command, the second video is played in the preview area, starting from the first screen.
4. The method according to claim 3, characterized in that, The first track also includes a left handle on the left edge, and the video capture operation includes a right swipe operation on the left handle.
5. The method according to any one of claims 1-4, characterized in that, The first effect includes displaying at a first display position, the editing operation is used to adjust the image from the first display position to a second display position, and the second effect includes displaying at the second display position; and / or The first effect includes displaying at a first size, the editing operation being used to adjust the image from the first size to a second size, and the second effect includes displaying at the second size; and / or The first effect includes displaying at a first display angle, the editing operation is used to adjust the image from the first display angle to a second display angle, and the second effect includes displaying at the second display angle; and / or The first effect includes displaying at a first opacity, and the editing operation is used to adjust the image from the first opacity to a second opacity, wherein the second effect includes displaying at the second opacity.
6. The method according to any one of claims 1-4, characterized in that, Before displaying the first user interface, the method includes: The second user interface is displayed, which includes: the preview area, the first track, and the pointer with a fixed position. The preview area displays the image of the first position of the first track pointed to by the pointer. The operation to select the first track has been received; Upon receiving an operation to add a keyframe, display the keyframe identifier at the first position; Upon receiving a left swipe operation on the first track, the first track is moved to the left, and the preview area displays the image of the second position of the first track as pointed to by the pointer. Upon receiving an editing operation applied to the second position of the image in the preview area, the effect of the image at the second position is adjusted to the second effect, and a keyframe marker is displayed at the second position; Upon receiving a rightward slide operation on the first track, the first track is moved to the right.
7. The method according to claim 6, characterized in that, After receiving the operation to add a keyframe, the method further includes: obtaining parameters of the image at the first position, wherein the parameters of the image at the first position are used to indicate the first effect; After receiving the editing operation applied to the second position in the preview area, the method further includes: obtaining parameters of the image at the second position, wherein the parameters of the image at the second position are used to indicate the second effect.
8. The method according to claim 6, characterized in that, After receiving the operation of selecting the first track, the method further includes: The first control is displayed in the second user interface, and the operation of adding keyframes includes operations performed on the first control.
9. The method according to any one of claims 1-4, characterized in that, After playing the second video from the first screen in the preview area, the method further includes: Received user action to export video; Store the second video.
10. The method according to any one of claims 1-4, characterized in that, The first track displays all or part of the footage from the first video.
11. The method according to any one of claims 1-4, characterized in that, After playing the second video from the first screen in the preview area, the method further includes: Received a pause playback command; Upon receiving the operation to add a third track, the third track displays multiple frames of the first material. The preview area displays the fourth frame of the second track pointed to by the pointer and the fifth frame of the third track pointed to by the pointer. Keyframe markers are displayed at the fourth and fifth positions of the third track. The fourth position is before the fifth position. The effect of the frame at the fourth position of the third track is the third effect, and the effect of the frame at the fifth position of the third track is the fourth effect. Upon receiving a video cropping operation applied to the third track, the third track is adjusted to the fourth track. The fourth track includes the starting position to the sixth position of the third track. The sixth position is located between the fourth position and the fifth position. Keyframe markers are displayed at both the fourth and sixth positions of the third track. Upon receiving a playback command, the second video is played starting from the fourth screen in the preview area, and the second material is played starting from the fifth screen. The second material includes multiple screens between the sixth and seventh screens of the first material. The sixth screen is the screen at the starting position of the third track, and the seventh screen is the screen at the sixth position of the third track. In the second material, the multiple screens from the sixth screen to the seventh screen gradually transition from the third effect to the fourth effect, and the multiple screens after the seventh screen are presented with the fourth effect.
12. An electronic device, characterized in that, The electronic device includes a memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-11.
13. A chip, said chip being used in an electronic device, characterized in that, The chip includes one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-11.
14. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-11.