Video editing method and electronic device

By inserting filter information into the video and using differential data to restore the original video frames, the problem of users having difficulty changing filters in existing technologies is solved, improving the secondary editing effect and user experience of video editing, while maintaining video playback and sharing compatibility.

CN116866496BActive Publication Date: 2026-04-10HONOR 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
2022-03-28
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing video editing technologies, it is difficult for users to change filters when performing secondary editing of videos, resulting in poor editing effects and affecting user experience.

Method used

By inserting filter information into the video without actually synthesizing the edited video frames, filter replacement is achieved using differential data. This allows users to directly apply new filter effects to the original video frames and restore the original video frames using differential data.

Benefits of technology

It enables users to further edit videos to better match their needs, improves the user experience, and maintains good compatibility during playback and sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116866496B_ABST
    Figure CN116866496B_ABST
Patent Text Reader

Abstract

The application provides a video editing method and an electronic device. In the method, a preview interface of a first video in a photo album application is displayed, the preview interface includes an editing control and a first frame of the first video, the first frame refers to a video frame obtained after a first filter is added to a first original video frame; a selection operation of a user on the editing control is received; in response to the selection operation, a first interface is displayed, the first interface includes the first frame of the first video and a filter control of a second filter; a selection operation of the user on the filter control is received; in response to the selection operation on the filter control, the display of the first frame in the first interface is stopped, and a second frame is displayed in the first interface, the second frame refers to a video frame obtained after a second filter is added to the first original video frame. The application can improve the editing effect of the secondary editing of the video by the user, and thus improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of video data processing, and in particular to a video editing method and an electronic device. BACKGROUND

[0002] In video shooting or video editing, a user can use an editing function such as a filter to adjust a video image, so that the video achieves a certain beautification or stylization effect. However, after the video is edited and saved, if the user wants to edit the video again, the user can only perform editing on the basis of the previous editing, the editing effect of the video is poor, and it is difficult to achieve the video editing effect required by the user, thereby affecting the user experience. SUMMARY

[0003] The present application provides a video editing method and an electronic device, which improves the editing effect of secondary editing of a video by a user, and further improves the user experience.

[0004] In a first aspect, an embodiment of the present application provides a video editing method applied to an electronic device, including: displaying a preview interface of a first video in a photo album application, the preview interface including an editing control and a first frame of the first video, the first frame being a video frame obtained by adding a first filter to a first original video frame; receiving a selection operation of the user on the editing control; in response to the selection operation on the editing control, displaying a first interface, the first interface including the first frame of the first video and a filter control of a second filter; receiving a selection operation of the user on the filter control; in response to the selection operation on the filter control, stopping displaying the first frame in the first interface, and displaying a second frame in the first interface, the second frame being a video frame obtained by adding the second filter to the first original video frame. The first video in the embodiment of the present application can also be referred to as a primary edited video, the first frame can also be referred to as a primary edited video frame, and the second frame can also be referred to as a secondary edited video frame. In the method, in response to the selection operation on the filter control, the first frame is stopped from being displayed in the first interface, and the second frame is displayed in the first interface, the first frame being a video frame obtained by adding the first filter to the first original video frame, and the second frame being a video frame obtained by adding the second filter to the first original video frame, so that the method provided by the present application replaces the first filter with the second filter instead of superimposing the second filter on the basis of the first filter, so that the video obtained after the secondary editing operation is more matched to the editing effect required by the user, thereby improving the editing effect of secondary editing of the video by the user, and further improving the user experience.

[0005] In a possible implementation, the first video includes: video frames of the first video, and first difference data; the first difference data includes difference data between the video frames of the first video and corresponding original video frames; and displaying the first interface includes: obtaining a first frame from the video frames of the first video; and displaying the first interface according to the first frame. In a possible implementation, to reduce the data quantity of the first video, the video frames of the first video and the first difference data included in the first video can be encoded data; the data obtained after the video frames of the first video are encoded can also be referred to as first video data, and the data obtained after the first difference data is encoded can also be referred to as second video data.

[0006] In a possible implementation, displaying the second frame in the first interface includes: obtaining difference data between the first frame and a first original video frame from the first difference data; restoring the first frame to the first original video frame according to the difference data between the first frame and the first original video frame; adding a second filter to the restored first original video frame to obtain the second frame; and displaying the second frame in the first interface. The first original video frame is an original video frame corresponding to the first frame, and is one of original video frames in the original video.

[0007] In a possible implementation, the video frames of the first video are located in a first video track of the first video, and the first difference data is located in a second video track or a private extension field of the first video. The video frames of the first video are located in the first video track of the first video, thereby ensuring that a video playback application can normally play the first video; and the first difference data is located in the second video track or the private extension field of the first video, thereby enabling a video editing application to restore the video frames of the first video to original video frames according to the first difference data, and further enabling secondary editing of the video.

[0008] In a possible implementation, the method further includes: in response to a selection operation on the filter control, displaying a save control in the first interface; receiving a selection operation of the save control by the user; in response to the selection operation on the save control, restoring the video frames of the first video to original video frames according to the video frames of the first video and the first difference data; adding a second filter to the restored original video frames to obtain video frames of a second video; calculating difference data between the video frames of the second video and corresponding original video frames to obtain second difference data; and saving the second video, the second video including: the video frames of the second video and the second difference data. In a possible implementation, to reduce the data quantity of the second video, the video frames of the second video and the second difference data included in the second video can be encoded data; the data obtained after the video frames of the second video are encoded can also be referred to as first video data of the second video, and the data obtained after the second difference data is encoded can also be referred to as second video data of the second video.

[0009] In a possible implementation, restoring the video frame of the first video to the original video frame according to the video frame of the first video and the first differential data comprises: for a video frame of the first video, obtaining differential data between the video frame and a corresponding original video frame from the first differential data; and restoring the video frame to the original video frame according to the differential data between the video frame and the corresponding original video frame.

[0010] In a possible implementation, saving the second video comprises: performing encoding processing on the video frame of the second video to obtain the first video data; performing encoding processing on the second differential data to obtain the second video data; encapsulating the first video data and the second video data into the second video; and saving the second video.

[0011] In a possible implementation, the first video data is located in a first video track of the second video, and the second video data is located in a second video track or a private extension field of the second video.

[0012] In a possible implementation, the first interface comprises: an original video restoring control; and the method further comprises: receiving a selection operation of a user on the original video restoring control; and in response to the selection operation on the original video restoring control, stopping displaying the first frame in the first interface, and displaying the first original video frame in the first interface.

[0013] In a possible implementation, the first video comprises: a video frame of the first video, and first differential data; the first differential data comprises differential data between the video frame of the first video and a corresponding original video frame; and displaying the first original video frame in the first interface comprises: obtaining differential data between the first frame and the first original video frame from the first differential data; restoring the first frame to the first original video frame according to the differential data between the first frame and the first original video frame; and displaying the restored first original video frame in the first interface.

[0014] In a second aspect, the embodiments of the present application provide a video editing method applied to an electronic device, including: displaying a preview interface of a first video in a photo album application, the preview interface including an editing control and a first frame of the first video, the first frame being a video frame obtained by adding a first filter to a first original video frame; receiving a selection operation of the editing control by a user; in response to the selection operation of the editing control, displaying a first interface, the first interface including the first frame of the first video and an original video recovery control; receiving a selection operation of the original video recovery control by the user; in response to the selection operation of the original video recovery control, stopping displaying the first frame in the first interface and displaying a first original video frame in the first interface. The first video in the embodiments of the present application can also be referred to as a primary edited video, the first frame can also be referred to as a primary edited video frame, and the second frame can be referred to as a secondary edited video frame. In the method, in response to the selection operation of the original video recovery control, the first frame is stopped from being displayed in the first interface, and the first original video frame is displayed in the first interface, the first frame being a video frame obtained by adding a first filter to a first original video frame, the first original video frame being an original video frame corresponding to the first frame and being an original video frame in an original video, so that the method provided in the present application removes the first filter in the first frame to obtain the first original video frame without the first filter, and thus the user can add a new editing operation on the basis of the first original video frame, thereby improving the editing effect of secondary editing of the video by the user and improving the user experience.

[0015] In a possible implementation, the first video includes: a video frame of the first video, and first difference data; the first difference data includes difference data between the video frame of the first video and a corresponding original video frame; displaying the first original video frame in the first interface includes: obtaining difference data between the first frame and the first original video frame from the first difference data; restoring the first frame to the first original video frame according to the difference data between the first frame and the first original video frame; and displaying the restored first original video frame in the first interface.

[0016] In a possible implementation, the first video includes: a video frame of the first video, and first difference data; the first difference data includes difference data between the video frame of the first video and a corresponding original video frame; displaying the first interface includes: obtaining the first frame from the video frame of the first video; and displaying the first interface according to the first frame.

[0017] In a possible implementation, the video frame of the first video is located in a first video track of the first video, and the first difference data is located in a second video track or a private extension field of the first video. The video frame of the first video is located in the first video track of the first video, so that the video playing application can normally play the first video; and the first difference data is located in the second video track or the private extension field of the first video, so that the video editing application can restore the video frame of the first video to the original video frame according to the first difference data, and then the secondary editing of the video can be implemented.

[0018] In a possible implementation, the first interface includes a filter control of the second filter; and the method further includes: receiving a selection operation of the user on the filter control; and in response to the selection operation on the filter control, stopping displaying the first frame in the first interface, and displaying a second frame in the first interface, the second frame being a video frame obtained by adding the second filter to the first original video frame.

