Method for video editing and related apparatus

By adding keyframes and sliding tracks in the video editing interface, a gradient effect between tracks is generated, solving the problem of uneven multi-track video editing and improving the naturalness of video playback and user experience.

CN119316662BActive Publication Date: 2026-05-15HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

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

Technical Problem

Existing technologies struggle to achieve smooth editing of multi-track videos, especially when adding keyframes and editing media tracks, resulting in unnatural track changes during video playback.

Method used

By displaying a first user interface in the video editing interface, including a preview area, a first track, and a second track, and adding keyframes, users can slide and edit the tracks to generate gradient effects between tracks, ensuring smooth track transitions.

Benefits of technology

It achieves smooth transitions during multi-track video playback, with natural changes in image quality between tracks, thus enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316662B_ABST
    Figure CN119316662B_ABST
Patent Text Reader

Abstract

The present application provides a method for video editing and related devices. In the method, the electronic device can add key frames to a video and a plurality of materials, and can also edit one or more frames in the video and the plurality of material tracks, and can further generate parameters of a plurality of pictures between any two key frames in the video. In this way, the electronic device can observe that the video and the plurality of tracks are relatively smooth, gradually rotating, scaling, moving, changing in opacity, etc. during the process of playing the edited video, so that the user has a good visual experience.
Need to check novelty before this filing date? Find Prior Art

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] Currently, electronic devices can edit videos and modify parameters of multiple frames by adding keyframes. Furthermore, they can add content to multiple tracks, such as picture-in-picture, text, and sticker tracks. Achieving smooth editing of multi-track videos is a pressing problem that needs to be solved in this field. Summary of the Invention

[0003] This application provides a video editing method and related apparatus, which can add various material tracks, add keyframes to various material tracks, edit one or more frames in a material track, and also set parameters for multiple frames between any two keyframes in the track.

[0004] In a first aspect, this application provides a video editing method, characterized in that the method includes:

[0005] The system displays a first user interface, which includes a preview area, a first track, a second track, and a fixed pointer. The first track displays multiple frames of a first video, and the second track displays multiple frames of a first source material. The preview area displays the first frame of the first track and the second frame of the second track pointed to by the pointer. Each frame of the first source material is presented with a first effect. The system receives a selection operation on the second track. It also receives an operation to add a keyframe. A left swipe operation on the second track moves both the first and second tracks to the left, and displays the third frame of the left-shifted first track and the fourth frame of the left-shifted second track in the preview area. An editing operation is received on the fourth frame in the preview area, adjusting its effect to a second effect. A right swipe operation on the second track moves both the first and second tracks to the right, and displays the fifth frame of the right-shifted first track and the sixth frame of the right-shifted second track in the preview area. Upon receiving a playback command, the first video is played starting from the fifth screen in the preview area, and the second material is played starting from the sixth screen. The second material includes various screens of the first material. In the second material, multiple screens before the second screen are presented as the first effect, multiple screens from the second screen to the fourth screen gradually transition from the first effect to the second effect, and multiple screens after the fourth screen are presented as the second effect.

[0006] By implementing the above, electronic devices can add various media tracks, add keyframes to these tracks, edit one or more frames within a single track, and generate parameters for multiple frames between any two keyframes. This allows the electronic device to observe independent changes between different tracks during video playback, with the media tracks exhibiting smooth, gradual changes such as rotation, scaling, position shifting, and opacity alteration, resulting in a better user experience.

[0007] In conjunction with the first aspect, in some implementations, the second track is a picture-in-picture track, and the first material is a video containing multiple frames. In the preview area, the frame of the first material is displayed in picture-in-picture format within the frame of the first video. Alternatively, the second track is a text track, and the first material is a video containing multiple frames of text. Or, the second track is a sticker track, and the first material is a video containing multiple frames of stickers.

[0008] In some implementations, the first source material can also include images of more types of source material.

[0009] In conjunction with the first aspect, in some implementations, 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 including display 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 including display 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 including display 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 including display at the second opacity.

[0010] In conjunction with the first aspect, in some implementations, after receiving the operation to add a keyframe, the method further includes: displaying a first identifier at the position of the second track pointed to by the pointer. After receiving the editing operation applied to the fourth screen in the preview area, the method further includes: displaying a second identifier at the position of the second track after the pointer has shifted left.

[0011] In conjunction with the first aspect, in some implementations, after receiving the operation to add a keyframe, the method further includes: obtaining parameters of the second screen, the parameters of the second screen being used to indicate the first effect.

[0012] After receiving the editing operation applied to the fourth screen in the preview area, the method further includes: obtaining parameters of the fifth screen, the parameters of the fifth screen being used to indicate the second effect.

[0013] In conjunction with the first aspect, in some implementations, before displaying the first user interface, the method further includes: displaying a second user interface, the second user interface including: the preview area, the first track, and the pointer with a fixed position. An operation to add the second track is received.

[0014] In conjunction with the first aspect, in some implementations, after playing the first video starting from the sixth screen and the second material starting from the seventh screen in the preview area, the method further includes: receiving a user operation to export the video. The video containing the first video and the second material is stored.

[0015] In conjunction with the first aspect, in some implementations, in the preview area, the image of the first material is overlaid on the image of the first video, or the image of the first material and the image of the first video are displayed in a split-screen format.

[0016] In conjunction with the first aspect, in some implementations, the first track displays all or part of the first video.

[0017] In conjunction with the first aspect, in some implementations, the method also includes:

[0018] The first orbit starts at the same time as the second orbit.

[0019] In conjunction with the first aspect, in some implementations, after receiving the operation of selecting the second track, the method further includes: displaying a first control in the first user interface, wherein the operation of adding a keyframe includes an operation performed on the first control.

[0020] In conjunction with the first aspect, in some implementations, after playing the first video starting from the fifth screen and the second material starting from the sixth screen in the preview area, the method further includes: receiving a pause operation and displaying the seventh screen of the first track and the eighth screen of the second track pointed to by the pointer in the preview area; receiving an editing operation applied to the eighth screen in the preview area and adjusting the effect of the eighth screen in the preview area to a third effect, wherein the eighth screen is located between the second screen and the fourth screen; receiving a right swipe operation on the second track, moving the first track and the second track to the right, and displaying the ninth screen of the first track and the tenth screen of the second track pointed to by the pointer after the rightward movement in the preview area. Upon receiving a playback command, the first video is played starting from the ninth screen in the preview area, and the third material is played starting from the tenth screen. The third material includes the various screens of the first material arranged sequentially. In the third material, the multiple screens before the second screen are presented as the first effect, the multiple screens from the second screen to the eighth screen gradually transition from the first effect to the third effect, the multiple screens from the eighth screen to the fourth screen gradually transition from the third effect to the second effect, and the multiple screens after the fourth screen are presented as the second effect.

[0021] In conjunction with the first aspect, in some implementations, after receiving the operation of selecting the second track, the method further includes: displaying a left handle on the left edge of the second track and a right handle on the right edge of the second track, the left handle being used to adjust the start time of the second track and the right handle being used to adjust the end time of the second track.

[0022] Secondly, 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 performs the method described in the first aspect or any embodiment of the first aspect.

[0023] Thirdly, embodiments of this application provide a chip including one or more processors. When the one or more processors execute computer instructions, the electronic device performs the method described in the first aspect or any embodiment of the first aspect.

[0024] Fourthly, embodiments of this application provide a computer storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any embodiment of the first aspect. Attached Figure Description

[0025] Figures 1A-1D A schematic diagram of the user interface of the electronic device provided in this application embodiment entering the video editing interface;

[0026] Figures 2A-2D A schematic diagram of the user interface for rotating video on an electronic device provided in an embodiment of this application;

[0027] Figures 2E-2H A schematic diagram of the user interface for playing a rotated video on an electronic device provided in this application embodiment;

[0028] Figures 2I-2J This is a schematic diagram of the user interface for scaling video on an electronic device provided in an embodiment of this application.

[0029] Figures 3A-3F A schematic diagram of a user interface for changing the opacity of a picture-in-picture track in an electronic device provided in an embodiment of this application;

[0030] Figure 3G-Figure 3J A schematic diagram of the user interface for playing edited videos on an electronic device provided in this application embodiment;

[0031] Figures 4A-4F A schematic diagram of a user interface for changing the position of a text track in an electronic device provided in an embodiment of this application;

[0032] Figures 4G-4J A schematic diagram of the user interface for playing edited videos on an electronic device provided in this application embodiment;

[0033] Figure 5 A flowchart illustrating a video editing method provided in an embodiment of this application;

[0034] Figure 6 A schematic diagram illustrating the calculation rules for obtaining parameters from multiple screens, provided in an embodiment of this application.

[0035] Figure 7 A flowchart illustrating another video editing method provided in an embodiment of this application;

[0036] Figure 8 This application provides an OS interaction diagram corresponding to a video editing method provided in an embodiment of the present application.

[0037] Figure 9 An OS interaction diagram corresponding to another video editing method provided in the embodiments of this application;

[0038] Figure 10 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0039] Figure 11A software structure block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0040] 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.

[0041] 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.

[0042] 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 the 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.

[0043] First, let's introduce two related terms used in the embodiments of this application:

[0044] 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.

[0045] 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.

[0046] With the development of electronic devices, they can meet various user needs for video editing. For example, an electronic device can set any two frames in a video as keyframes and generate keyframe animation between those two frames, allowing the video frames to change their display position, size, rotation angle, and opacity, thus presenting richer effects during video playback. Furthermore, electronic devices can add more material tracks, such as picture-in-picture, text, and sticker tracks, so that when playing the video, the device can display not only the video content itself but also the added picture-in-picture, text, and sticker tracks, showcasing more elements and improving the user experience. In addition, electronic devices can also move, resize, rotate, and change the opacity of frames in the added tracks. The generation of keyframe animations described above can be achieved by adding keyframes using the electronic device. In one possible implementation, adding a keyframe to a specific frame in a video can be understood as marking that frame. How to generate keyframe animations based on keyframes will be discussed in subsequent specific embodiments and will not be described here.

[0047] The following section will explain in detail how to access the video editing interface on an electronic device, using the user interface provided by the device.

[0048] Figures 1A-1D An exemplary illustration shows the user interface of the electronic device provided in this application for entering the video editing interface.

[0049] like Figure 1AAs shown, the user interface 20 is the main interface provided by the electronic device. The user interface 20 may include, but is not limited to, time, date, and various application icons, such as the gallery icon 201. The electronic device can enter the gallery application in response to a user's click on the gallery icon 201. In this embodiment, the method of entering the gallery application is not limited; it may also include entering the gallery application in response to voice commands or gesture commands.

[0050] like Figure 1B As shown, user interface 21 is the user interface provided by the gallery application in the electronic device. User interface 21 may include, but is not limited to: selection bar 211, photo date 212, photo control 213, video control 214, etc. The selection bar 211 may include: photo option 211A, album option 211B, and recommended option 211C. For example, user interface 21 may be the user interface for selecting photo option 211A in the selection bar 211. For example, photo date 212 may be used to indicate the date the photo was taken or saved. For example, the photo displayed in photo control 213 may have been taken or saved by the electronic device "today". The video control 214 displays a video duration of "00:10", indicating that the duration of the video displayed by video control 214 is 10 seconds. The electronic device can respond to a user's click operation on video control 214 and enter the full-screen display interface of video control 214.

[0051] like Figure 1CAs shown, user interface 22 is the user interface for the electronic device to display the video displayed in video control 214 in full screen. User interface 22 may include, but is not limited to: screen orientation control 221, sharing control 222, editing control 223, favorites control 224, delete control 225, more controls 226, video display area 227, playback control 228, and video track 229. The electronic device can respond to a click on screen orientation control 221 to lock or unlock the screen orientation. The electronic device can respond to a click on sharing control 222 to share the video displayed in video control 214 with friends. The electronic device can respond to a click on favorites control 224 to categorize the video displayed in video control 214 into the "My Favorites" category. The electronic device can respond to a click on delete control 225 to delete the video displayed in video control 214. The electronic device can respond to a click on more controls 226 to display more option controls for the video displayed in video control 214. The electronic device can respond to a click operation applied to any position in the video display area 227, hiding all elements except for the video display area 227. The electronic device can respond to a click operation on the playback control 228, playing the video displayed by the video control 214. The video track 229 includes a pointer 229A and a draggable area 229B. The electronic device can respond to a sliding operation on the draggable area 229B, displaying a frame from the video track 229 pointed to by the pointer 229A. The electronic device can respond to a click operation on the editing control 223, displaying the user interface 23.

[0052] like Figure 1DAs shown, user interface 23 is the user interface provided by the video editing application in the electronic device. User interface 23 may include, but is not limited to: video preview interface 231, video track 232, pointer 233, playback controls 234, effect options bar 235, track options bar 236, playback time 237, resolution selection control 238, export controls 239, etc. Among them, video track 232 displays multiple frames from the video. In one possible implementation, if the video is too long, video track 232 may only display a portion of the video, with the remaining frames hidden. The frame displayed in video preview interface 231 is a single frame from video track 229 pointed to by pointer 233. The electronic device can edit the video displayed in video preview interface 231 within user interface 23. Effect options bar 235 may include, but is not limited to: split, trim, volume adjustment, speed adjustment, deletion, cropping, single-frame export, filters, parameter adjustment (e.g., color correction, brightness, contrast, etc.), opacity 235A, picture-in-picture switching, replacement, etc. The track options bar 236 can include, but is not limited to: templates, clips, filters, music, text 236A, stickers 236B, effects, picture-in-picture 236C, aspect ratio, background, etc. Playback time 237 is exemplarily represented as "00:00 / 00:10", which means that the current pointer 233 is pointing to the 0th second frame in a video with a total duration of 10 seconds.

[0053] Based on the user interface described above, the following describes in detail the user interface of the electronic device provided in the embodiments of this application for editing and playing the edited video in different scenarios.

[0054] Scenario 1: The scenario of editing and playing the edited video.

[0055] Figures 2A-2D An example is shown of a user interface for an electronic device to rotate a video by adding keyframes.

[0056] like Figure 2A As shown, the electronic device can display the user interface 30 provided by the video editing application. In response to a click operation on the keyframe addition control 301, the electronic device can add a keyframe 311 to the A-th frame of the video track 303 pointed to by the pointer 302, i.e., the frame displayed in the video preview area 304, and display as shown... Figure 2B The user interface 31 shown.

[0057] For example, video track 312 in user interface 31 includes a keyframe 311 added for frame A. The electronic device can respond to a press on video track 312. Figure 2B The operation of sliding in the direction of the arrow shown in the image will display as follows: Figure 2C The user interface 32 is shown. In this embodiment, the above-described sliding operation for the video track 312 is only illustrative and may include other operations to change the screen pointed to by the pointer, which are not limited thereto.

[0058] For example, pointer 321 in user interface 32 points to frame B in video track 322, and video preview area 323 displays frame B. The electronic device can respond to an operation that rotates the screen in video preview area 323, displaying, as shown... Figure 2D The user interface 33 shown. For example, the above-described screen rotation operation may include: pressing two fingers respectively... Figure 2C The two arrows shown in the diagram simultaneously slide counterclockwise. In this embodiment, the above-described operation to rotate the screen is merely illustrative and may include other operations, such as voice commands, gesture commands, long-press mouse movement, etc., which are not limited thereto.

[0059] For example, the video track 331 in user interface 33 includes a keyframe 332 added for frame B. It is worth noting that the aforementioned rotation of the video preview area 323 actually changes the parameters of frame B; this rotation is equivalent to adding a keyframe to frame B. Frame B displayed in video preview area 333 is rotated 90 degrees counterclockwise around the midpoint of the image relative to frame B displayed in video preview area 323.

[0060] As can be seen from the above editing process, the electronic device rotated the video and added two keyframes. Therefore, in addition to the rotation of frame B in the video, the frames between frames A and B in the video were also rotated.

[0061] Figures 2E-2H An example is shown of a user interface for an electronic device to play a video after it has been rotated.

[0062] Electronic devices can respond to Figure 2D Medium video track 331 Figure 2B The operation involves sliding in the opposite direction of the arrow shown in the image, as displayed. Figure 2E The user interface 34 is shown. Pointer 341 in user interface 34 points to frame A in video track 342. The electronic device can respond to a click on the playback control 343 to play the rotated video in the video preview area 344.

[0063] When the rotated video reaches frame C, the electronic device can display as follows: Figure 2FThe user interface 35 is shown. In user interface 35, pointer 351 points to frame C in video track 352, and this frame C is displayed in video preview area 353. The frame C displayed in video preview area 353 is rotated counterclockwise by 'a' degrees relative to the unrotated frame C in the video. Where 'a' is greater than 0.

[0064] When the rotated video reaches frame D, the electronic device can display as follows: Figure 2G The user interface 36 is shown. Pointer 361 in user interface 36 points to the D-th frame in video track 362, and this D-th frame is displayed in video preview area 363. The D-th frame displayed in video preview area 363 has been rotated counterclockwise by b degrees relative to the D-th frame in the unrotated video, around the midpoint of the frame. Where b is greater than a.

[0065] When the rotated video reaches frame B, the electronic device can display as follows: Figure 2H The user interface 37 is shown. Pointer 371 in user interface 37 points to frame B in video track 372, and this frame B is displayed in video preview area 373. The frame B displayed in video preview area 373 has been rotated counterclockwise by c degrees relative to the frame B in the unrotated video, around the midpoint of the frame. Where c is greater than b.

[0066] When the rotated video plays to frames B and beyond, the images displayed in the video preview area are rotated counterclockwise by c degrees relative to the images in the unrotated video, around the midpoint of the image.

[0067] As can be seen from the above process of playing and editing the video, the electronic device performs corresponding processing on the video between the two keyframes, generating a rotation animation for the video. Furthermore, during the playback of the edited video, the rotation can occur smoothly and gradually, rather than abruptly rotating dramatically when the video reaches the second keyframe, resulting in a better viewing experience for the user.

[0068] In this embodiment, in addition to the above-described rotation processing of the video, scaling, repositioning, and transparency changes can also be performed on the video. The electronic device's methods for repositioning and changing the transparency of the video can refer to the user interface for video rotation described above, and will not be repeated here.

[0069] The following section describes the user interface for scaling videos.

[0070] Figures 2I-2J An example is shown of a user interface for scaling video on an electronic device.