[0019] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor; a memory; and one or more computer programs, wherein the computer programs are stored in the memory, and the computer programs are executed by the processor to cause the electronic device to perform the method in any one of the first aspect or the second aspect.

[0020] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer program causes the computer to perform the method in any one of the first aspect or the second aspect.

[0021] In a fifth aspect, the present application provides a computer program, when the computer program is executed by a computer, the computer program is used to perform the method in any one of the first aspect or the second aspect.

[0022] In a possible design, the program in the fifth aspect can be stored in a storage medium packaged together with the processor in whole or in part, or can be stored in a storage medium not packaged together with the processor in whole or in part. BRIEF DESCRIPTION OF DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0024] Figure 1 An example diagram of a video editing interface in the prior art;

[0025] Figure 2Figure 2 shows another example of a video editing interface for the prior art;

[0026] Figure 3 Figure 3 shows a schematic diagram of the principle of two different mapping methods for LUT technology;

[0027] Figure 4 Figure 4 shows a schematic diagram of the software structure for an embodiment of the electronic device of the present application;

[0028] Figure 5A Figure 5 shows a schematic diagram of the interface for an embodiment of the video editing method of the present application;

[0029] Figure 5B Figure 6 shows a schematic diagram of the interface for another embodiment of the video editing method of the present application;

[0030] Figure 5C Figure 7 shows a schematic diagram of the interface for a third embodiment of the video editing method of the present application;

[0031] Figure 5D Figure 8 shows a schematic diagram of the interface for a fourth embodiment of the video editing method of the present application;

[0032] Figure 6 Figure 9 shows a schematic diagram of the flow for an embodiment of the video editing method of the present application;

[0033] Figure 7 Figure 10 shows a schematic diagram of the flow for another embodiment of the video editing method of the present application;

[0034] Figure 8 Figure 11 shows a schematic diagram of the flow for yet another embodiment of the video editing method of the present application;

[0035] Figure 9 Figure 12 shows a schematic diagram of the structure for an embodiment of the electronic device of the present application;

[0036] Figure 10 Figure 13 shows a schematic diagram of the structure for another embodiment of the electronic device of the present application;

[0037] Figure 11 Figure 14 shows a schematic diagram of the flow for an embodiment of the video editing method of the present application based on the structure shown in Figure 12; Figure 9

[0038] Figure 15 shows a schematic diagram of the flow for an embodiment of the video editing method of the present application based on the structure shown in Figure 12; Figure 12 Figure 10 Figure 16 shows a schematic diagram of the flow for another embodiment of the video editing method of the present application based on the structure shown in Figure 12;

[0039] Figure 13 Figure 10 Figure 17 shows a schematic diagram of the flow for yet another embodiment of the video editing method of the present application based on the structure shown in Figure 12;

[0040] Figure 14 Figure 18 shows a schematic diagram of the structure for yet another embodiment of the electronic device of the present application;​​

[0041] Figure 15 Structure diagram of another embodiment of the electronic device of the present application;

[0042] Figure 16 Flow diagram of one embodiment of the video editing method of the present application based on the structure shown in Figure 14

[0043] Flow diagram of another embodiment of the video editing method of the present application based on the structure shown in Figure 17 Figure 14 Flow diagram of one embodiment of the video editing method of the present application based on the structure shown in

[0044] Figure 18 Figure 15 Flow diagram of another embodiment of the video editing method of the present application based on the structure shown in

[0045] Figure 19 Flow diagram of one embodiment of the video editing method of the present application based on the structure shown in Figure 15

[0046] Figure 20 Summary flow diagram of one embodiment of the video editing method of the present application;

[0047] Figure 21 Summary flow diagram of another embodiment of the video editing method of the present application. DETAILED DESCRIPTION

[0048] The terms used in the embodiments part of the present application are only used for explaining the specific embodiments of the present application, and are not intended to limit the present application.

[0049] In video shooting or video editing, a user can use an editing function such as "filter" to adjust a video image, so that the video achieves a certain beautifying or stylizing effect. However, after the video is edited and saved, if the user wants to edit the video again, the user can only edit on the basis of the previous editing, the editing effect of the video is poor, and it is difficult to achieve the editing effect required by the user, thereby affecting the user experience.

[0050] Taking the editing function of "filter" as an example. "Filter" is often used in video editing to adjust the display effect of the color tone of a video image. A user can select a video to be edited in a video editing application. The video editing application displays the video to the user, the user selects a filter for the video, and the video editing application can process each video frame in the video into a video frame with the added filter, that is, process the video into a video with the added filter. For example, Figure 1 ​​​The middle interface 11 is an example of a video editing interface. In the interface 11, a video frame 101 after adding a "star" filter is shown.

[0051] However, once the video after adding the filter (for example, the "star" filter described above) is saved, if the user wants to edit the video again, for example, to add a "heart" filter to the video, the user can only add the "heart" filter on the basis of the "star" filter, for example Figure 2 The middle interface 12 is an example of a video editing interface. In the interface 12, a video frame 102 after further adding a "heart" filter to the video frame 101 after adding the "star" filter is shown.

[0052] However, in actual applications, in many cases, the user does not want to add a new filter (for example, the "heart" filter described above) on the basis of the existing filter (for example, the "star" filter described above) of the video when performing secondary editing on the video. Instead, the user wants to replace the filter of the video. Therefore, the editing effect of the secondary video editing provided by the video editing application for the user cannot match the user's needs, resulting in poor video editing effect and affecting the user experience. Similarly, when the user performs other non-filter editing operations (for example, adding a sticker, a frame, etc.) on the video, similar problems also exist.

[0053] It is found through analysis that the main reason for the above problems is the irreversibility of the principle of video editing. Specifically:

[0054] Currently, the editing (for example, adding a color filter) of the video is generally implemented by using a color lookup table (LUT) technology. For example, for adding a filter 1 to the video, a color lookup table 1 corresponding to the filter 1 is generally preset. For each video frame in the video, the color value of each pixel in the video frame is used as an index value to search the color lookup table 1, and a color value after mapping is obtained. The color value after mapping is used to replace the color value, so as to obtain a new video frame after adding the filter 1.

[0055] The LUT technology includes various mapping methods. For example Figure 3This diagram illustrates the working principles of two different mapping methods in LUT technology. The first diagram shows a 1D LUT, where each color (R, G, or B) is represented by a separate 1D LUT. This allows for the simultaneous creation of three 1D LUTs, each mapping the color values ​​of R, G, or B. The second diagram shows a 3D LUT, where the RGB values ​​of a pixel are directly mapped to obtain the new RGB values. Regardless of the mapping method, due to the inherent nature of LUTs and limitations in data precision, LUT mapping generally exhibits a large number of "many-to-one" relationships. This means that a certain range of input color values ​​will be mapped to the same output color value, making LUT mapping generally irreversible.

[0056] For example, in a video frame, pixels 1, 2, and 3 might have different RGB values. However, after adding filter 1, the RGB value 1 of pixel 1, the RGB value 2 of pixel 2, and the RGB value 3 of pixel 3 are mapped to the same RGB value 4. Therefore, when reversing the mapping of RGB value 4, since RGB value 4 corresponds to multiple RGB values, the video editing application cannot reconstruct the RGB value 1 of pixel 1, the RGB value 2 of pixel 2, and the RGB value 3 of pixel 3 based on the RGB value 4 of pixels 1, 2, and 3. This results in the irreversibility of the LUT mapping. The generally irreversible nature of LUT mapping means that after a video is edited (e.g., a color grading filter is added) and saved, it cannot be restored to its original state, leading to the problem of being unable to edit it again (e.g., changing the color grading filter).

[0057] To address the aforementioned issues, in one instance, if a user adds a filter to a video, the video editing application does not actually synthesize the edited video frames; it only inserts the information of the filter to be used (a very small amount of data) into the original video. The video editing application recognizes this special information, and when the user performs a filter change operation on the edited video, it only replaces the aforementioned filter information without actually changing the video frames of the original video.

[0058] The main problem with this solution is that it doesn't actually synthesize the video frames with added filters. Instead, it requires real-time synthesis of video frames with filter effects based on filter information during playback. Only specially implemented video players can reproduce the effect of added filters. In open systems like Android, the implementation of video players and the methods for sharing and copying are difficult to control uniformly, resulting in poor compatibility for playback and sharing of this specially edited video.

[0059] The video editing method provided in this application enables users to perform secondary editing of videos, improve editing effects, and thus enhance user experience. Moreover, it has relatively better compatibility in playback and external sharing.

[0060] Figure 4Fig. 1 shows a software structure block diagram of an electronic device according to an embodiment of the present application. The layered architecture divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, the application layer, the application framework layer (also referred to as the system framework layer), the system library and the Android runtime layer, the hardware abstraction layer (HAL) and the kernel layer.

[0061] The application layer can include several applications (hereinafter referred to as applications), such as camera, gallery, calendar, WLAN, etc.

[0062] The application layer of the electronic device according to an embodiment of the present application includes a video editing application and a video shooting application.

[0063] The video editing application described above can be a system-provided video editing application or a third-party provided video editing application, and the video shooting application can be a system-provided camera application or a third-party provided video shooting application. In some embodiments, the video editing application and the video shooting application can be the same application, that is, an application can provide both video shooting and video editing functions.

[0064] The application framework layer provides the application layer with application programming interfaces (APIs) and programming frameworks, including various components and services to support Android development for developers. The application framework layer also includes some pre-defined functions. For example, the application framework layer can include a window manager, a content provider, a resource manager, a camera service, etc.