[0071] The electronic device can respond to a button press on video track 312. Figure 2B The operation of sliding in the direction of the arrow shown in the image will display as follows: Figure 2I The user interface shown is 38.

[0072] For example, pointer 381 in user interface 38 points to frame B in video track 382, ​​and video preview area 383 displays frame B. The electronic device can respond to an operation that zooms out of the video preview area 383, displaying... Figure 2J The user interface 39 is shown. For example, the above-described operation of shrinking the screen may include: pressing with two fingers respectively... Figure 2I The sliding operation is performed using the two arrows shown, and the directions of the two arrows are opposite to each other. In this embodiment of the application, the above-described operation of shrinking the screen is only illustrative and may include many other operations, such as voice commands, gesture commands, long-press mouse movement operations, etc., which are not limited thereto.

[0073] For example, video track 391 in user interface 39 includes a keyframe 392 added for frame B. It is worth noting that the aforementioned operation of zooming out of the video preview area 393 actually changes the parameters of frame B; this zooming-out operation is equivalent to adding a keyframe to frame B. Frame B displayed in video preview area 393 is half the size of frame B displayed in video preview area 383.

[0074] Optionally, electronic devices can also enlarge the image in the video, without limitation.

[0075] As can be seen from the above editing process, the electronic device reduced the size of the video and added two keyframes. Therefore, in addition to the reduction in the size of frame B in the video, the area between frames A and B in the video was also reduced in size.

[0076] Similarly, the process of playing a scaled-down video on an electronic device can be referenced as described above. Figures 2E-2H The user interface will not be described in detail here. The electronic device processes the video between two keyframes to generate a zoom-out animation. Furthermore, during playback of the edited video, the zoom-out or zoom-up is smoother and gradual, rather than abruptly and drastically shrinking or enlarging when the video reaches the second keyframe, resulting in a better user experience.

[0077] In some implementations, when a video includes multiple source tracks, the aforementioned video—that is, a video without any processing or a video that has only undergone processing such as rotation, scaling, repositioning, or opacity adjustment—can be referred to as a video track. This naming convention is used to distinguish it from other source tracks in subsequent descriptions.

[0078] Scenario 2: Adding a picture-in-picture track to the video track, editing the picture-in-picture track, and playing the edited video.

[0079] The aforementioned playback of edited videos can refer to playing videos that include edited picture-in-picture tracks and rotated video tracks.

[0080] Figures 3A-3F An example is shown of a user interface for adding a picture-in-picture track to an electronic device and changing the opacity of the picture-in-picture track.

[0081] Electronic devices can respond to Figure 2D Medium video track 331 Figure 2B The operation involves sliding in the opposite direction of the arrow shown in the image, as displayed. Figure 3A The user interface 40 is shown. The electronic device can respond to a click operation on the picture-in-picture option 401A in the track option bar 401, allowing the user to select the picture-in-picture they want to add. Here, picture-in-picture can refer to a photo or a video clip. The electronic device can then display, as shown... Figure 3B The user interface 41 shown.

[0082] For example, the video preview area 411 in the user interface 41 includes two parts: a video frame 411A and a picture-in-picture frame 411B. By default, the picture-in-picture frame added by the electronic device is displayed in the center and overlays the video frame. Optionally, the electronic device can also set the video frame to overlay the picture-in-picture frame; this is not limited. The user interface 41 may include a video track 412 and a picture-in-picture track 413. By default, the duration of the picture-in-picture track 413 added by the electronic device is 3 seconds. Optionally, the electronic device can also change the duration of the picture-in-picture track 413. The picture-in-picture track 413 includes left and right handles to indicate that the picture-in-picture track 413 is selected.

[0083] The electronic device can respond to a click operation on the keyframe addition control 414 to add a keyframe 421 to the A-frame of the picture-in-picture track 413 pointed to by the pointer 415, i.e., the picture-in-picture screen 411B, and display it as shown. Figure 3C The user interface shown is 42.

[0084] For example, the picture-in-picture track 422 in the user interface 42 includes a keyframe 421 added for the A-th frame. The electronic device can respond to a press on the picture-in-picture track 422. Figure 3C The operation of sliding in the direction of the arrow shown in the image will display as follows: Figure 3D The user interface 43 is shown. In this embodiment, the above-described sliding operation for the picture-in-picture track 422 is only an example. Other operations may also be included to change the screen pointed to by the pointer, and there is no limitation on this.

[0085] For example, pointer 431 in user interface 43 points to frame D in picture-in-picture track 432, and video frame 433A displays... Figure 2G The image shown is frame D in video track 362. The electronic device can respond to a click operation on the opacity option 434A in the effects options bar 434, displaying as shown... Figure 3E The user interface shown is 44.

[0086] For example, user interface 44 is a user interface provided by a video editing application for adjusting the opacity of the image. User interface 44 may include an opacity slider 441. After a picture-in-picture is added to an electronic device, the default opacity of the added picture-in-picture is 100%, meaning the added picture-in-picture is completely opaque. Figure 3E As shown, the opacity slider 441 is displayed at 100%, meaning the opacity of the picture-in-picture 442A is 100%. The electronic device can respond to a press of the opacity slider 441. Figure 3E Slide the slider in the direction of the arrow shown to adjust the opacity of the picture-in-picture image 442A and display it as shown. Figure 3F User interface 45.

[0087] For example, the user interface 45 may also include an opacity slider 451, a cancel control 455, and a confirm control 456. The opacity slider 451 in the user interface 45 is displayed at 10%, meaning the opacity of the picture-in-picture (PiP) frame 452A is 10%. The PiP track 453 in the user interface 45 includes a keyframe 454 added for the D-th frame. It is worth noting that changing the opacity of the PiP frame 442A actually changes the parameters of the D-th PiP frame; this opacity change is equivalent to adding a keyframe to the D-th PiP frame. Figure 3F As shown, the opacity of the picture-in-picture 452A is reduced by 90% compared to the picture-in-picture 442A.

[0088] As can be seen from the above editing process, the electronic device changed the opacity of the picture-in-picture track and added two keyframes to the picture-in-picture track. Therefore, in addition to changing the opacity of frame D in the picture-in-picture track, it also changed the opacity of the frames between frames A and D in the picture-in-picture track.

[0089] Figure 3G-Figure 3J An example is shown of a user interface for an electronic device playing a video after the opacity of the image in the picture-in-picture track has been changed.

[0090] Electronic devices can respond to Figure 3F The click operation of control 456 is determined in the middle, which completes the change of the opacity of the picture-in-picture track, and displays as shown. Figure 3G The user interface 46 is shown. In the user interface 46, pointer 461 points to frame A in video track 462 and picture-in-picture track 463. No track is selected in the user interface 46. The electronic device can respond to a click operation on the playback control 464 and play the video, including video track 462 and picture-in-picture track 463, in the video preview area 465.

[0091] When the video reaches frame C, the electronic device can display something like this. Figure 3H The user interface 47 is shown. In user interface 47, pointer 471 points to frame C of video track 472 and picture-in-picture track 473. Video frame 474A displays frame C of video track 472, and picture-in-picture frame 474B displays frame C of picture-in-picture track 473. The opacity of picture-in-picture frame 474B is reduced by 30% compared to frame C of the picture-in-picture track whose opacity remains unchanged; that is, the opacity of picture-in-picture frame 474B is 70%.

[0092] When the video reaches frame E, the electronic device can display something like this. Figure 3I The user interface 48 is shown. In user interface 48, pointer 481 points to the E-frame of video track 482 and picture-in-picture track 483. Video frame 484A displays the E-frame of video track 482, and picture-in-picture frame 484B displays the E-frame of picture-in-picture track 483. The opacity of picture-in-picture frame 484B is reduced by 60% compared to the E-frame of the picture-in-picture track whose opacity remains unchanged; that is, the opacity of picture-in-picture frame 484B is 40%.

[0093] When the video reaches frame D, the electronic device can display something like this. Figure 3JThe user interface 49 is shown. In user interface 49, pointer 491 points to frame D in video track 492 and picture-in-picture track 493. Video frame 494A displays frame D of video track 492, and picture-in-picture frame 494B displays frame D of picture-in-picture track 493. The opacity of picture-in-picture frame 494B is reduced by 90% compared to frame E of the picture-in-picture track whose opacity remains unchanged; that is, the opacity of picture-in-picture frame 494B is 10%.

[0094] When the video plays to a frame after frame D, since the picture-in-picture track lasts for 3 seconds and there is no more picture-in-picture after frame D, the image displayed in the video preview area is the image of the video track, and it is rotated counterclockwise by c degrees relative to the image in the unrotated video.

[0095] As seen in the process of playing a video with altered opacity of the picture-in-picture track, the editing of different tracks is independent, and editing of added tracks can be based on editing of the video tracks. The electronic device processes the picture-in-picture track between two keyframes, generating an animation where the picture-in-picture track gradually becomes transparent. Furthermore, during playback of the edited video, the picture-in-picture can gradually become transparent while the video rotates smoothly, rather than suddenly becoming transparent when the video reaches the second keyframe.

[0096] Scenario 3: Adding a text track to the video track, editing the text track, and playing the edited video.

[0097] The aforementioned playback of edited videos can refer to playing videos that include edited text tracks and rotated video tracks.

[0098] Figures 4A-4F An example is shown of an electronic device that adds a text track and modifies the position of the picture-in-picture track.

[0099] Electronic devices can respond to Figure 2D Medium video track 331 Figure 2B The operation involves sliding in the opposite direction of the arrow shown in the image, as displayed. Figure 4A The user interface 50 shown. The electronic device can respond to a click operation on the text option 501A in the track option bar 501 to enter the user interface for selecting the added text track.

[0100] For example, user interface 51 is a user interface provided by a video editing application for adding text tracks. User interface 51 may include, but is not limited to: a text input box 511, a text effects option bar 512, an confirmation control 513, and various text template options 514. The electronic device may display user interface 51 in response to a click operation on template option 514A and the operation of entering the text "Hello" in the text input box 511.

[0101] For example, such as Figure 4B The video preview area 515 of the user interface 51 shown includes two parts: a video frame 515A and a text frame 515B. The video frame 515A can refer to a frame of the rotated video. The text frame 515B is the text "Hello" displayed within template 3. By default, the text frame added by the electronic device is centered and overlays the video frame. Optionally, the electronic device can also set the video frame to overlay the text frame; this is not limited. The user interface 51 can include a video track 516 and a text track 517. By default, the duration of the text track 517 added by the electronic device is 3 seconds. Optionally, the electronic device can also change the duration of the text track 517. The text track 517 includes left and right handles to indicate that the text track 517 is selected. The electronic device can respond to click operations on the confirmation controls to complete the addition of the text track and display the text as shown below. Figure 4C The user interface shown is 52.

[0102] The electronic device can respond to a click operation on the keyframe addition control 521, adding a keyframe 531 to the A-th frame of the text track 523 pointed to by the pointer 522, i.e., the text frame 524A, and displaying as shown. Figure 4D The user interface shown is 53.

[0103] For example, the text track 532 in the user interface 53 includes a keyframe 531 added for the A-th frame. The electronic device can respond to a press on the text track 532. Figure 4D The operation of sliding in the direction of the arrow shown in the image will display as follows: Figure 4E The user interface 54 is shown. In this embodiment, the above-described sliding operation on the text track 532 is only illustrative and may include other operations to change the screen pointed to by the pointer, which are not limited thereto.

[0104] For example, pointer 541 in user interface 54 refers to frame D of video track 542 and frame D of text track 543, and video frame 544A displays... Figure 2G The image shown is frame D in video track 362. The electronic device can respond to the text screen 544B. Figure 4ESlide the slider in the direction of the arrow shown to change the position of the text image 544B within the video preview area 544, and display as shown. Figure 4F The user interface 55 is shown. In this embodiment, the sliding operation of the text screen 544B is only illustrative and can include other operations to change the position of the text screen 544B, which are not limited thereto.

[0105] For example, the text track 551 in the user interface 55 includes a keyframe 552 added for the D-th frame. It is worth noting that changing the position of the text frame 544B in the video preview area 544 actually changes the parameters of the D-th frame text frame; this position change is equivalent to adding a keyframe for the D-th frame text frame. Figure 4F As shown, text screen 553A has shifted to the left by a distance of X1 relative to text screen 544B.

[0106] As can be seen from the above editing process, the electronic device changed the position of the text track and added two keyframes to the text track. Therefore, in addition to changing the position of frame D in the text track, it also changed the position of the images between frames A and D in the text track.

[0107] Figures 4G-4J An example is shown of the user interface of a video after an electronic device changes the position of the image in the text track.

[0108] Electronic devices can respond to Figure 4F Chinese character track 551 Figure 4D The swipe gesture in the direction of the middle arrow displays as follows: Figure 4G The user interface 56 is shown. In user interface 56, pointer 561 points to frame A in video track 562 and text track 563. No track is selected in user interface 56. The electronic device can respond to a click operation on the playback control 564 and play the video, including video track 562 and text track 563, in the video preview area 565.

[0109] When the video reaches frame C, the electronic device can display something like this. Figure 4H The user interface 57 is shown. In user interface 57, pointer 571 points to the C-th frame of video track 572 and text track 573. Video screen 574A displays the C-th frame of video track 572, and text screen 574B displays the C-th frame of text track 573. Text screen 574B is shifted to the left by a distance of X1 / 3 relative to the C-th frame of the unchanged text track.

[0110] When the video reaches frame E, the electronic device can display something like this. Figure 4I The user interface 58 is shown. In user interface 58, pointer 581 points to the E-th frame in both video track 582 and text track 583. Video screen 584A displays the E-th frame of video track 582, and text screen 584B displays the E-th frame of text track 583. Text screen 584B has shifted 2 x 1 / 3 of its position to the left relative to the E-th frame of the unchanged text track.

[0111] When the video reaches frame D, the electronic device can display something like this. Figure 4J The user interface 59 is shown. In user interface 59, pointer 591 points to the D-th frame in both video track 592 and text track 593. Video screen 594A displays the D-th frame of video track 592, and text screen 594B displays the D-th frame of text track 593. Text screen 594B has been moved to the left by a distance X1 relative to the D-th frame of the unchanged text track.

[0112] When the video plays to the scene after frame D, since the text track lasts for 3 seconds and there is no text after frame D, the scene displayed in the video preview area is the scene of the video track, and it is rotated counterclockwise by c degrees relative to the scene in the unrotated video.

[0113] As can be seen from the process of playing the video after changing the position of the text track, the editing of different tracks is independent, and the editing of the added track can be based on the editing of the video track. The electronic device performs corresponding processing on the text track between two keyframes, generating an animation in which the image of the text track gradually becomes transparent. Furthermore, during the playback of the edited video, the text can gradually move its position while the video rotates smoothly, rather than the text track suddenly moving a position when the video reaches the second keyframe.

[0114] Based on the above description of the process of editing and playing the edited video in various scenarios using the user interface, the following is a flowchart illustrating the video editing method provided in this application embodiment.

[0115] Figure 5 An exemplary flowchart of a video editing method is shown. Wherein, Figure 5 The method shown is based on editing a single track, that is, editing a single track, namely the video track.

[0116] like Figure 5 As shown, the method includes:

[0117] S501. Display a first user interface, which includes a first track and displays multiple frames of a first video.

[0118] The aforementioned first user interface can refer to a user interface in an electronic device used for editing 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, and there is no limitation on this. Furthermore, there is no limitation on the name of the application to which the first user interface belongs. The aforementioned first track displays multiple frames of the first video. The first video can refer to a video stored in the electronic device or a video captured by the electronic device.

[0119] 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.

[0120] In some implementations, the first user interface may also include a video preview area. Specifically, the electronic device can play the first video in the video preview area, or it can edit the first video in the video preview area. 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 the video preview area of ​​the first user interface, or it can edit a single frame of the first video displayed in the video preview area.

[0121] In some implementations, the electronic device can change a frame of the first video displayed in the video preview area in response to user input. For example, in addition to the video preview area, the first user interface may also include a fixed pointer. The length of the first track can represent the duration of the first video, the position of the first track pointed to by the pointer represents a point in time (i.e., moment) in the first video, and the video preview area displays a frame of the first video at that moment. The electronic device can change the position of the pointer on the first track in response to a sliding operation applied to the first track, thus changing the frame of the first video displayed in the video preview area.

[0122] For example, the first user interface may refer to Figure 2A The user interface 30 shown. The video preview area in the first user interface can refer to Figure 2AThe video preview area 304 is shown. The first track can refer to video track 303, and the fixed pointer can refer to pointer 302. The first video can refer to... Figure 1B The video corresponding to the video control 214 shown. In this embodiment, the content included in the first user interface described above is only illustrative and may include more or less content.

[0123] S502, Detect the operation of adding a keyframe for the first moment of the first video, and obtain the first parameters of the first moment of the image. The first parameters may include, but are not limited to, parameters such as the display position, size, rotation angle and opacity of the first moment of the image.

[0124] In some implementations, the first user interface may display the frame of the first moment in the first video before the electronic device detects the operation of adding a keyframe for the first moment of the first video. For example, the electronic device may perform a sliding operation on the first track to change the position of the pointer on the first track, causing the pointer to point to the position of the first moment on the first track. The electronic device can then display the frame of the first moment in the first video in the video preview area. Furthermore, the video track has been selected by the electronic device at this time. In this embodiment, the operation that causes the frame of the first moment in the first video to be displayed in the first user interface is not limited.

[0125] In some implementations, the electronic device can only add keyframes for the first moment of the first video after the first track has been selected.

[0126] The "first moment" mentioned above can refer to any frame in the first video. However, since subsequent frames after the first moment will be edited, the "first moment" here generally does not refer to the last frame of the first video.

[0127] The aforementioned addition of a keyframe at the first moment of the first video can refer to adding a marker to the first moment of the first video. After the electronic device detects the keyframe addition operation, it can not only display the marker of the first keyframe at the position of the first moment on the first track, but also store the timestamp information of the first keyframe. For example, if the first moment is 2.5 seconds, the timestamp information of the first keyframe is 2500ms.

[0128] The function of a keyframe is to enable electronic devices to perform segmented editing of video. Generally, when a video contains only one keyframe, all frames in that video will have the same effect, making it impossible to generate keyframe animation. In other words, a keyframe is invalid. The uses of two or more keyframes are not discussed here; please refer to the relevant description in S503 below.