[0065] The system library and the Android runtime layer include a system library and an Android runtime. The system library can include a plurality of functional modules. For example: a surface manager, a two-dimensional graphics engine, a three-dimensional graphics processing library (for example: OpenGLES), a media library, a font library, etc. Among them, the browser kernel is responsible for the interpretation of web page syntax (such as HTML, JavaScript under the standard general markup language) and rendering (display) of the web page; the two-dimensional graphics engine is used to realize two-dimensional graphics drawing, image rendering, synthesis and layer processing, etc.; the three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis and layer processing, etc.; the media library is used to realize the input of different streaming media; the font library is used to realize the input of different fonts. The Android runtime is responsible for the scheduling and management of the Android system, and specifically includes a core library and a virtual machine. Among them, the core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android; the virtual machine is used to run the Android application developed using the java language.

[0066] The HAL layer is an interface layer between the operating system kernel and the hardware circuit. The HAL layer includes but is not limited to: an audio hardware abstraction layer (Audio HAL) and a camera hardware abstraction layer (Camera HAL). Among them, the Audio HAL is used to process the audio stream, for example, to perform noise reduction, directional enhancement, etc. on the audio stream, and the Camera HAL is used to process the image stream.

[0067] The kernel layer is a layer between hardware and software. The kernel layer can include: a display driver, a camera driver, an audio driver, a sensor driver, etc.

[0068] In the following embodiments, the video editing method of the present application will be described in detail in combination with the software structure of the electronic device described above.

[0069] In the embodiments of the present application, the video can include first video data, and the first video data is data obtained by encoding a plurality of video frames. It should be noted that in the embodiments of the present application, if the video is an edited video, the video can also include second video data, and the second video data is data obtained by encoding difference data, which will be described in detail hereinafter, and will not be described here.

[0070] In the following embodiments, the editing operation on the video is still taken as an example of adding a filter.

[0071] Figures 5A-5C The interface schematic diagram provided for the video editing method of the present application includes:

[0072] Referring to Figure 5A, is an interface schematic diagram of adding a filter to a video by a user in a video editing application in the video editing method of the present application. Interface 50 and interface 51 are example diagrams of a video editing interface provided by the video editing application. Among them,

[0073] When the user selects a video (hereinafter referred to as an original video) as an edited video, the original video can be displayed in interface 50 by displaying a video frame (hereinafter referred to as an original video frame) of the original video, for example, as shown in video frame 501. It should be noted that the video frame 501 initially displayed by the video editing application can be the first video frame of the original video, and then the user can switch the video frame 501 to any video frame in the original video.

[0074] The user selects the filter control 502 in the interface 50. The interface 50 displays several filter effect controls, such as the "filter 1" control, the "filter 2" control, the "filter 3" control, and so on in the interface 50; the user selects a filter effect control, such as the "filter 3" control 502a in the interface 50, which assumes that the filter effect corresponding to the "filter 3" control 502a is to add a "star" effect; accordingly, the video frame 501 in the interface 50 is converted to the video frame 511 in the interface 51, and the "star" effect is added to the video frame 511.

[0075] After the user selects the "save" control 512 in the interface 51, the video editing application saves the video after adding the filter (such as the "star" effect described above), which is referred to as a first edited video.

[0076] For ease of description, the video frame of the first edited video is referred to as a first edited video frame.

[0077] Among them, the original video can include: first video data, the first video data is data obtained by encoding the original video frame.

[0078] The first edited video includes first video data and second video data. The first video data is data obtained by encoding the first edited video frame. For example, the first edited video frame is a video frame with a "star" filter added. The second video data is data obtained by encoding the difference data, which is described in detail below and will not be described here.

[0079] Referring to Figure 5B , is an interface schematic diagram of adding a filter to a video to be photographed by a user in a video shooting application in the video editing method of the present application. Interface 52 and interface 53 are example diagrams of a video shooting interface provided by the video shooting application. Among them,

[0080] When the user enters the video shooting interface, the video shooting application provides a video shooting interface for the user, for example, as shown in interface 52, which displays an image captured by a camera, for example, as shown in image 521.

[0081] The user selects the filter control 522 in the user selection interface 52. The interface 52 displays several filter effect controls, such as the "Filter 1" control, the "Filter 2" control, the "Filter 3" control, and so on in the interface 52. The user selects a filter effect control, such as the "Filter 3" control 522a in the interface 52. In this example, it is assumed that the filter effect corresponding to the "Filter 3" control 522a is to add a "star" effect. Accordingly, the image 521 captured by the camera in the interface 52 is converted into the image 531 in the interface 53, and the image 531 has the "star" effect added thereto.

[0082] After that, the user performs video shooting, and the video obtained after the video shooting has the filter effect, such as the "star" effect described above, added to each video frame of the video. This video can be referred to as the once-edited video. Similarly, the once-edited video includes the first video data and the second video data, which will not be described herein again.

[0083] Referring to Figure 5C is a schematic diagram of an interface in which the user in the video editing application of the video editing method of the present application performs editing on the once-edited video again. The interface 54, the interface 55, and the interface 56 are example diagrams of the video editing interface provided by the video editing application.

[0084] The user selects the once-edited video in the video editing interface provided by the video editing application. The video editing interface can display the once-edited video by displaying the video frames of the once-edited video. At this time, the video editing interface is shown in the interface 54, for example. The video frame 541 in the interface 54 is a video frame (i.e., a once-edited video frame) in the once-edited video described above. The filter 3 (taking the "star" effect described above as an example) is added to the video frame.

[0085] The interface 54 can provide the "Restore Original Video" control 513. When the user selects the "Restore Original Video" control 513, the video editing application restores the original video frame from the once-edited video frame and displays the original video frame to the user. The video frame 551 in the interface 55 is the original video frame corresponding to the video frame 541, for example. After the user selects the "Save" control 512 in the interface 55, the video editing application saves the original video. The original video can be the same as the original video in the foregoing example. The original video includes video data, and the video data includes the video frame image without the star filter added thereto.

[0086] Alternatively, the user can select filter control 502 in interface 54. Interface 54 displays several filter effect controls, such as "Filter 1," "Filter 2," "Filter 3," etc. The "Filter 3" control selected in a previous edit is marked with a checkmark ("√"), allowing the user to see the filter effect chosen for the video in the previous edit. The user can then select other filter effect controls besides "Filter 3," such as selecting "Filter 4" control 502b in interface 54. In this example, it's assumed that the filter effect corresponding to "Filter 4" control 502b is adding a "heart." Effect; Correspondingly, in this embodiment, the filter added to the edited video is replaced from filter 3 to filter 4. At this time, the video editing interface is as shown in interface 56, for example. The video frame 541 in interface 54 is converted into the video frame 561 in interface 56. The "star" filter effect of filter 3 in the previous editing is removed from the video frame 561, and the "heart" filter effect of filter 4 is added. That is, the "star" filter is replaced with the "heart" filter. After that, if the user selects the "save" control 512 in interface 55, the video editing application saves the video after adding filter 4, which is referred to as the secondary edited video.

[0087] For ease of description, the video frames of the secondary edited video will be referred to as secondary edited video frames below.

[0088] Similar to the first-time video editing process described above, the second-time video editing process includes first video data and second video data. The first video data is the data obtained after encoding the second-time edited video frames. It should be noted that the second-time edited video frames are those with a "heart" filter added.

[0089] contrast Figure 5C Medium video frame 561 and Figure 2 As can be seen from video frame 102, in the secondary editing operation provided in the video editing method of this application embodiment, a secondary editing operation (such as adding filter 4 as mentioned above) can be used to replace a primary editing operation (such as adding filter 3 as mentioned above), instead of superimposing a secondary editing operation on a primary editing operation. This makes the video obtained after the secondary editing operation more in line with the editing effect required by the user, thereby improving the editing effect of the user's secondary editing of the video and thus improving the user experience.

[0090] The following describes how a user triggers the opening of a video editing application, for example... Figure 5A and Figure 5C The method of the video editing interface shown is illustrated by way of example.

[0091] In one possible implementation, for example Figure 5DAs shown, a user can view a video in the photo album application. The photo album application displays a video preview interface, such as interface 57, which includes an "edit" control 571. When the user selects the "edit" control 571, the interface displayed on the electronic device jumps from the video preview interface of the photo album application to the video editing interface of the video editing application for that video. The specific video editing interface is as described above. Figure 5A and Figure 5C As shown.

[0092] In another possible implementation, for example Figure 5D As shown, the user can access a function selection interface provided by the video editing application, such as interface 58. The function selection interface includes a "video editing" control 581. When the user selects the "video editing" control 581, the video editing application provides a video selection interface, such as interface 59. The video selection interface displays a list of videos, which can be videos saved in the photo album application of the electronic device. The user selects the video to be edited (such as the original video, editable video, etc. mentioned above) in the video selection interface and selects the "OK" control 591. The video editing application then displays the video editing interface for the selected video.

[0093] Based on the above interface implementation, the specific implementation of the video editing method of this application will be illustrated through the following embodiments.

[0094] Figure 6 A flowchart of one embodiment of the video editing method of this application is shown below. Figure 6 As shown, the method may include:

[0095] Step 601: A selection operation for the original video is detected, and the original video frames of the original video are displayed.

[0096] In a video editing application, a user selects the video to be edited; this video can be called the original video. The electronic device can decode the original video to obtain several video frames (i.e., original video frames). The video editing application can display the original video in the video editing interface by showing the original video frames, as shown in the aforementioned interface 50.

[0097] It should be noted that the aforementioned video frames can be all or part of the original video frames. In other words, the electronic device can decode only a portion of the original video to obtain only a portion of the video frames. For example, if the video editing interface only displays the first original video frame, then this step can decode and display only the first original video frame.

[0098] Step 602: The first editing operation on the original video is detected.