[0129] In some implementations, the electronic device can obtain the specific content displayed in the first moment of the image, and it can also obtain the first parameters of the first moment of the image. The first parameter can refer to parameters used to describe the first moment of the image, such as the position, size, rotation angle, and opacity of the first moment of the image, etc.

[0130] In some implementations, this first parameter can be used to indicate the effect of the image at the first moment.

[0131] 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.

[0132] 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 "-", and a positive x-axis or y-axis movement by "+". 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 "-", and a clockwise rotation by "+". 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.

[0133] 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.

[0134] For example, when the first moment of the screen displayed by the electronic device is the default, that is, when the electronic device does not edit the first moment of the screen, the display position of the first moment of the screen can be represented as (0px, 0px), the size of the first moment of the screen can be represented as 1, the rotation degree of the first moment of the screen can be represented as 0°, and the opacity of the first moment of the screen can be represented as 100.

[0135] In some implementations, image parameters can be used to describe the image's effect.

[0136] In one possible implementation, the electronic device can edit the image of the first moment before detecting an operation to add a keyframe for the first moment of the first video. The electronic device can acquire various parameters describing the image of the first moment after the editing process. In this case, the various parameters describing the image of the first moment after the editing process can be referred to as the first parameter. The editing process may include, but is not limited to: rotating the image, scaling the image, changing the display position of the image, changing the opacity of the image, etc. For details on this editing process, please refer to the relevant description in S503, which will not be described here.

[0137] In another possible implementation, the electronic device can edit the first moment's image after detecting the addition of a keyframe to the first moment of the first video. The electronic device then acquires various parameters describing the edited first moment's image. Similarly, in this case, the various parameters describing the edited first moment's image can be referred to as the first parameters.

[0138] For example, the operation of adding a keyframe described above can refer to acting on... Figure 2A Adding a click operation to control 301 in the keyframe of the video, the first moment of the video can refer to... Figure 2A The image displayed in the video preview area 304.

[0139] S503: Detect an operation to edit the second moment of the first video, and obtain the second parameters of the edited second moment of the image. The second parameters may include, but are not limited to, parameters such as the display position, size, rotation angle, and opacity of the edited second moment of the image.

[0140] In some implementations, before the electronic device detects an editing operation on the second moment of the first video, the first user interface can switch from displaying the first moment of the first video to displaying the second moment of the first video. For example, the electronic device can perform a sliding operation on the first track, changing the position of the pointer on the first track, causing the pointer to switch from pointing to the first moment of the first track to pointing to the second moment of the first track. Then, the electronic device can display the second moment of the first video in the video preview area. Furthermore, the electronic device has already selected the first track. In this embodiment, the operation that causes the second moment of the first video to be displayed in the first user interface is not limited.

[0141] The aforementioned second moment can refer to any frame in the first video that is different from the first moment. Furthermore, this second moment can refer to the last frame of the first video. Specifically, the second moment can be located before or after the first moment. Figure 5 The flowchart shown illustrates the video editing method using the example of the second moment occurring after the first moment.

[0142] The above-mentioned editing operations on the second moment of the first video can include two situations:

[0143] Scenario 1: The electronic device directly edits the image at the second moment, and then the electronic device can display the second keyframe at the second moment in the first track. This editing process includes one or more of the following: rotating the image, scaling the image, changing the display position of the image, changing the opacity of the image, etc.

[0144] Scenario 2: In response to the operation of adding a keyframe at the second moment of the first video, after the electronic device displays the second keyframe at the second moment in the first track, the electronic device then edits the image at the second moment.

[0145] The following section details how to edit the image.

[0146] For example, when an electronic device displays a second moment's image in the video preview area of ​​a first user interface, the electronic device can rotate the second moment's image. For instance, in response to a two-finger long press and simultaneous counter-clockwise or clockwise rotation of the two fingers on the second moment's image displayed in the video preview area, the electronic device can rotate the second moment's image around its midpoint by a certain degree. For example, this image rotation operation can be described by referring to... Figure 2C The operation shown.

[0147] The electronic device can also move the display position of the second moment's image. For example, in response to a long press and a swipe in either direction on the video preview area displaying the second moment's image, the electronic device can move the second moment's image a certain position in the direction of the swipe. For example, this operation of changing the image position can refer to... Figure 4E The operation shown.

[0148] The electronic device can also zoom in and out of the second moment's image. For example, the electronic device can zoom in or out of the second moment's image in response to a two-finger press on the video preview area displaying the second moment's image, with one finger moving in one direction and the other in the opposite direction. For example, this zooming operation of the second moment's image can be referenced... Figure 2I The operation shown.

[0149] Electronic devices can also change the opacity of the image at a second moment.

[0150] In this application embodiment, the editing of the screen is not limited to the above-mentioned types, but may include more types of editing processes, and the operation to implement the above-mentioned types of editing processes is not limited.

[0151] In this embodiment, the electronic device can perform one or more types of editing on the image at the second moment. Furthermore, the effects of multiple types of editing can be combined.

[0152] In some implementations, after detecting an editing operation on the second moment of the first video, the electronic device can not only display a marker for the second keyframe at the second moment of the first track, but also store the timestamp information of that second keyframe. For example, if the second moment is 7.5 seconds, the timestamp information of the second keyframe is 7500ms.

[0153] In addition, similarly, electronic devices can also acquire the specific content displayed in the second moment of the image before editing, as well as second parameters of the second moment of the image after editing. These second parameters can refer to parameters describing the second moment of the image after editing, such as the position, size, rotation angle, and opacity of the second moment of the image. In some implementations, these second parameters can be used to indicate the effect of the second moment of the image in the edited first video.

[0154] For example, the expression of the second parameter can be referred to the relevant description in S502 above, and will not be repeated here.

[0155] For example, the above-mentioned editing operation can refer to acting on Figure 2C as well as Figure 2I In the editing operations, the second moment of the first video can refer to... Figure 2C The image displayed in the video preview area 323, the edited second-moment image, can refer to... Figure 2D The image displayed in the video preview area 333.

[0156] S504. Obtain the parameters of each frame in the second video according to the first parameter and the second parameter, and generate the second video based on the obtained parameters of each frame. The second video is the first video after editing.

[0157] In some implementations, the various frames included in the second video can be divided into three categories: multiple frames before the first moment, multiple frames between the first and second moments, and multiple frames after the second moment. The parameters of the frames at the first moment in the second video can refer to a first parameter, and the parameters of the frames at the second moment can refer to a second parameter. Furthermore, the parameters of the multiple frames before the first moment are consistent with the first parameter, and the parameters of the multiple frames after the second moment are consistent with the second parameter. Therefore, it is evident that the electronic device also needs to obtain the parameters of the multiple frames between the first and second moments to generate the second video.

[0158] In some implementations, after acquiring the second parameter of the image at the second moment after editing, the electronic device can acquire parameters of multiple images between the first and second moments after editing. Since the first parameter includes parameters describing the image at the first keyframe, and the second parameter includes parameters describing the image at the second keyframe, acquiring parameters of multiple images based on the first and second parameters can be understood as acquiring parameters of multiple images based on the time information of the first and second keyframes, the time information of the second keyframe, and the first and second parameters.

[0159] The following is combined Figure 6 This section introduces the calculation rules for obtaining parameters from multiple frames between the first and second moments.

[0160] For example, such as Figure 6 As shown, the second video is 10 seconds long. The first keyframe (M1) is located at 1 second, and the second keyframe (M2) is located at 9 seconds. From the above, it can be seen that the parameters of multiple frames between 0 and 1 second in the second video are all the first parameters. The parameters of multiple frames between 9 and 10 seconds in the second video are all the second parameters. For example, suppose the position parameter in the first parameter is (0px, 0px), the size parameter is 1, the rotation angle parameter is 0°, and the opacity parameter is 100; and the position parameter in the second parameter is (120px, 160px), the size parameter is 2.2, the rotation angle parameter is +160°, and the opacity parameter is 20.

[0161] In some implementations, the parameters of multiple frames between the first and second moments are actually the parameter information of the Y point. For example, the electronic device can obtain the Y parameter information according to the following formula.

[0162] P1 = (MY - M1) / (M2 - M1);

[0163] CY = (C2 - C1) * P1 + C1;

[0164] Where P1 represents the proportion of point Y between the first and second moments, MY represents the moment at which point Y is located, M1 represents the first moment, M2 represents the second moment, CY represents the parameters of point Y, C1 represents the parameters of the first moment, and C2 represents the parameters of the second moment.

[0165] For example, such as Figure 6 As shown, point Y is located at the 3rd second. Based on the two formulas above, we can obtain:

[0166] The proportion P1 = (3-1) / (9-1) = 0.25;

[0167] The position parameter of point Y, CY1 = ((120px, 160px) - (0px, 0px)) * 0.25 + (0px, 0px) = (30px, 40px);

[0168] The size parameter of point Y, CY2 = (2.2-1)*0.25+1 = 1.3;

[0169] The rotation parameter CY3 of point Y = (+160°-0°)*0.25+0° = 40°;

[0170] The rotation parameter of point Y, CY4, is (100-20)*0.25+20=40.

[0171] In some implementations, the electronic device can obtain parameters of multiple frames in the second video between the first and second moments using the two formulas described above. Since the electronic device stores the specific content displayed in each frame before editing, it can generate the second video based on the parameters and content displayed in each frame of the second video obtained above.

[0172] In one possible implementation, the electronic device can generate the aforementioned second video when the edited second screen is displayed in the first user interface. Alternatively, the electronic device can generate the aforementioned second video after the edited second screen has been displayed in the first user interface. For example, in step S505, before playing each frame of the second video, the electronic device can calculate the parameters of the frame to be played in real time according to the two formulas mentioned above, generate the frame to be played based on the specific content displayed in the frame and the parameters, and then render and display the frame on the screen.

[0173] Optionally, the electronic device may save the generated second video in the electronic device. For example, the electronic device may respond to actions such as... Figure 2D The export control shown stores the edited video on the electronic device. Optionally, the electronic device can also replace the original first video with the generated second video.

[0174] In one possible implementation, a video may contain not just two keyframes, but more than two. In this case, the electronic device can also use the two formulas mentioned above to calculate the parameters of the frame between each pair of keyframes, which will not be elaborated further.

[0175] In one possible implementation, the calculation rule for obtaining parameters of multiple frames between the first and second moments is such that the multiple frames can change smoothly and uniformly. It can also be implemented based on other formulas, such as calculation rules that allow the multiple frames to change smoothly but not uniformly.

[0176] S505, Play the second video.

[0177] In some implementations, after the electronic device generates the second video, the first track included in the first user interface can display multiple frames from the second video, and the electronic device can play the second video within the first user interface. Specifically, the electronic device can start playing the second video from the beginning or from a specific frame. For example, the electronic device can respond to a sliding operation on the first track, changing the position of the first track indicated by the pointer, i.e., changing the starting position for playing the second video. As another example, the electronic device can play the second video by sliding the first track within the 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 first track... Figure 2E Clicking the playback control 343 in the middle will play the second video.

[0178] In other implementations, the electronic device can also play a second video stored on the device within a gallery. Similarly, the electronic device can start playing the second video from the beginning or from a specific frame. For example, the electronic device can respond to a click on a control related to the second video in the gallery, enter a user interface displaying the second video in full screen, and then respond to a click on the playback control to play the second video.

[0179] For example, the user interface for playing a second video on an electronic device can refer to Figures 2E-2H The user interface shown.

[0180] From the above Figure 5As shown in the process, electronic devices can add keyframes to videos, edit one or more frames, and generate parameters for multiple frames between any two keyframes based on the two formulas mentioned above. This results in a smoother, more gradual transition between rotations, scaling, positional shifts, and changes in opacity during playback, providing a better viewing experience for the user.

[0181] In one possible implementation, the video editing method provided in this application embodiment is not limited to the method of adding two keyframes to a video as described above. It can also add multiple keyframes to a video. The electronic device generates keyframe animations between every two adjacent keyframes; that is, the effect of the images between every two adjacent keyframe frames can refer to the above. Figure 5 The methods shown will not be elaborated upon here.

[0182] Based on the flowchart shown above, the following is a flowchart illustrating the video editing method provided in the embodiments of this application.

[0183] Figure 7 This example illustrates the workflow of another video editing method. In this example, Figure 7 The method shown is based on editing a video that includes multiple source tracks. In this embodiment, the editing process for different tracks can be different, and editing one track will not affect another track.

[0184] like Figure 7 As shown, the method includes:

[0185] S701, Display a first user interface, the first user interface including a first track, the first track displaying multiple frames of a first video.

[0186] The aforementioned first user interface can refer to a user interface in an electronic device used for editing videos. 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, and there is no limitation on this. Furthermore, there is no limitation on the name of the application to which the first user interface belongs. The aforementioned first video can refer to a video stored in an electronic device or a video captured by the electronic device.

[0187] 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 video in a gallery application to enter the first user interface. Similarly, the first user interface may also include a video preview area and a fixed pointer.

[0188] In some implementations, since different media tracks will be added later, the video track will be referred to as the first track to distinguish it. Here, the video track can refer to the unprocessed main video footage stored on the electronic device, for example... Figure 5 The first video in the series, Figure 6 Take the display of multiple frames of the first video on the first track as an example.

[0189] In another implementation, the first track can also be used to represent video footage after editing, for example... Figure 5 The second video. In this embodiment, editing of one track will not affect subsequent editing of another track. Therefore, whether the video displayed on the first track has been edited will not affect subsequent editing of the second track.

[0190] For example, the first user interface may refer to Figure 3A The user interface 40 shown. The first track may refer to... Figure 3B The video track 412 shown is shown.

[0191] S702. In response to user input, add a second track, which displays multiple frames of the first source material. This second track may include, but is not limited to, picture-in-picture, text, sticker, and other tracks.

[0192] In some implementations, after the first track is displayed on the electronic device, a second track can be added. The electronic device can add one or more second tracks. The second track displays multiple frames of the first source material.

[0193] In this embodiment, the electronic device does not limit the relative position of the second track and the first track. The second track can be located above or below the first track. That is, the second track can partially or completely cover the first track, or be partially or completely covered by the first track. The electronic device also does not limit the duration of the second track; the duration of the second track can be longer or shorter than the duration of the first track. The electronic device also does not limit the starting position of the second track; the starting position of the second track can be before or after the starting position of the first track. It is worth noting that the various parameters of the second track's image (e.g., position, size, rotation angle, and opacity) added by the electronic device are related to... Figure 5 The first video shown has the same default parameters.

[0194] For example, by default, the electronic device adds a second track that covers the first track, the second track has a duration of 3 seconds, and the second track starts at the same position as the first track. The electronic device can change these default settings. For instance, it can respond to user input by having the first track cover the second track, change the duration of the second track, or change the starting position of the second track.

[0195] In some implementations, the electronic device can add one or more second tracks. Figure 6 The method flow shown uses adding a second track as an example. Since different tracks do not affect each other, the method flow based on multiple second tracks can be found by referring to [the example provided]. Figure 7 The method flow is shown.

[0196] The second track mentioned above can refer to various types of media tracks other than the video track. Specifically, these various types of media can include, but are not limited to, picture-in-picture, text, stickers, etc. Picture-in-picture media can refer to multiple static frames or multiple dynamic frames. Furthermore, picture-in-picture media can create a picture-in-picture effect with the main video. Text media can refer to images displaying text content containing a template, or it can refer to static or dynamic images. Sticker media can refer to images used for decoration to enrich the display, or it can refer to static or dynamic images. For example, the image of a picture-in-picture track can be referenced above. Figure 3B The picture-in-picture view shown is 411B. The text track view can be referenced above. Figure 4B The text shown is 515B.

[0197] In some implementations, adding a text track requires the user to input text information, for example, the user inputs the text "Hello".

[0198] In this application embodiment, the above-mentioned tracks are only illustrative examples, and more types of material tracks may also be included.

[0199] For example, the user operation described above for adding a second track can refer to the action performed on... Figure 3A The click operation of the picture-in-picture option 401A in the image can also refer to the action performed on the... Figure 4A Clicking on the Chinese character option 501A.

[0200] The aforementioned second track can refer to Figure 3B The picture-in-picture track 413 in the image can also refer to... Figure 4B The text track is 417.

[0201] S703: Detect the operation of adding a keyframe for the third moment of the first material, and obtain the third parameter of the image of the third moment of the first material. The third parameter may include, but is not limited to, parameters such as the display position, size, rotation angle and opacity of the image of the third moment of the first material.

[0202] In some implementations, when the electronic device detects an operation to add a keyframe for a third moment on the second track, the first user interface can display the image of the third moment on the second track. For example, the electronic device can perform a sliding operation on the second track, changing the position of the pointer on the second track so that the pointer points to the third moment on the second track. The electronic device can then display the image of the third moment on the second track in the video preview area. Furthermore, the electronic device has already selected the second track at this time. It is worth noting that a keyframe can only be added for a specific moment on the second track after it has been selected. In this embodiment, the operation that causes the first user interface to display the image of the third moment on the second track is not limited.

[0203] The aforementioned "third moment" can refer to any frame in the second track. However, since subsequent editing will be performed on a frame after the "third moment," the "third moment" here generally does not refer to the last frame of the second track.

[0204] Adding a keyframe at the third moment can refer to adding a marker to the third moment of the second track. After the electronic device detects the keyframe addition operation, it can not only display the first keyframe marker at the third moment position of the second track, but also store the timestamp information of the first keyframe. For example, if the third moment is 2.5 seconds, the timestamp information of the first keyframe is 2500ms.

[0205] In some implementations, the electronic device can obtain the specific content displayed on the screen at the third moment of the second track, and can also obtain third parameters of the screen at the third moment of the second track. These third parameters can refer to parameters describing the screen at the third moment of the second track, such as the display position, size, rotation angle, and opacity of the screen at the third moment of the second track. For a detailed introduction to the various parameters used to describe the screen, please refer to the above. Figure 5 The relevant descriptions in S502 are not repeated here.

[0206] In some implementations, the third parameter can be used to indicate the effect of the image at the third moment of the first material, and the effect of the image at the third moment of the second track can be referred to as the first effect.

[0207] Similarly, in one possible implementation, the electronic device can edit the image of the third moment before detecting the addition of a keyframe for the third moment of the second track.

[0208] Similarly, in another possible implementation, the electronic device can edit the image at the third moment after detecting the addition of a keyframe for the third moment of the second track. The various parameters used to describe the image at the third moment after editing can be referred to as the third parameters.