[0099] The user selects a control corresponding to the editing function in the video editing interface. Correspondingly, a first editing operation on the original video is detected; for example, the user selects the "filter" control in interface 50 and selects the "filter 3" control, and the video editing application detects that the first editing operation on the original video is an operation of adding filter 3.

[0100] Step 603: In response to the first editing operation, display a video frame of the once-edited video.

[0101] Specifically, the video editing application can perform the editing processing indicated by the first editing operation on the original video frame to obtain an edited video frame (i.e., a once-edited video frame), and display the once-edited video frame. For example, the first editing operation is to add filter 3 to the original video, and filter 3 can be added to the original video frame to obtain a once-edited video frame after adding filter 3, and the once-edited video frame after adding filter 3 is displayed.

[0102] The video editing application can display the once-edited video in the video editing interface by displaying the video frame, such as the interface 51 described above.

[0103] It should be noted that in this step, the video editing application edits part or all of the original video frames in the original video to obtain part or all of the once-edited video frames of the once-edited video. Continuing the example in step 601, if only the first frame of the original video frame is decoded and displayed in step 601, then only the first frame of the original video frame can be edited in this step to obtain the first frame of the once-edited video frame, and the first frame of the once-edited video frame is displayed.

[0104] Step 604: Detect a save operation on the once-edited video.

[0105] Continuing the foregoing example, the user can select the "save" control in the video editing interface shown in interface 51, and the video editing application detects a save operation on the once-edited video.

[0106] Step 605: In response to the save operation, generate and save the once-edited video.

[0107] Specifically, since the once-edited video is a video edited from the original video, the video frames in the two videos have a corresponding relationship.

[0108] The once-edited video generated in this step can specifically include:

[0109] encoding the once-edited video frame to obtain first video data;

[0110] The difference data between corresponding video frames in the two videos is calculated to obtain difference data corresponding to each edited video frame, the difference data is encoded to obtain second video data;

[0111] The first video data and the second video data are encapsulated as edited video.

[0112] It should be noted that if all edited video frames are not processed by the video editing application before step 604, the above-mentioned encoding processing of the edited video frame can further include:

[0113] The original video is decoded to obtain each original video frame, and the editing processing indicated by the first editing operation is performed on each original video frame to obtain a corresponding edited video frame. Thus, through the processing, all edited video frames in the edited video are obtained.

[0114] In the calculation of the difference data between the two video frames, the color (RGB) difference between the pixels at the same position in the two video frames can be calculated, so as to obtain the color difference corresponding to all pixels in the video frame, that is, the difference data between the two video frames is calculated. For example, for the first video frame in the original video, the corresponding video frame in the edited video is generally the first video frame, the color difference between the two pixels respectively located in the first row and the first column of the two video frames can be calculated, and the color difference between the two pixels respectively located in the first row and the second column of the two video frames can be calculated, and so on, until the color difference corresponding to all pixels in the two video frames is calculated.

[0115] In the calculation of the color difference between the two pixels, the R value, the G value and the B value of the color values of the two pixels are subtracted to obtain the color difference, which includes the difference of the three dimensions of RGB.

[0116] The above-mentioned encoding processing can be realized by intra-frame and inter-frame compression algorithm of video. Through the above-mentioned encoding processing, the amount of video data can be reduced. Moreover, due to the similarity between the corresponding video frames of the original video and the edited video, the color difference corresponding to each pixel in the video frame of the edited video is similar, and the color difference of the corresponding pixels in the adjacent two video frames in the edited video is similar, therefore, after the intra-frame and inter-frame data compression of the difference data, the amount of difference data is greatly reduced, and the amount of second video data obtained after encoding is much smaller than the amount of first video data. That is to say, the second video data occupies a very small proportion in the edited video, and the file size of the edited video increases little when the second video data is encapsulated in the edited video, and the storage space of the electronic device is relatively small.

[0117] In encapsulating the first video data and the second video data into one video, the first video data can be encapsulated into a first video track of the video, and the second video data can be encapsulated into a second video track or a private extension field of the video. By encapsulating the first video data into the first video track, it can be ensured that a video player can normally play the once-edited video using the first video data of the first video track. By encapsulating the second video data into the second video track or the private extension field, it can be ensured that a video editing application can restore the original video according to the second video data in subsequent video editing.

[0118] In other possible implementations, if the storage space of the electronic device is not taken into account, the original video frames and the once-edited video frames can be directly encoded and encapsulated into one video to obtain the once-edited video. The first video data of the once-edited video frames after encoding can still be encapsulated into the first video track of the once-edited video to ensure that the video player can normally play the once-edited video.

[0119] Figure 6 In the method, the editing operation on the original video is implemented, and the once-edited video is obtained.

[0120] Figure 7 The flowchart of another embodiment of the video editing method is shown in FIG. 6. Figure 7 As shown in FIG. 6, the method can include the following steps.

[0121] Step 701: detecting a selection operation on the once-edited video, and displaying a once-edited video frame of the once-edited video.

[0122] The user selects the once-edited video to be edited in the video editing application. The electronic device decodes the first video data in the once-edited video to obtain a plurality of once-edited video frames of the once-edited video. The video editing application can display the once-edited video by displaying the video frames in the video editing interface, for example, as shown in the interface 54.

[0123] It should be noted that the plurality of once-edited video frames can be all or part of the video frames of the once-edited video, that is, the electronic device can only decode part of the first video data in the once-edited video to obtain part of the once-edited video frames. For example, if the video editing interface only displays the first frame of the once-edited video frame, only the first frame of the once-edited video frame can be decoded and displayed in this step.

[0124] Step 702: detecting a video restoration operation on the once-edited video.

[0125] Continuing the foregoing example, the user can select a "restore original video" control in the video editing interface shown by interface 54, for example, and in response the video editing application detects a video restore operation with respect to the once-edited video.

[0126] Step 703: In response to the video restore operation, display the original video frame, which is generated from the once-edited video frame.

[0127] Optionally, displaying the original video frame in this step can include:

[0128] Obtaining second video data from the once-edited video;

[0129] Decoding the second video data to obtain difference data corresponding to the once-edited video frame;

[0130] Restoring the once-edited video frame to the original video frame using the difference data.

[0131] Optionally, for a once-edited video frame, the once-edited video frame can be synthesized according to the difference data corresponding to the once-edited video frame to obtain a synthesized video frame, which is the original video frame, in other words, the video frame before the once editing is performed.

[0132] Continuing the foregoing example, second video data can be obtained from the once-edited video, and the second video data can be decoded to obtain difference data corresponding to the once-edited video frame. For a once-edited video frame, the difference data corresponding to the once-edited video frame includes a color difference value corresponding to each pixel in the once-edited video frame. Adding the color value of each pixel in the once-edited video frame to the color difference value corresponding to the pixel can obtain a new color value of each pixel, and further obtain the original video frame corresponding to the once-edited video frame, in which the color value of each pixel is the new color value obtained by the calculation.

[0133] For example, for a once-edited video frame, the color value of the pixel in the first column of the first row of the once-edited video frame is added with the color difference value to obtain a new color value, which is used as the color value of the pixel in the first column of the first row of the original video frame. The color value of the pixel in the second column of the first row of the once-edited video frame is added with the color difference value to obtain a new color value, which is used as the color value of the pixel in the second column of the first row of the original video frame. In this way, the color value of each pixel in the original video frame is calculated, that is, the original video frame is obtained. It should be noted that in this step, the video editing application edits part or all of the original video frames in the original video to obtain part or all of the once-edited video frames of the once-edited video. Continuing the example in step 601, if only the first frame of the original video frame is decoded and displayed in step 601, only the first frame of the original video frame can be synthesized in this step to obtain the first frame of the once-edited video frame, and the first frame of the once-edited video frame is displayed.

[0134] It should be noted that in this step, the video editing application edits part or all of the once-edited video frames in the once-edited video to obtain part or all of the original video frames of the original video. Continuing the example in step 701, if only the first frame of the once-edited video frame is decoded and displayed in step 701, only the first frame of the once-edited video frame can be synthesized in this step to obtain the first frame of the original video frame, and the first frame of the original video frame is displayed.

[0135] Step 704: detecting a save operation for the original video.

[0136] Continuing the foregoing example, the user can select the "save" control in the video editing interface shown in interface 55, and correspondingly, the video editing application detects the save operation for the original video.

[0137] Step 705: in response to the save operation, generating and saving the original video.

[0138] Specifically, the original video frames can be encoded to obtain the original video.

[0139] It should be noted that if all the original video frames are not processed by the video editing application before step 704, the above encoding of the original video frames can further include:

[0140] decoding the first video data of the once-edited video to obtain each once-edited video frame;

[0141] decoding the second video data of the once-edited video to obtain the difference data corresponding to each once-edited video frame;

[0142] According to the difference data corresponding to each primary edited video frame, the primary edited video frame is restored to the corresponding original video frame.

[0143] Thus, through the above processing, the original video frame corresponding to all primary edited video frames is obtained.

[0144] Figure 7 In the method shown, the original video is restored and stored according to the primary edited video.

[0145] Figure 8 The flowchart of another embodiment of the video editing method of the present application is shown as Figure 8 The method can include:

[0146] Step 801: Detecting a selection operation on the primary edited video, and displaying a primary edited video frame of the primary edited video.

[0147] The implementation of this step can refer to step 701, which is not described here.

[0148] Step 802: Detecting a second editing operation on the primary edited video.