[0209] For example, the operation of adding a keyframe described above can refer to acting on... Figure 3B Adding a click operation to control 414 in the keyframe, the third moment of the first footage can refer to... Figure 3B The picture-in-picture screen 411B displayed in the video preview area 411.

[0210] S704: An operation to edit the fourth moment of the first material is detected, and the fourth parameter of the fourth moment of the first material after editing is obtained. The fourth parameter may include parameters such as the display position, size, rotation angle and opacity of the fourth moment of the first material after editing.

[0211] Step S704 is similar to S503. For a detailed description of S704, please refer to the relevant description in S503 above. It will not be repeated here.

[0212] For example, the above-mentioned editing operation can refer to acting on Figure 3E The sliding operation of the opacity slider 441 in the image, the fourth moment of the first footage can refer to... Figure 3E The image in the middle-screen format, frame 442B, refers to the fourth frame of the first source material after editing. Figure 3F In-picture mode 452A.

[0213] S705. Obtain the parameters of each frame in the second material according to the third and fourth parameters, and generate the second material based on the obtained parameters of each frame. The second material is the first material after editing.

[0214] Step S705 is similar to S504. For a detailed description of S705, please refer to the relevant description in S504 above. It will not be repeated here.

[0215] S706: Responding to the video playback operation, play a video containing a first video and a second source material.

[0216] In some implementations, after the electronic device generates the second material, it can respond to user input and play a video containing both the first and second materials. The electronic device can play the video in a first user interface or in a gallery. For a detailed description of video playback, please refer to the relevant description in S505 above; it will not be repeated here.

[0217] It is worth noting that since the starting position of the second material may be the same as or different from the starting position of the first video, the video playback will differ from that in S505 above.

[0218] For example, the first video is 10 seconds long, the second clip is 3 seconds long, and the second clip starts before the first video, for example, 2 seconds before the first video. The total duration of the video played by the electronic device is 12 seconds. The electronic device plays the 0s-2s footage of the second clip between 0s and 2s after the start, plays the superimposed footage of the 2s-3s footage of the second clip and the 0s-1s footage of the first track between 2s and 3s, and plays the 1s-10s footage of the first video between 3s and 12s.

[0219] In one possible implementation, after the electronic device generates the second material, it can replace the template in the second material, and the second material after template replacement still includes the aforementioned third and fourth keyframes. For example, when the electronic device selects... Figure 4B After template 3514A, the generated template is as follows: Figures 4G-4J After the second material shown, the electronic device can select text option 501A again to replace the module of the second material. Figure 4B In template 4, the content of the second material after replacement changes with the template, but the effect of the second material after replacement is the same as the effect of the second material before replacement.

[0220] From the above Figure 6 As shown in the flowchart, the electronic device can add various media tracks and keyframes to these tracks. It can also edit one or more frames within a media track and generate parameters for multiple frames between any two keyframes based on the two formulas mentioned above. Thus, during playback of the edited video, the electronic device can observe that the changes between different tracks are independent, and the media tracks smoothly and gradually undergo rotation, scaling, position shifting, opacity changes, etc., resulting in a better user experience.

[0221] Next, combined Figure 8 as well as Figure 9 Let's introduce the previous text Figure 5 as well as Figure 7 The method flow in the diagram corresponds to the operating system (OS) interaction diagram of the electronic device.

[0222] Figure 8 as well as Figure 9 The user operation module, data control module, data storage module, and data rendering module shown are modules included in the electronic device for managing and editing the images in the video. 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.

[0223] like Figure 8 As shown, the OS interaction of the editing method based on a video containing only a single track provided in this application embodiment includes the following steps:

[0224] S801, the user operation module detects operations that add keyframes at the first moment.

[0225] In some implementations, the user operation module can obtain the first parameters of the frame at the first moment after detecting the operation of adding a keyframe for the first moment of the first video. For example, the user operation module can detect a click operation for adding a keyframe. For a detailed description of S801, please refer to the above-described S502.

[0226] Optionally, prior to S801, the user operation module could also detect editing operations on the first moment's image and obtain the first parameters of the edited first moment's image.

[0227] S802, The user operation module sends the first parameters of the first moment's screen to the data storage layer in the data storage module.

[0228] In some implementations, after obtaining the first parameter, the user operation module can send it to the data storage layer in the data storage module via the data control module and the data transmission layer in the data storage module. For example, the data control module can pass the first parameter to the data storage layer using the `setKeyFrameParams()` method.

[0229] S803, the data storage layer stores the first parameter.

[0230] In some implementations, the data storage layer stores the first parameter in the material data class via a data visitor. For example, other modules in the electronic device can retrieve the first parameter at the first moment from the data storage layer using the identifier of the first video and the timestamp of the keyframe. Optionally, the material data class may also store the content of the first moment's footage.

[0231] When the user operation module detects that the first parameter is inconsistent with the default parameter in the first video, it can execute S804 and S805.

[0232] Optionally, S804, the data storage layer sends the first parameter to the Animation in the data rendering module.

[0233] In some implementations, the data storage layer can send the first parameter and the content of the first frame to the Animation via the data rendering layer. For example, the data rendering layer can send the first parameter to the Animation using setTransformParam().

[0234] Optionally, S805 and Animation can render and generate the first moment of the second video based on the first parameter.

[0235] In some implementations, Animation can render and generate the edited first moment's image based on the first parameter and the content of the first moment's image.

[0236] S806, The user operation module detects operations that edit the screen at the second moment.

[0237] In some implementations, the user operation module can obtain the second parameter of the image at the second moment after the editing operation is detected. The aforementioned editing operation at the second moment of the first video is equivalent to adding a keyframe to the second moment. For example, the user operation module can detect the editing operation on the image at the second moment. For a detailed description of S806, please refer to the above-described S503.

[0238] S807, The user operation module sends the second parameter of the second moment's image to the data storage layer.

[0239] In some implementations, after the user operation module obtains the second parameter, it can send it to the data storage layer via the data control module and the data transmission layer.

[0240] S808, the data storage layer stores the second parameter.

[0241] In some implementations, the data storage layer stores the second parameter in the media data class via data listening. For example, other modules in the electronic device can read the second parameter at the second moment from the data storage layer using the identifier of the first video and the timestamp of the keyframe. Optionally, the media data class may also store the content of the footage at the second moment.

[0242] S809, The data storage layer sends the second parameter to Animation.

[0243] In some implementations, the data storage layer can send the second parameter and the content of the second moment's image to the Animation layer via the data rendering layer.

[0244] S810 and Animation render the second moment of the second video based on the second parameter.

[0245] In some implementations, Animation can render and generate an edited version of the second moment's image based on the second parameter and the content of the second moment's image.

[0246] S811, the user operation module detects video playback operations.

[0247] For example, the user operation module can detect click operations on the playback control. For a detailed description of S811, please refer to the above-described S505.

[0248] S812, The user operation module sends an instruction message for playing the second video to the data rendering layer.

[0249] S813, the data rendering layer determines whether the operation in S806 is valid based on the first parameter and the second parameter.

[0250] The term "effective" actually refers to the inconsistency between the first and second parameters. This means that effective editing processing was performed on the first video. This is because a video containing only one keyframe for a given period is not functional. To generate automatically edited multi-frame footage by having the user edit one or two frames, the video needs to contain two or more keyframes.

[0251] S814, 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.

[0252] 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.

[0253] S815, the keyframe data processing layer determines whether the Nth frame is within the first and second time points, and obtains the parameters of the Nth frame in the second video based on the first and second parameters.

[0254] 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.

[0255] S816, the keyframe data processing layer sends the parameter information of the Nth frame of the second video to the data storage layer.

[0256] S817, The data storage layer stores the parameters of the Nth frame in the second video.

[0257] 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 when the second video is played again, it can be read directly without executing S815.

[0258] S818, The data storage layer sends the parameters of the Nth frame in the second video to Animation.

[0259] In some implementations, the data storage layer can send the content of the Nth frame of the second video and the second moment's frame to Animation via the data rendering layer.

[0260] S819, Animation, draws the Nth frame of the second video based on the parameters of the Nth frame in the second video.

[0261] 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.

[0262] Repeat steps S814-S819 until the second video finishes playing.

[0263] like Figure 9 As shown, the OS interaction of the video editing method based on multiple tracks provided in this application embodiment includes the following steps:

[0264] S901, The user operation module detects the addition of a second track, which displays multiple frames of the first material.

[0265] S902, The user operation module sends the material identification information of the first material in the data storage layer of the data storage module.

[0266] In some implementations, the data storage layer stores various materials with material identifiers. For example, Figure 4B Template 3 514A has unique material identifiers that distinguish it from other templates and other material types.

[0267] It is worth noting that when user input is required to generate materials, the user operation module also needs to send the user's input information to the data storage layer. For example, the user's input text "Hello" will also be sent to Animation along with the default parameters of the first material.

[0268] S903, The data storage layer determines the default parameters of the first material based on the material identifier information of the first material.

[0269] S904, The data storage layer sends the default parameters of the first material to the Animation in the data rendering module.

[0270] S905 and Animation render a single frame of the first source material based on default parameters.

[0271] S906, The user operation module detects the operation of adding a keyframe at the third moment of the first material.

[0272] S907, The user operation module sends the third parameter of the third moment's image to the data storage layer.

[0273] S908, the data storage layer stores the third parameter.

[0274] Optionally, S909, the data storage layer sends a third parameter to Animation.

[0275] Optionally, S910 and Animation can render and generate the third moment of the second material based on the third parameter.

[0276] S911, The user operation module detects the editing operation performed on the fourth moment of the first material.

[0277] S912, The user operation module sends the fourth parameter of the fourth moment's image to the data storage layer.

[0278] S913, the data storage layer stores the fourth parameter.

[0279] S914, The data storage layer sends the fourth parameter to Animation.

[0280] S915 and Animation render the fourth moment of the second material based on the fourth parameter.

[0281] S916, User operation module detects video playback operations.

[0282] S917, The user operation module sends an instruction to the data rendering layer to play a video containing the first video and the second material.

[0283] S918, the data rendering layer determines whether the operation in S911 is valid based on the third and fourth parameters.

[0284] S919, The data rendering layer sends instruction information for calculating the parameters of the Nth frame in the second material to the keyframe data processing layer in the data storage module.

[0285] S920, the keyframe data processing layer determines whether the Nth frame is within the third and fourth time points, and obtains the parameters of the Nth frame in the second material based on the third and fourth parameters.

[0286] S921, the keyframe data processing layer sends the parameter information of the Nth frame in the second material to the data storage layer.

[0287] S922, the data storage layer stores the parameters of the Nth frame in the second material.

[0288] S923, The data storage layer sends the parameters of the Nth frame in the second material to Animation.

[0289] S924, Animation, draws the Nth frame of the second material based on the parameters of the Nth frame in the second material.

[0290] Repeat steps S919-S924 until the video containing the first video and the second material has finished playing.

[0291] It is worth noting that S919-S924 above is used to generate the second material, and the video played by the electronic device includes the first video and the second material. Therefore, when the video played by the electronic device includes both the second video and the second material, S814-S819 are executed simultaneously during the execution of S919-S924 above.

[0292] Based on the above description of the process method, the following is a schematic diagram of the structure of the electronic device provided in the embodiments of this application.

[0293] Figure 10 A schematic diagram of the structure of the electronic device 100 is shown.

[0294] Electronic device 100 may be equipped with Alternatively, it can be a portable terminal device with 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 embodiment does not impose any special limitations on the specific type of electronic device.

[0295] 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.

[0296] 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.

[0297] 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.

[0298] 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.

[0299] 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.

[0300] 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.

[0301] 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.

[0302] 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.

[0303] 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.

[0304] 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.

[0305] 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.

[0306] 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.

[0307] 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.

[0308] 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.

[0309] 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.

[0310] 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.

[0311] 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.

[0312] 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.

[0313] 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.

[0314] 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.

[0315] 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).

[0316] 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.

[0317] 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.

[0318] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0319] 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.

[0320] 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.

[0321] 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.

[0322] 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.

[0323] 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 enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0324] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).

[0325] 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.

[0326] 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.

[0327] 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.

[0328] 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.

[0329] 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.

[0330] 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.

[0331] 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.

[0332] 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.

[0333] 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.

[0334] 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.

[0335] 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.

[0336] 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.

[0337] 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.

[0338] 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.

[0339] 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.

[0340] 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.

[0341] 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.

[0342] 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.

[0343] 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.

[0344] 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.

[0345] 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.

[0346] 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.

[0347] 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.

[0348] 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.

[0349] 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.

[0350] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0351] 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.

[0352] 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.

[0353] Figure 11 This is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0354] 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.

[0355] The application layer can include a series of application packages.

[0356] like Figure 11 As shown, the application package can 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.

[0357] Specifically, the user operation module is used to receive various user operations, such as detecting the addition of keyframes, detecting playback operations, and so on.

[0358] The data control module is used to convert user operations into data that can be transmitted between various modules.

[0359] 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 sent by 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 the data sent to the data storage layer, while the material data class stores parameters and content information for various frames, 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 parameters and sends these parameters to the data rendering module.

[0360] 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.

[0361] 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.

[0362] like Figure 11 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0363] 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.

[0364] 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.

[0365] 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.

[0366] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0367] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0368] 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.

[0369] 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.

[0370] 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.

[0371] 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.

[0372] 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.

[0373] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0374] 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.

[0375] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0376] A 2D graphics engine is a graphics engine for 2D drawing.

[0377] 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.

[0378] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 100.

[0379] 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.

[0380] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.

[0381] 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)).

[0382] 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.

[0383] 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, a second track, and a pointer with a fixed position. The first track displays multiple frames of the first video, the second track displays multiple frames of the first material, and the preview area displays the first frame of the first track pointed to by the pointer and the second frame of the second track pointed to by the pointer. Each frame of the first material is presented as a first effect. The operation to select the second track has been received; The operation to add a keyframe at the moment when the first material is presented as the second image is received; Upon receiving a left swipe operation on the second track, the first track and the second track are moved to the left, and a third view of the first track after the pointer has moved to the left and a fourth view of the second track after the pointer has moved to the left are displayed in the preview area. Upon receiving an editing operation applied to the fourth screen in the preview area, the effect of the fourth screen in the preview area is adjusted to the second effect; Upon receiving a right swipe operation on the second track, the first track and the second track are moved to the right, and the fifth screen of the first track after the pointer has moved to the right and the sixth screen of the second track after the pointer has moved to the right are displayed in the preview area. Upon receiving a playback command, the first video is played starting from the fifth screen in the preview area, and the second material is played starting from the sixth screen. The second material includes various screens of the first material. In the second material, multiple screens before the second screen are presented with the first effect, multiple screens from the second screen to the fourth screen gradually transition from the first effect to the second effect, and multiple screens after the fourth screen are presented with the second effect.

2. The method according to claim 1, characterized in that, The second track is a picture-in-picture track, and the first material is a video containing multiple frames. In the preview area, the first material is displayed in picture-in-picture format within the first video; or The second track is a text track, and the first material is a video containing multiple frames of text; or The second track is the sticker track, and the first material is a video containing multiple frames of sticker images.

3. The method according to claim 1 or 2, 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.

4. The method according to claim 1 or 2, characterized in that, After receiving the operation of adding a keyframe at the moment when the second image is presented to the first material, the method further includes: displaying a first identifier at the position of the second track pointed to by the pointer; After receiving an editing operation applied to the fourth screen in the preview area, the method further includes displaying a second identifier at the position of the second track after the pointer has shifted to the left.

5. The method according to claim 1 or 2, characterized in that, After receiving the operation of adding a keyframe at the moment when the second image is presented to the first material, the method further includes: obtaining parameters of the second image, wherein the parameters of the second image are used to indicate the first effect; After receiving the editing operation applied to the fourth screen in the preview area, the method further includes: obtaining parameters of the fifth screen, the parameters of the fifth screen being used to indicate the second effect.

6. The method according to claim 1 or 2, characterized in that, Prior to displaying the first user interface, the method further includes: A second user interface is displayed, which includes: the preview area, the first track, and the pointer with a fixed position; The operation to add the second track has been received.

7. The method according to claim 1 or 2, characterized in that, After playing the first video starting from the fifth screen and the second material starting from the sixth screen in the preview area, the method further includes: Received user action to export video; The storage includes a video containing the first video and the second material.

8. The method according to claim 1 or 2, characterized in that, In the preview area, the image of the first material is overlaid on the image of the first video, or the images of the first material and the first video are displayed in a split-screen format.

9. The method according to claim 1 or 2, characterized in that, The first track displays all or part of the footage from the first video.

10. The method according to claim 1 or 2, characterized in that, The method further includes: The start time of the first orbit is the same as that of the second orbit.

11. The method according to claim 1 or 2, characterized in that, After receiving the operation of selecting the second track, the method further includes: The operation of adding a keyframe at the moment when the first material is presented to the second screen includes operations performed on the first control.

12. The method according to claim 1 or 2, characterized in that, After playing the first video starting from the fifth screen and the second material starting from the sixth screen in the preview area, the method further includes: Upon receiving a pause playback command, the system displays the seventh screen of the first track pointed to by the pointer and the eighth screen of the second track pointed to by the pointer in the preview area. Upon receiving an editing operation applied to the eighth screen in the preview area, the effect of the eighth screen in the preview area is adjusted to the third effect, and the eighth screen is located between the second screen and the fourth screen; Upon receiving a right swipe operation on the second track, the first track and the second track are moved to the right, and the ninth screen of the first track and the tenth screen of the second track after the pointer has moved to the right are displayed in the preview area. Upon receiving a playback command, the first video is played starting from the ninth screen in the preview area, and the third material is played starting from the tenth screen. The third material includes the frames of the first material arranged sequentially. In the third material, the multiple frames before the second screen are presented with the first effect, the multiple frames from the second screen to the eighth screen gradually transition from the first effect to the third effect, the multiple frames from the eighth screen to the fourth screen gradually transition from the third effect to the second effect, and the multiple frames after the fourth screen are presented with the second effect.

13. The method according to any one of claims 1-12, characterized in that, After receiving the operation of selecting the second track, the method further includes: A left handle is displayed at the left edge of the second track, and a right handle is displayed at the right edge of the second track. The left handle is used to adjust the start time of the second track, and the right handle is used to adjust the end time of the second track.

14. 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-13.

15. 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-13.

16. 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-13.