[0149] The user selects the control corresponding to the editing function in the video editing interface, and accordingly, the electronic device can detect the second editing operation on the primary edited video; for example, the user selects the "filter" control in the interface 54 and selects the "filter 4" control, and accordingly, the video editing application detects that the second editing operation on the primary edited video is an operation of adding filter 4.

[0150] Step 803: In response to the second editing operation, displaying a secondary edited video frame.

[0151] The secondary edited video frame is generated according to the primary edited video frame, and the secondary edited video frame is the same as the video frame obtained after the second editing operation is performed on the original video frame.

[0152] The video editing application can first restore the primary edited video frame to the original video frame, and then perform the editing processing indicated by the second editing operation on the original video frame to obtain the secondary edited video frame. Comparing Figure 5C the video frame image 561 in Figure 2 the video frame image 103 in It can be seen that in the secondary editing operation provided in the video editing method of the embodiment of the present application, the secondary editing operation (such as the above-mentioned addition of filter 4) replaces the primary editing operation (such as the above-mentioned addition of filter 3), rather than superimposing the secondary editing operation on the primary editing operation, so that the secondary edited video obtained after the secondary editing operation is more matched with the editing effect required by the user, thereby improving the editing effect of the user's secondary editing of the video, and further improving the user experience.

[0153] Optionally, displaying the video frames of the second edited video in this step can specifically include:

[0154] Obtaining second video data from the first edited video;

[0155] Decoding the second video data to obtain difference data corresponding to the first edited video frame;

[0156] Restoring the first edited video frame to the original video frame using the difference data;

[0157] Performing a second editing operation on the original video frame to obtain a second edited video frame;

[0158] Displaying the second edited video frame.

[0159] The video editing application can display the second edited video by displaying video frames in the video editing interface, such as the interface 56 described above.

[0160] It should be noted that the video editing application performs editing processing on part or all of the second edited video frames in the second edited video in this step to obtain part or all of the second edited video frames of the second edited video. Continuing the example in step 801, if only the first frame of the first edited video frame is decoded and displayed in step 801, only the first frame of the first edited video frame can be edited in this step to obtain the first frame of the second edited video frame, and the first frame of the second edited video frame is displayed.

[0161] Step 804: detecting a save operation for the second edited video.

[0162] Continuing the example described above, the user can select the "save" control in the video editing interface shown in the interface 56, and accordingly, the video editing application detects the save operation for the second edited video.

[0163] Step 805: in response to the save operation, generating and saving the second edited video.

[0164] The implementation of this step can refer to step 605, and the difference is that the first edited video in step 605 is replaced by the second edited video in this step.

[0165] Figure 8 In the method shown, the second editing operation on the first edited video is implemented, and the second edited video is stored.

[0166] Figure 9 A structural schematic diagram of an embodiment of an electronic device of the present application, the structure of the electronic device is suitable for Figure 5A and Figure 6 The video editing method shown. As Figure 9As shown, comprising: a first application interface display module, a video decoder 1, a video encoder 1, a video encoder 2, a LUT synthesis module, a video image difference module, a video multiplexing encapsulation module, a video demultiplexing module, and a video storage module;

[0167] The first application interface display module, the LUT synthesis module, and the video image difference module described above can be located in the application layer of the software architecture shown, and can be modules in the first application shown. Figure 4 The application layer in the software architecture shown can be Figure 4 The modules in the first application shown.

[0168] The video decoder 1, the video encoder 1, the video encoder 2, the video multiplexing encapsulation module, and the video demultiplexing module described above can be located in the application program framework layer of the software architecture shown. Figure 4 The application program framework layer in the software architecture shown.

[0169] The video storage module is used for storing videos.

[0170] It should be noted that the levels at which the modules and codecs described above are located in the software architecture are only examples, and other settings can also be provided in actual applications, and the embodiments of the present application are not limited. For example, the video multiplexing encapsulation module and / or the video demultiplexing module described above can also be provided in the application layer, and the video image difference module can also be located in the application program framework layer, and the like.

[0171] It should be noted that the video encoder 1 and the video encoder 2 described above can be implemented by one video encoder; or the video encoder 1 and the video encoder 2 described above can be two separate video encoders.

[0172] Figure 10 The structure of another embodiment of the electronic device of the present application is shown in the structural schematic diagram, and the structure of the electronic device is suitable for the video editing method shown in Figure 5C , Figure 7 and Figure 8 . As shown, comprising: a second application interface display module, a LUT synthesis module, a video decoder 1, a video decoder 2, a video image synthesis module, a video demultiplexing module, and a video storage module; Figure 10

[0173] The second application interface display module, the LUT synthesis module, and the video image synthesis module described above can be located in the application layer of the software architecture shown, and can be modules in the second application shown. Figure 4 The application layer in the software architecture shown can be Figure 4 The modules in the second application shown.

[0174] The video decoder 1, the video decoder 2, and the video demultiplexing module described above can be located in the application program framework layer of the software architecture shown. Figure 4 The application program framework layer in the software architecture shown.

[0175] The video storage module is used for storing videos.​

[0176] It should be noted that the level of the above-mentioned modules and codecs in the software architecture is only an example, and other settings can also be made in actual applications, and the embodiments of the present application are not limited. For example, the LUT synthesis module and the video image synthesis module described above can also be arranged in the application architecture layer, and the video multiplexing and packaging module described above can also be arranged in the application layer, and the like.

[0177] It should be noted that the video decoder 1 and the video decoder 2 described above can be implemented by one video decoder, or the video decoder 1 and the video decoder 2 described above can also be implemented by two separate video decoders.

[0178] It should be noted that the editing operation performed on the video frame in the above electronic device implementation structure is an example of adding a filter, and therefore the electronic device includes an LUT synthesis module for implementing the editing operation of adding a filter to the video frame. If other editing operations are performed on the video frame, the LUT synthesis module can be replaced by a module supporting the above-mentioned other editing operations, which will not be listed one by one here.

[0179] The possible implementation structure of the electronic device shown in Figure 9 will be described in more detail by Figure 11 The possible implementation process of the video editing method shown in Figure 6 . Taking the operation of adding a filter to the video as an example, as shown in Figure 11 , the method can include:

[0180] Step 1101: detecting a video selection operation.

[0181] The user opens the video editing application (i.e. the first application), and the electronic device can enter the video editing interface. Subsequently, the user can select a video as the edited video, which is the original video described above. Correspondingly, the first application interface display module detects a video selection operation.

[0182] It should be noted that the original video can be a video that has not been edited, or it can also be a video edited by other video editing applications other than the video editing application of the embodiments of the present application.

[0183] Step 1102: sending an original video identifier.

[0184] The first application interface display module sends the identifier of the original video to the video storage module to obtain the original video from the video storage module.

[0185] Step 1103: sending the original video.

[0186] The video storage module receives the identifier of the original video sent by the first application interface display module, and sends the video corresponding to the identifier (i.e., the original video) to the video demux module.

[0187] Step 1104: sending video data.

[0188] The video demux module sends the video data of the first video track in the original video to the video decoder 1.

[0189] It should be noted that the original video can only have data of one video track, and the video demux module can send the original video to the video decoder 1.

[0190] Step 1105: sending a video frame of the original video.

[0191] The video decoder 1 receives the video data (e.g., the original video), decodes the video data, obtains a video frame of the original video (hereinafter referred to as an original video frame), and sends the original video frame to the first application interface display module.

[0192] The original video includes at least one video frame, and the number of frames is not limited in the embodiments of the application.

[0193] Step 1106: displaying the original video frame.

[0194] The first application interface display module receives the video frame sent by the video decoder 1 and displays the video frame to the user. For example, the video frame image 501 displayed in the interface 50 in Figure 5A

[0195] It should be noted that if the video frame is multiple frames, the first application interface display module can initially display the first video frame to the user and provide a video frame selection control for the user, so that the user can select the original video frame that he / she wants to view.

[0196] Step 1107: detecting an adding filter operation.

[0197] The user selects an adding filter operation on the video in the video editing interface, and accordingly, the first application interface display module detects the adding filter operation.

[0198] Step 1108: sending a video frame and editing operation content.

[0199] The first application interface display module detects the adding filter operation and sends the original video frame and the specific content of the adding filter operation to the LUT synthesis module.

[0200] Step 1109: video frame synthesis.

[0201] ​The LUT synthesis module performs synthesis processing on the original video frame according to the added filter operation content (for example, adding a "star" filter), to obtain a synthesized video frame (for example, a video frame after adding a "star" filter). For ease of description, the above-mentioned synthesized video frame is referred to as a primary edited video frame in the following.

[0202] It should be noted that when the original video includes a plurality of original video frames, the above-mentioned synthesis processing can be performed on each original video frame respectively, to obtain a plurality of primary edited video frames.

[0203] Step 1110: sending the primary edited video frame.

[0204] The LUT synthesis module sends the obtained primary edited video frame to the first application interface display module.

[0205] Step 1111: displaying the primary edited video frame.

[0206] The first application interface display module receives the primary edited video frame sent by the LUT synthesis module, and displays the above-mentioned primary edited video frame to the user.

[0207] It should be noted that if the primary edited video frame is a plurality of frames, the first application interface display module can initially display the first frame of the primary edited video frame to the user, and provide a video frame selection control to the user, so that the user can select the primary edited video frame to be viewed.

[0208] Step 1112: receiving a save operation of the user.

[0209] The user selects the "save" control in the video editing interface shown in interface 51, for example. Figure 5A Correspondingly, the first application interface display module can receive the save operation of the user.

[0210] Step 1113: sending the original video frame.

[0211] The first application interface display module sends the original video frame to the video image difference module.

[0212] Step 1114: sending the primary edited video frame.

[0213] The first application interface display module sends the primary edited video frame to the video image difference module.

[0214] It should be noted that the execution order between step 1112 and step 1113 is not limited in the embodiment of the application.

[0215] Step 1115: difference processing.

[0216] The video image difference module receives the original video frame and the once-edited video frame, and performs difference processing on the corresponding original video frame and once-edited video frame to obtain difference data corresponding to each once-edited video frame.

[0217] Step 1116: transmitting the difference data.

[0218] The video image difference module transmits the difference data corresponding to each once-edited video frame to the video encoder 1.

[0219] Step 1117: transmitting second video data.

[0220] The video encoder 1 receives the difference data, encodes the difference data to obtain encoded difference data (hereinafter referred to as second video data), and transmits the second video data to the video multiplexing and packaging module.

[0221] It should be noted that, due to the similarity between the original video frame and the once-edited video frame, the color difference value corresponding to each pixel in a once-edited video frame is similar, and the color difference value of the corresponding pixels in adjacent once-edited video frames is similar. Therefore, after encoding the difference data, the data amount of the difference data can be greatly reduced, so that the data amount of the second video data is much smaller than the data amount of the first video data obtained after encoding the once-edited video. That is to say, the second video data occupies a very small proportion in the once-edited video in the subsequent steps, and occupies a relatively small storage space of the electronic device.

[0222] Step 1118: transmitting the once-edited video frame.

[0223] The application interface display module transmits the once-edited video frame to the video encoder 2.

[0224] It should be noted that the execution sequence of step 1118 and the above steps 1112-1117 is not limited.

[0225] Step 1119: transmitting the first video data.

[0226] The video encoder 2 encodes the once-edited video frame included in the once-edited video, and transmits the first video data obtained by encoding to the video multiplexing and packaging module.

[0227] Step 1120: video data packaging.

[0228] The video multiplexing and packaging module packages the first video data and the second video data to obtain the once-edited video.

[0229] Specifically, to enable the video playing application to normally play the one-time edited video, the first video data can be encapsulated in the first video track, and the second video data can be encapsulated in the second video track or a private extension field, so that the video playing application can play the first video data of the first video track in the one-time edited video, that is, play the one-time edited video.

[0230] Step 1121: Send the one-time edited video.

[0231] The video multiplexing encapsulation module sends the one-time edited video to the video storage module; correspondingly, the video storage module can store the one-time edited video.

[0232] It should be noted that the video storage module can update the original video to the one-time edited video, or store the one-time edited video as a new video.

[0233] The following will be described in detail in combination with a possible implementation structure of the electronic device as shown in Figure 10 The implementation structure of the electronic device as shown in Figure 12 The implementation structure of the electronic device as shown in Figure 7 The method as shown in Figure 12 The method can include:

[0234] Step 1201: Detect a video selection operation.

[0235] The user opens the video editing application and selects the one-time edited video as the edited video, and correspondingly, the second application interface display module detects the video selection operation.

[0236] Step 1202: Obtain the one-time edited video.

[0237] The second application interface display module sends the identifier of the one-time edited video to the video storage module, so as to obtain the one-time edited video from the video storage module.

[0238] Step 1203: Send the one-time edited video.

[0239] The video storage module receives the identifier of the one-time edited video sent by the second application interface display module, and sends the video corresponding to the identifier (that is, the one-time edited video) to the video demultiplexing module.

[0240] Step 1204: Send the second video data.

[0241] The video demultiplexing module obtains the data of the first video track (that is, the first video data) from the one-time edited video and sends it to the video decoder 1.

[0242] Step 1205: Send the one-time edited video frame.

[0243] The video decoder 1 receives the first video data, decodes the first video data to obtain an edited video frame of the edited video, and sends the edited video frame to the second application interface display module.

[0244] Step 1206: Display the edited video frame.

[0245] The second application interface display module receives the edited video frame sent by the video decoder 1 and displays the edited video frame to the user. For example Figure 5C The video frame image 541 of the edited video is displayed in the video editing interface 54.

[0246] It should be noted that if the edited video frame is multiple frames, the second application interface display module can initially display the first edited video frame of the edited video to the user and provide the user with an edited video frame selection control so that the user can select the edited video frame of the edited video that he / she wants to view.

[0247] Step 1207: Receive a video recovery operation.

[0248] The user selects the "Restore original video" control in the interface 55, for example Figure 5C Accordingly, the second application interface display module receives the video recovery operation.

[0249] Step 1208: Send an edited video identifier.

[0250] The second application interface display module receives the above-mentioned video recovery operation and sends the edited video identifier to the video storage module.

[0251] Step 1209: Send the edited video.

[0252] The video storage module receives the identifier of the edited video sent by the second application interface display module, sends the video corresponding to the identifier (i.e., the edited video) to the video demultiplexing module.

[0253] Step 1210: Send the second video data.

[0254] The video demultiplexing module obtains the second video data from the edited video and sends the second video data to the video decoder 2.

[0255] Step 1211: Send the difference data.

[0256] The video decoder 2 decodes the second video data to obtain the difference data corresponding to the edited video frame and sends the difference data to the video image synthesis module.

[0257] Step 1212: Send the edited video frame.

[0258] The second application interface display module sends the edited video frames to the video image synthesis module.

[0259] It should be noted that in other possible implementations, the video demultiplexing module can send the first video data to the video decoder 1, which in turn decodes the data to obtain an edited video frame and sends it to the video image synthesis module.

[0260] It should be noted that the execution order of steps 1208 to 1211 and step 1212 is not restricted.

[0261] Step 1213: Synthesize the original video frames.

[0262] The video image compositing module performs image compositing processing on the edited video frame based on the differential data corresponding to the edited video frame, to obtain the original video frame corresponding to the edited video frame. For specific implementation details, please refer to the aforementioned description; they will not be repeated here.

[0263] Step 1214: Send the raw video frames.

[0264] The video image synthesis module sends the original video frames to the application interface display module.

[0265] Step 1215: Display the original video frames.

[0266] See Figure 5C As shown in interface 55, the original video frames are displayed in the video editing interface shown by the application interface display module.

[0267] Afterwards, if the user selects the "Save" control, the second application interface display module can send the original video frames to the video encoder for encoding processing to obtain the original video. The video encoder then sends the original video to the video storage module for storage. The video storage module can use the original video to update the edited video once, or it can save the original video as a new video.

[0268] The following combination Figure 10 The possible implementation structures of the electronic device shown are as follows: Figure 13 right Figure 8 The possible implementation flow of the video editing method shown will be explained in more detail. For example... Figure 13 As shown, the method may include:

[0269] The implementation of steps 1301 to 1306 can be referred to steps 1201 to 1206, which will not be repeated here.

[0270] Step 1307: Video editing operation detected.

[0271] Users in, for exampleFigure 5C The second application interface display module detects the video editing operation, and sends the content of the video editing operation (e.g., adding a "heart" filter) to the LUT synthesis module.

[0272] Step 1308: Send the content of the editing operation.

[0273] The second application interface display module detects the video editing operation, and sends the content of the video editing operation (e.g., adding a "heart" filter) to the LUT synthesis module.

[0274] The implementation of steps 1309-1314 can refer to steps 1208-1213, which will not be described here.

[0275] Step 1315: Send the original video frame.

[0276] The video image synthesis module sends the original video frame to the LUT synthesis module.

[0277] Step 1316: Video frame synthesis processing.

[0278] The LUT synthesis module performs synthesis processing on the original video frame according to the content of the editing operation received in step 1308 to obtain an edited video frame (hereinafter referred to as a secondary edited video frame).

[0279] For example, refer to Figure 5C The image of the secondary edited video frame is shown in the video frame image 561 in interface 56, which only adds a "heart" filter and eliminates the original "star" filter.

[0280] Step 1317: Send the secondary edited video frame.

[0281] The LUT synthesis module sends the secondary edited video frame to the second application interface display module.

[0282] Step 1318: Display the secondary edited video frame.

[0283] The second application interface display module displays the secondary edited video frame to the user, for example Figure 5C The video frame image 561 in interface 56.

[0284] It should be noted that if the user subsequently selects the "save" control 512 in the interface 56, the implementation process of generating a secondary edited video for storage can refer to the corresponding description of generating a primary edited video in step 605 of Figure 6 The difference is only that the primary edited video in step 605 is replaced by the secondary edited video in this step, which will not be described here.

[0285] It should be noted that the user can also perform three times editing, four times editing, and the like on the secondary edited video, and the specific implementation can be referred to the implementation process shown in Figure 13 , which will not be described herein.

[0286] The above Figures 9-13 is a specific implementation example of the video editing method of the embodiment of the present application.

[0287] In the following, another specific implementation example of the video editing method of the embodiment of the present application is provided, and details are shown in Figures 14-17 .

[0288] Figure 14 is a structural schematic diagram of still another embodiment of the electronic device of the present application, and the structure of the electronic device is suitable for the video editing method shown in Figure 5A and Figure 6 . As shown in Figure 14 , a scheduling module is added on the basis of the structure shown in Figure 9 , and is used for scheduling processing between modules in video editing. Figure 14 In the above, the scheduling module is set in the application layer as an example, and in other implementation manners, the scheduling module can be set in the application program framework layer, for example.

[0289] Figure 15 is a structural schematic diagram of still another embodiment of the electronic device of the present application, and the structure of the electronic device is suitable for the video editing method shown in Figure 5C , Figure 7 and Figure 8 . As shown in Figure 15 , a scheduling module is added on the basis of the structure shown in Figure 10 , and is used for scheduling processing between modules in video editing. Figure 15 In the above, the scheduling module is set in the application layer as an example, and in other implementation manners, the scheduling module can be set in the application program framework layer, for example.

[0290] In the following, possible implementation structures of the electronic device shown in Figure 14 are combined to more specifically describe possible implementation processes of the video editing method shown in Figure 16 and Figure 17 . Take the operation of adding a filter to a video as an example, and as shown in Figure 6 , the method can include: Figure 16

[0291] Step 1601: detecting a video selection operation.

[0292] Step 1602: requesting a first frame of original video frame.

[0293] ​The first application interface display module requests the first frame of the original video from the scheduling module. This request may include an identifier for the original video to indicate the original video to the scheduling module.

[0294] Step 1603: Request the data of the first raw video frame.

[0295] The scheduling module requests the data of the first frame of the original video from the video demultiplexing module. This request may carry the identifier of the original video frame and the indication information of the first frame of the original video frame.

[0296] Step 1604: Obtain the original video.

[0297] The video demultiplexing module retrieves the original video from the video storage module.

[0298] Step 1605: Send the original video.

[0299] The video storage module sends the original video to the video demultiplexing module.

[0300] Step 1606: Send the data of the first raw video frame.

[0301] The video demultiplexing module can obtain the first video data from the original video, obtain the data corresponding to the first frame of the original video from the first video data, and send the data corresponding to the first frame of the original video to the scheduling module.

[0302] Step 1607: Request data decoding.

[0303] The scheduling module sends the data of the first original video frame to video decoder 1, requesting video decoder 1 to decode the data.

[0304] Step 1608: Send the first raw video frame.

[0305] Video decoder 1 receives the data of the first raw video frame, decodes the data to obtain the first raw video frame, and sends the first raw video frame to the scheduling module.

[0306] Step 1609: Send the first raw video frame.

[0307] The scheduling module sends the first raw video frame to the first application interface display module.

[0308] Step 1610: Display the first original video frame.

[0309] The first application interface display module receives the first raw video frame sent by the scheduling module and displays it to the user. For example... Figure 5A The video frame 501 is displayed in interface 50.

[0310] Step 1611: detecting an operation of adding a "star" filter.

[0311] The user selects to add a "star" filter to the video in the video editing interface, and the first application interface display module detects the operation of adding a "star" filter.

[0312] Step 1612: sending a first frame of original video frame and a request of adding a "star" filter.

[0313] The first application interface display module detects the operation of adding a "star" filter, and sends the indication information of the first frame of original video frame and the indication information of the "star" filter to the LUT synthesis module to request the LUT synthesis module to add a "star" filter to the first frame of original video frame.

[0314] Optionally, the first application interface display module can send the first frame of original video frame and the request of adding a "star" filter to the LUT synthesis module through the scheduling module.

[0315] Step 1613: video frame synthesis.

[0316] The LUT synthesis module performs synthesis processing corresponding to the "star" filter on the first frame of original video frame to obtain a first frame of primary edited video frame after adding a "star" filter.

[0317] Here, the first frame of primary edited video frame refers to the first frame of primary edited video frame of the primary edited video.

[0318] Step 1614: sending the first frame of primary edited video frame.

[0319] The LUT synthesis module sends the obtained primary edited video frame to the first application interface display module.

[0320] Optionally, the LUT synthesis module can send the first frame of primary edited video frame to the first application interface display module through the scheduling module.

[0321] Step 1615: displaying the primary edited video frame.

[0322] The first application interface display module receives the first frame of primary edited video frame and displays the first frame of primary edited video frame to the user.

[0323] After displaying the primary edited video frame in step 1615, if the user clicks the save operation, the video editing application performs the step process as shown in Figure 17 The method can comprise:

[0324] Step 1701: receiving a save operation of the user.

[0325] The user selects a "save" control in a video editing interface shown in interface 51, for example Figure 5A Correspondingly, the first application interface display module can receive the save operation of the user.

[0326] Step 1702: Request to save an edited video.

[0327] The first application interface display module requests the scheduling module to save an edited video, and the request can include an identifier of the original video.

[0328] Step 1703: Request first video data of the original video.

[0329] The scheduling module requests the video demultiplexing module for first video data and second video data of the original video, and the request can include an identifier of the original video.

[0330] Step 1704: Obtain the original video.

[0331] Step 1705: Send the original video.

[0332] Step 1706: Send the first video data of the original video.

[0333] The video demultiplexing module obtains the first video data from the original video and sends the first video data to the scheduling module.

[0334] Step 1707: Request to decode the first video data.

[0335] The scheduling module sends the first video data to the video decoder 1 and requests the video decoder 1 to decode the first video data.

[0336] Step 1708: Send the original video frame.

[0337] The video decoder 1 decodes the first video data to obtain each original video frame of the original video.

[0338] Step 1709: Send the original video frame and the "star" filter request.

[0339] The scheduling module sends each original video frame of the original video and the "star" filter request to the LUT synthesis module and requests the LUT synthesis module to add the "star" filter to each original video frame.

[0340] Step 1710: Video frame synthesis.

[0341] The LUT synthesis module performs synthesis processing corresponding to the "star" filter on each original video frame to obtain a corresponding edited video frame.

[0342] Step 1711: sending the primary edited video frame.

[0343] The LUT synthesis module sends all the obtained primary edited video frames to the scheduling module.

[0344] Step 1712: sending the original video frame and the primary edited video frame.

[0345] The scheduling module sends the original video frame and the primary edited video frame corresponding to each original video frame to the video image difference module.

[0346] Step 1713: difference processing.

[0347] The video image difference module receives the original video frame and the primary edited video frame, and performs difference processing on the corresponding original video frame and the primary edited video frame to obtain difference data corresponding to each primary edited video frame.

[0348] Step 1714: sending the difference data.

[0349] The video image difference module sends the difference data corresponding to each primary edited video frame to the video encoder 1.

[0350] Step 1715: sending the second video data.

[0351] The video encoder 1 receives the above difference data, performs encoding processing on the difference data to obtain encoded difference data (hereinafter referred to as second video data), and sends the second video data to the video multiplexing and packaging module.

[0352] Step 1716: sending the primary edited video frame.

[0353] The scheduling module sends all the primary edited video frames to the video encoder 2.

[0354] It should be noted that the execution sequence between step 1716 and the above steps 1712-1715 is not limited.

[0355] Step 1717: sending the first video data.

[0356] The video encoder 2 performs encoding processing on the primary edited video frame, and sends the first video data obtained by encoding to the video multiplexing and packaging module.

[0357] Step 1718: video packaging.

[0358] The video multiplexing and packaging module performs packaging processing on the first video data and the second video data to obtain the primary edited video.

[0359] Specifically, to enable the video playing application to normally play the once edited video, the first video data can be encapsulated in the first video track, and the second video data can be encapsulated in the second video track or the private extension field, so that the video playing application can play the first video data of the first video track in the once edited video, that is, play the once edited video.

[0360] Step 1719: sending the once edited video.

[0361] The video multiplexing encapsulation module sends the once edited video to the scheduling module.

[0362] Step 1720: requesting to save the once edited video.

[0363] The scheduling module sends the once edited video to the video storage module to request the video storage module to save the once edited video.

[0364] Step 1721: sending the indication information of saving success.

[0365] After the video storage module successfully saves the once edited video, the video storage module returns the indication information of saving success to the scheduling module.

[0366] Step 1722: sending the indication information of saving success.

[0367] The scheduling module sends the indication information of saving success to the first application interface display module.

[0368] Step 1723: prompting saving success.

[0369] The first application interface display module can display a prompt interface to the user to prompt that the once edited video is saved successfully.

[0370] It should be noted that the video storage module can update the original video to the once edited video, or store the once edited video as a new video.

[0371] The following describes the possible implementation structure of the electronic device shown in Figure 15 in more detail. As shown in Figure 18 , the method can include: Figure 7 Figure 18 The implementation of steps 1801-1810 can refer to steps 1601-1610, and the main difference is that the original video is replaced by the once edited video, and the original video frame is replaced by the once edited video frame.

[0372] Step 1811: receiving a video recovery operation.

[0373] Step 1811: receiving a video recovery operation.

[0374] ​The user selects the "restore original video" control in the interface 55, for example Figure 5C The second application interface display module receives the video restoration operation.

[0375] Step 1812: Request to restore the first frame of the once edited video frame.

[0376] The second application interface display module requests the scheduling module to restore the first frame of the once edited video frame. The request can carry the identifier of the once edited video and the indication information of the first frame of the once edited video frame.

[0377] Step 1813: Request the encoding data of the differential data of the first frame of the once edited video frame.

[0378] The scheduling module requests the video demultiplexing module to restore the encoding data of the differential data of the first frame of the once edited video frame of the once edited video. The request can carry the identifier of the once edited video and the indication information of the first frame of the once edited video frame.

[0379] Step 1814: Obtain the once edited video.

[0380] The video demultiplexing module obtains the once edited video from the video storage module.

[0381] Step 1815: Send the once edited video.

[0382] The video storage module sends the once edited video to the video demultiplexing module.

[0383] Step 1816: Send the encoding data of the differential data of the first frame of the once edited video frame.

[0384] The video demultiplexing module can obtain the second video data from the once edited video, obtain the encoding data of the differential data of the first frame of the once edited video frame from the second video data, and send the encoding data to the scheduling module.

[0385] Step 1817: Request decoding data.

[0386] The scheduling module sends the encoding data of the differential data of the first frame of the once edited video frame to the video decoder 2, and requests the video decoder 2 to decode the data.

[0387] Step 1818: Send the differential data of the first frame of the once edited video frame.

[0388] The video decoder 2 decodes the above-mentioned encoding data to obtain the differential data of the first frame of the once edited video frame, and sends the differential data of the first frame of the once edited video frame to the scheduling module.

[0389] Step 1819: Request to synthesize the original video frame corresponding to the first frame one-time edited video frame.

[0390] The scheduling module sends the first frame one-time edited video frame and the difference data to the video image synthesis module, to request the video image synthesis module to synthesize the original video frame corresponding to the first frame one-time edited video frame.

[0391] Step 1820: Synthesize the original video frame.

[0392] The video image synthesis module performs image synthesis processing on the one-time edited video frame according to the difference data corresponding to the one-time edited video frame, to obtain the original video frame corresponding to the one-time edited video frame. For specific implementation, reference can be made to the foregoing corresponding description, which will not be repeated here.

[0393] Step 1821: Send the original video frame.

[0394] The video image synthesis module sends the original video frame corresponding to the first frame one-time edited video frame to the scheduling module.

[0395] Step 1822: Send the original video frame.

[0396] The scheduling module sends the original video frame corresponding to the first frame one-time edited video frame to the second application interface display module.

[0397] Step 1823: Display the original video frame.

[0398] Referring to the interface 55 shown in Figure 5C , the second application interface display module displays the original video frame in the video editing interface.

[0399] After that, if the user selects the “save” control, the second application interface display module can send the original video frame to the video encoder for encoding processing through the scheduling module to obtain the original video, and the video encoder sends the original video to the video storage module for storage through the scheduling module. The video storage module can update the one-time edited video using the original video, or save the original video as a new video.

[0400] The possible implementation structure of the electronic device shown in Figure 15 will be described in more detail through Figure 19 the possible implementation process of the video editing method shown in Figure 8 . As shown in Figure 19 , the method can include:

[0401] The implementation of steps 1901-1910 can refer to steps 1801-1810, which will not be repeated here.

[0402] Step 1911: Detect the operation of adding the “love” filter.

[0403] The user selects to add a "heart" filter in a video editing interface shown in interface 54, for example. Figure 5C Correspondingly, the second application interface display module detects the operation of adding the "heart" filter.

[0404] Step 1912: Request to add a "heart" filter.

[0405] The first application interface display module requests the scheduling module to add a "heart" filter to the first frame of the once-edited video frame, and the request can include an identifier of the once-edited video, indication information of the first frame of the once-edited video frame, and indication information of the "heart" filter.

[0406] The implementation of steps 1913-1921 can refer to steps 1813-1821, which will not be described here.

[0407] Step 1922: Send the original video frame and the request to add the "heart" filter.

[0408] The second application interface display module sends the original video frame and the indication information of the "heart" filter to the LUT synthesis module to request the LUT synthesis module to add the "heart" filter to the original video frame.

[0409] Step 1923: Video frame synthesis processing.

[0410] The LUT synthesis module performs synthesis processing corresponding to the "heart" filter on the original video frame to obtain a twice-edited video frame.

[0411] For example, refer to the video frame image 561 shown in interface 56, which is an example of the image of the twice-edited video frame, in which only the "heart" filter is added, and the original "star" filter is eliminated. Figure 5C

[0412] Step 1924: Send the first frame of the twice-edited video frame.

[0413] The LUT synthesis module sends the first frame of the twice-edited video frame to the scheduling module.

[0414] Step 1925: Send the first frame of the twice-edited video frame.

[0415] The scheduling module sends the first frame of the twice-edited video frame to the second application interface display module.

[0416] Step 1926: Display the first frame of the twice-edited video frame.

[0417] The second application interface display module displays the first frame of the twice-edited video frame to the user, for example, as shown in the video frame image 561 of interface 56. Figure 5C ​​

[0418] It should be noted that if the user selects the "save" control 512 in the subsequent user interface 56, the implementation process of generating a secondary edited video for storage can be described as the foregoing corresponding description of generating a primary edited video, the main difference being that the primary edited video is replaced by the secondary edited video, and the original video frame is replaced by the primary edited video, which is not described here.

[0419] It should be noted that the user can also perform three times editing, four times editing, etc. on the secondary edited video, and the specific implementation can refer to the implementation process shown in Figure 13 , which is not described here.

[0420] In combination with the above process, the generation principle of the new video (for example, a primary edited video or a secondary edited video) is summarized and described. Referring to Figure 20 , including:

[0421] After the original video frame is synthesized according to the user's editing content by LUT, a new video frame (for example, a primary edited video frame or a secondary edited video frame) can be obtained;

[0422] The original video frame and the corresponding new video frame are differentially processed to obtain difference data corresponding to each new video frame, and the difference data is video encoded to obtain second video data;

[0423] The new video frame is video encoded to obtain first video data;

[0424] The first video data and the second video data are encapsulated to obtain a new video (for example, a primary edited video or a secondary edited video).

[0425] In combination with the above process, the process of recovering the original video from the new video is summarized and described. Referring to Figure 21 , including:

[0426] The new video is demultiplexed to obtain first video data and second video data;

[0427] The second video data is decoded to obtain difference data corresponding to the new video frame;

[0428] The first video data is decoded to obtain a new video frame;

[0429] The original video frame can be synthesized according to the new video frame and the corresponding difference data.

[0430] The embodiments of the present application also provide an electronic device including a processor and a memory, the processor being configured to execute the method provided by any of the embodiments of the present application. Figures 5A-21

[0431] ​This application also provides an electronic device, which includes a storage medium and a central processing unit (CPU). The storage medium may be a non-volatile storage medium storing a computer-executable program. The CPU is connected to the non-volatile storage medium and executes the computer-executable program to implement this application. Figures 5A-21 The method provided in any embodiment.

[0432] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to execute this application. Figures 5A-21 The method provided in any of the embodiments shown.

[0433] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to execute this application. Figures 5A-21 The method provided in any of the embodiments shown.

[0434] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0435] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0436] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0437] In several embodiments provided in the present application, any function, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, in essence or the parts that make contributions to the prior art, or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0438] The above description is merely a specific implementation of the present application. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application. The protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A video editing method applied to electronic devices, characterized in that, The method comprises: displaying a preview interface of a first video in a photo album application, the preview interface comprising an editing control and a first frame of the first video, the first frame being a video frame obtained by adding a first filter to a first original video frame; the first video comprising: video frames of the first video, and first difference data; first data obtained by encoding the video frames of the first video is packaged in a first video track of the first video; the first difference data comprises difference data between the video frames of the first video and corresponding original video frames; second data obtained by encoding the first difference data is packaged in a second video track or a private extension field of the first video; receiving a selection operation of a user on the editing control; in response to the selection operation on the editing control, obtaining the first data from the first video track of the first video, decoding the first data to obtain the video frames of the first video, and obtaining the first frame from the video frames of the first video; displaying a first interface according to the first frame, the first interface comprising the first frame and a filter control of a second filter; receiving a selection operation of a user on the filter control; in response to the selection operation on the filter control, stopping displaying the first frame in the first interface, and displaying a second frame in the first interface, the second frame being a video frame obtained by adding the second filter to the first original video frame; the displaying of the second frame in the first interface comprises: obtaining the second data from the second video track or the private extension field of the first video, and decoding the second data to obtain the first difference data; obtaining difference data between the first frame and the first original video frame from the first difference data; restoring the first frame to the first original video frame according to the difference data between the first frame and the first original video frame; adding the second filter to the restored first original video frame to obtain the second frame; displaying the second frame in the first interface.

2. The method of claim 1, wherein, Further comprising: in response to the selection operation on the filter control, the first interface displays a save control; receiving a selection operation of a user on the save control; in response to the selection operation on the save control, restoring the video frames of the first video to original video frames according to the video frames of the first video and the first difference data; adding the second filter to the restored original video frames to obtain video frames of a second video; calculating difference data between the video frames of the second video and corresponding original video frames to obtain second difference data; saving the second video, the second video comprising: the video frames of the second video and the second difference data.

3. The method of claim 2, wherein, the restoring of the video frames of the first video to original video frames according to the video frames of the first video and the first difference data comprises: For one video frame of the first video, difference data between the one video frame and a corresponding original video frame is obtained from the first difference data; The one video frame is restored to an original video frame according to the difference data between the one video frame and the corresponding original video frame.

4. The method of claim 2, wherein, The saving of the second video comprises: encoding processing of video frames of the second video to obtain first video data; encoding processing of the second difference data to obtain second video data; encapsulation of the first video data and the second video data into the second video; saving of the second video.

5. The method of claim 4, wherein, The first video data is located in a first video track of the second video, and the second video data is located in a second video track or a private extension field of the second video.

6. The method of claim 1, wherein, The first interface comprises an original video restoration control; the method further comprises: receiving a selection operation of a user on the original video restoration control; in response to the selection operation on the original video restoration control, stopping display of the first frame in the first interface and displaying the first original video frame in the first interface.

7. The method of claim 6, wherein, The first video comprises video frames of the first video and first difference data; the first difference data comprises difference data between the video frames of the first video and corresponding original video frames; The displaying of the first original video frame in the first interface comprises: obtaining difference data between the first frame and the first original video frame from the first difference data; restoring the first frame to the first original video frame according to the difference data between the first frame and the first original video frame; displaying the restored first original video frame in the first interface.

8. An electronic device, comprising: comprise: a processor; a memory; and one or more computer programs, wherein the computer programs are stored in the memory, and the computer programs are executed by the processor to cause the electronic device to perform the method in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, which, when running on a computer, causes the computer to perform the method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Non-destructive editing for a media editing application

    US20130239051A1

  • Method and device for storing and loading, including index, restore and display, data related to multiple pictures

    WO2018023557A1