Video editing method and apparatus
By creating a storage queue to save editing results during the video editing process, the problem of not being able to quickly undo the editing effects of a single tool in existing technologies is solved, thus achieving a more efficient video editing workflow.
Patent Information
- Application Number
- PCT/CN2025/096642
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-17
- Filing Date
- 2025-05-22
- Publication Date
- 2025-12-26
AI Technical Summary
Existing video editing tools cannot quickly undo the effects of a single tool when multiple editing tools are layered, resulting in low editing efficiency.
By creating a video storage queue, the results of different video editing algorithms are saved, and users can continuously input multiple editing operations and directly read the undo results from the queue, avoiding the need for re-editing.
It improves video editing efficiency, reduces user waiting time, and enhances the user experience.
Smart Images

Figure CN2025096642_26122025_PF_FP_ABST
Abstract
Description
A video editing method and apparatus
[0001] Cross-references to related applications
[0002] This application claims priority to Chinese Patent Application No. 202410780956.1, filed on June 17, 2024, entitled "A Video Editing Method and Apparatus", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of video editing technology, and in particular to a video editing method and apparatus. Background Technology
[0004] Many video editing tools available today are intelligent. Examples include video noise reduction models and video enhancement models trained using machine learning models. Summary of the Invention
[0005] In view of this, embodiments of this application provide a video editing method and apparatus to improve the efficiency of video editing.
[0006] To achieve the above objectives, the technical solutions provided in this application are as follows:
[0007] In a first aspect, embodiments of this application provide a video editing method, including:
[0008] Receive a first video editing operation and a second video editing operation; the first video editing operation and the second video editing operation are used to trigger the editing of the first video based on the first video editing algorithm and the second video editing algorithm in sequence;
[0009] Create a video storage queue;
[0010] The first video is edited based on the first video editing algorithm to obtain the second video, and the second video is saved to the video storage queue;
[0011] The second video is edited based on the second video editing algorithm to obtain the third video, and the third video is saved to the video storage queue.
[0012] As an optional implementation of this application, the method further includes:
[0013] Receive a third video editing operation; the third video editing operation is used to trigger the undo of the second video editing operation;
[0014] In response to the third video editing operation, the second video is read from the video storage queue to obtain the video editing result corresponding to the third video editing operation.
[0015] As an optional implementation of this application, the method further includes:
[0016] Receive a fourth video editing operation; the fourth video editing operation is used to trigger the undo of the first video editing operation;
[0017] In response to the fourth video editing operation, the first video is edited based on the second video editing algorithm to obtain the fourth video, and the fourth video is saved to the video storage queue.
[0018] As an optional implementation of this application, the method further includes:
[0019] Receive a fifth video editing operation; the fifth video editing operation is used to trigger editing of the second video based on a third video editing algorithm;
[0020] In response to the fifth video editing operation, the second video is read from the video storage queue, the second video is edited based on the third video editing algorithm to obtain the fifth video, and the fifth video is saved to the video storage queue.
[0021] As an optional implementation method of this application,
[0022] The step of editing the first video based on the first video editing algorithm to obtain the second video and saving the second video to the video storage queue includes: editing the video frames of the first video one by one based on the first video editing algorithm to obtain the corresponding video frames of the second video, and saving the video frames of the second video to the video storage queue respectively.
[0023] The step of editing the second video based on the second video editing algorithm to obtain a third video and saving the third video to the video storage queue includes:
[0024] When the video storage queue includes video frames to be edited, the video frames to be edited are edited based on the second video editing algorithm to obtain the corresponding video frames of the third video, and the video frames of the third video are saved to the video storage queue respectively. The video frames to be edited are the video frames of the second video saved in the video storage queue that have not been edited based on the second video editing algorithm.
[0025] As an optional implementation of this application, the method further includes:
[0026] Based on the video content of the first video and the first algorithm, a video ID is generated;
[0027] The video ID and the configuration parameters of the first video editing algorithm are concatenated to obtain the first concatenation value;
[0028] Based on the first concatenation value and the second algorithm, obtain the first product ID;
[0029] The second splicing value is obtained by combining the product ID of the second video and the configuration parameters of the second video editing algorithm;
[0030] Based on the second concatenation value and the second algorithm, obtain the second product ID;
[0031] The second video and the third video are named according to the first product ID and the second product ID, respectively.
[0032] As an optional implementation of this application, naming the second video and the third video according to the first product ID and the second product ID respectively includes:
[0033] The second video is named according to the first product ID, the start timestamp of the second video, and the duration of the second video;
[0034] The third video is named according to the second product ID, the start timestamp of the third video, and the duration of the third video.
[0035] As an optional implementation of this application, the method further includes:
[0036] The system receives a sixth video editing operation and a seventh video editing operation, which triggers sequential editing of a sixth video based on the first video editing algorithm and the second video editing algorithm; the sixth video and the first video are different video segments that overlap within the same video.
[0037] Based on the start and end points of the first video and the start and end points of the sixth video, obtain the segments in the sixth video that belong to the first video and the segments in the sixth video that do not belong to the first video that need to be edited;
[0038] Read the third video from the video storage queue;
[0039] Extract the video editing results corresponding to the segment to be spliced from the third video;
[0040] The segment to be edited is edited sequentially based on the first video editing algorithm and the second video editing algorithm to obtain the video editing result corresponding to the segment to be edited;
[0041] The video editing results corresponding to the segment to be spliced and the video editing results corresponding to the segment to be edited are combined to obtain the video editing result corresponding to the seventh video editing operation.
[0042] Secondly, embodiments of this application provide a video editing apparatus, including:
[0043] A receiving unit is configured to receive a first video editing operation and a second video editing operation; the first video editing operation and the second video editing operation are configured to trigger sequential editing of a first video based on a first video editing algorithm and a second video editing algorithm.
[0044] Create a unit to create a video storage queue;
[0045] An editing unit is configured to edit the first video based on the first video editing algorithm to obtain a second video, and save the second video to the video storage queue;
[0046] The editing unit is further configured to edit the second video based on the second video editing algorithm to obtain a third video, and save the third video to the video storage queue.
[0047] As an optional implementation method of this application,
[0048] The receiving unit is further configured to receive a third video editing operation; the third video editing operation is configured to trigger the cancellation of the second video editing operation;
[0049] The editing unit is further configured to, in response to the third video editing operation, read the second video from the video storage queue to obtain the video editing result corresponding to the third video editing operation.
[0050] As an optional implementation method of this application,
[0051] The receiving unit is further configured to receive a fourth video editing operation; the fourth video editing operation is configured to trigger the cancellation of the first video editing operation.
[0052] The editing unit is further configured to, in response to the fourth video editing operation, edit the first video based on the second video editing algorithm to obtain the fourth video, and save the fourth video to the video storage queue.
[0053] As an optional implementation method of this application,
[0054] The receiving unit is further configured to receive a fifth video editing operation; the fifth video editing operation is configured to trigger editing of the second video based on a third video editing algorithm;
[0055] The editing unit is further configured to, in response to the fifth video editing operation, read the second video from the video storage queue, edit the second video based on the third video editing algorithm to obtain the fifth video, and save the fifth video to the video storage queue.
[0056] As an optional implementation of this application, the editing unit is specifically used to edit the video frames of the first video one by one based on the first video editing algorithm to obtain the corresponding video frames of the second video, and save the video frames of the second video to the video storage queue respectively; when the video storage queue includes video frames to be edited, the editing unit is used to edit the video frames to be edited based on the second video editing algorithm to obtain the corresponding video frames of the third video, and save the video frames of the third video to the video storage queue respectively, wherein the video frames to be edited are the video frames of the second video stored in the video storage queue that have not been edited based on the second video editing algorithm.
[0057] As an optional implementation of this application, the editing unit is further configured to: generate a video ID based on the video content of the first video and the first algorithm; concatenate the video ID and the configuration parameters of the first video editing algorithm to obtain a first concatenation value; obtain the first product ID based on the first concatenation value and the second algorithm; concatenate the product ID of the second video and the configuration parameters of the second video editing algorithm to obtain a second concatenation value; obtain the second product ID based on the second concatenation value and the second algorithm; and name the second video and the third video respectively based on the first product ID and the second product ID.
[0058] As an optional implementation of this application, the editing unit is specifically used to name the second video according to the first product ID, the start timestamp of the second video, and the duration of the second video; and to name the third video according to the second product ID, the start timestamp of the third video, and the duration of the third video.
[0059] As an optional implementation method of this application,
[0060] The receiving unit is further configured to receive a sixth video editing operation and a seventh video editing operation, the sixth video editing operation and the seventh video editing operation being used to trigger editing of the sixth video sequentially based on the first video editing algorithm and the second video editing algorithm; the sixth video and the first video are different video segments that overlap within the same video;
[0061] The editing unit is further configured to: obtain, based on the start and end points of the first video and the start and end points of the sixth video, segments in the sixth video that belong to the first video and segments in the sixth video that do not belong to the first video that need to be edited; read the third video from the video storage queue; extract the video editing results corresponding to the segments to be spliced from the third video; edit the segments to be edited sequentially based on the first video editing algorithm and the second video editing algorithm to obtain the video editing results corresponding to the segments to be edited; and splice the video editing results corresponding to the segments to be spliced and the video editing results corresponding to the segments to be edited to obtain the video editing results corresponding to the seventh video editing operation.
[0062] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory is used to store a computer program and the processor is used to cause the electronic device to implement the video editing method described in any of the above embodiments when executing the computer program.
[0063] Fourthly, embodiments of this application provide a computer-readable storage medium that, when executed by a computing device, enables the computing device to implement any of the video editing methods described above.
[0064] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, enables the computer to implement any of the aforementioned video editing methods. Attached Figure Description
[0065] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0066] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings that need to be called in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 is one of the flowcharts of the video editing method provided in an embodiment of this application;
[0068] Figure 2 is a schematic diagram of the video editing interface provided in an embodiment of this application;
[0069] Figure 3 is a schematic diagram of the video storage queue provided in an embodiment of this application;
[0070] Figure 4 is a second flowchart of the video editing method provided in the embodiment of this application;
[0071] Figure 5 is a flowchart of the third step of the video editing method provided in the embodiment of this application;
[0072] Figure 6 is a flowchart of the fourth step of the video editing method provided in the embodiment of this application;
[0073] Figure 7 is a schematic diagram of a video editing method provided in an embodiment of this application;
[0074] Figure 8 is a schematic diagram of the product ID generation process provided in an embodiment of this application;
[0075] Figure 9 is one of the schematic diagrams showing the overlap between the first video and the sixth video provided in the embodiments of this application;
[0076] Figure 10 is a second schematic diagram illustrating the overlapping relationship between the first video and the sixth video provided in the embodiments of this application;
[0077] Figure 11 is a schematic diagram of the video editing device provided in an embodiment of this application;
[0078] Figure 12 is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of this application. Detailed Implementation
[0079] To better understand the above-mentioned objectives, features, and advantages of this application, the solution of this application will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0080] Many specific details are set forth in the following description in order to provide a full understanding of this application, but this application may also be implemented in other ways different from those described herein. Obviously, the embodiments in the specification are only some embodiments of this application, and not all embodiments.
[0081] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. Furthermore, in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0082] When multiple video editing tools' effects need to be layered, the common practice in existing technology is as follows: first, process the original video using one of the video editing tools, obtain the processing result from that tool, then input the result into the next video editing tool, and so on. Once all video editing tools have processed the video, a video with the combined effects of multiple tools is obtained. However, since only one video with all the effects is ultimately retained, if a user wants to undo a particular effect, they must sequentially reprocess the original video using the corresponding video editing tools for the desired effect. This lack of convenience and speed hinders the efficiency of video editing.
[0083] This application provides a video editing method. Referring to FIG1, the video editing method includes the following steps:
[0084] S101, Receive the first video editing operation and the second video editing operation.
[0085] The first video editing operation and the second video editing operation are used to trigger the editing of the first video based on the first video editing algorithm and the second video editing algorithm in sequence.
[0086] The video editing operations in this application embodiment can be one or more of the following: clicking operations on controls of video editing functions such as flicker removal controls, reverse playback controls, frame interpolation controls, and noise reduction controls in the video editing interface, video trimming interface, etc.; voice commands; or specific gestures. In some embodiments, the specific gesture can be any one of the following: single-click gesture, swipe gesture, pressure recognition gesture, long-press gesture, area change gesture, double-press gesture, and double-tap gesture.
[0087] For example, referring to FIG2, in some embodiments, the video editing page 200 includes: a first control 21 for adding original video, a second control 22 for selecting the start and end positions of the first video, and a plurality of editing algorithm controls 23 for selecting video editing algorithms; the user can add the original video to be processed by operating the first control 21, and specify the start and end positions by dragging the second control 22 to specify the first video. When the user's operation on at least two editing algorithm controls 23 is received in sequence, it is determined that a video editing operation for triggering the editing of the first video based on the video editing algorithms corresponding to at least two editing algorithm controls 23 has been received.
[0088] It should be noted that, compared to related technologies that require waiting for the previous video processing tool or video editing algorithm to complete the video editing before the next video editing operation can be input when multiple video editing tools are superimposed, the embodiments of this application support users to continuously input multiple video editing operations on the original video. The video editor then edits the element video one by one according to the multiple video editing operations. Therefore, the embodiments of this application can avoid interrupting the user's input of video editing operations, thereby improving the user experience.
[0089] S102. Create a video storage queue.
[0090] That is, for the first video, create a data storage queue for storing the video editing results of different video editing algorithms.
[0091] In some embodiments, after the video storage queue is created, the first video may be saved to the video storage queue first.
[0092] S103. Edit the first video based on the first video editing algorithm to obtain the second video, and save the second video to the video storage queue.
[0093] The first video editing algorithm in this application embodiment can be any video editing algorithm, and this application embodiment does not limit it. For example, the first video editing algorithm can be a flicker removal algorithm, a beautification algorithm, a special effects addition algorithm, etc.
[0094] S104. Edit the second video based on the second video editing algorithm to obtain the third video, and save the third video to the video storage queue.
[0095] Referring to FIG3, in some embodiments, after the first video is edited sequentially based on the first video editing algorithm and the second video editing algorithm, the video storage queue 300 may include: the first video 31, the second video 32 and the third video 33.
[0096] In some embodiments, the video editor may read the second video from the video storage queue and then edit the second video based on the second video editing algorithm.
[0097] In other embodiments, the video editor may read the second video from the terminal device's cache and then edit the second video based on the second video editing algorithm.
[0098] The video editing method provided in this application, upon receiving a first video editing operation and a second video editing operation that trigger sequential editing of a first video based on a first video editing algorithm and a second video editing algorithm, firstly creates a video storage queue, then edits the first video based on the first video editing algorithm to obtain a second video, and saves the second video to the video storage queue; and then edits the second video based on the second video editing algorithm to obtain a third video, and saves the third video to the video storage queue. Because the video editing method provided in this application can create a video storage queue to store the video editing results of different video editing algorithms during video editing, and save the video editing results of different video editing algorithms to this video storage queue, this application can directly read the video editing results from the video storage queue when it is necessary to undo some video editing operations, without having to re-edit the original video every time video editing is undone. Therefore, this application can improve the efficiency of video editing.
[0099] Referring to Figure 4, based on the embodiment shown in Figure 1, the video editing method provided in this application further includes the following steps:
[0100] S401, Receive third video editing operation.
[0101] The third video editing operation is used to trigger the undoing of the second video editing operation.
[0102] That is, the video editing result corresponding to the third video editing operation is the video editing result obtained by editing the first video based solely on the first video editing algorithm.
[0103] S402. In response to the third video editing operation, read the second video from the video storage queue to obtain the video editing result corresponding to the third video editing operation.
[0104] Compared to re-editing the first video based on the first video editing operation to obtain the video editing result corresponding to the third video editing operation, the embodiments of this application can directly read the second video from the video storage queue as the video editing result corresponding to the third video editing operation. Therefore, the above embodiments can improve the video editing efficiency.
[0105] Referring to Figure 5, based on the embodiment shown in Figure 1, the video editing method provided in this application further includes the following steps:
[0106] S501, Receive the fourth video editing operation.
[0107] The fourth video editing operation is used to trigger the cancellation of the first video editing operation.
[0108] That is, the video editing result corresponding to the fourth video editing operation is the video editing result obtained by editing the first video based solely on the second video editing algorithm.
[0109] S502. In response to the fourth video editing operation, the first video is edited based on the second video editing algorithm to obtain the fourth video, and the fourth video is saved to the video storage queue.
[0110] Since the video storage queue does not include the video editing result obtained by editing the first video solely based on the second video editing algorithm, this embodiment of the application edits the first video based on the second video editing algorithm to obtain the video editing result obtained by editing the first video solely based on the second video editing algorithm, and saves it to the video storage queue for use in subsequent video editing processes.
[0111] Referring to Figure 6, based on the embodiment shown in Figure 1, the video editing method provided in this application further includes the following steps:
[0112] S601, Receive the fifth video editing operation.
[0113] The fifth video editing operation is used to trigger the editing of the second video based on the third video editing algorithm.
[0114] That is, the video editing result corresponding to the fifth video editing operation is the video editing result obtained by editing the first video sequentially based on the first video editing algorithm, the second video editing algorithm, and the third video editing algorithm.
[0115] S602. In response to the fifth video editing operation, read the second video from the video storage queue, edit the second video based on the third video editing algorithm to obtain the fifth video, and save the fifth video to the video storage queue.
[0116] In some embodiments, step S103 (editing the first video based on the first video editing algorithm to obtain the second video, and saving the second video to the video storage queue) includes:
[0117] Based on the first video editing algorithm, the video frames of the first video are edited one by one to obtain the corresponding video frames of the second video, and the video frames of the second video are saved to the video storage queue respectively.
[0118] Step S104 (editing the second video based on the second video editing algorithm to obtain the third video, and saving the third video to the video storage queue) includes:
[0119] When the video storage queue contains video frames to be edited, the video frames to be edited are edited based on the second video editing algorithm to obtain the corresponding video frames of the third video, and the video frames of the third video are saved to the video storage queue respectively.
[0120] The video frame to be edited is a video frame in the video storage queue of the second video that has not been edited based on the second video editing algorithm.
[0121] It should be noted that when the first video editing algorithm edits the first video frame by frame, it processes the video frames in the first video in any order. For example, when the first video editing algorithm is used to reverse the video, it can start processing the video frames one by one from the end of the first video. As another example, when the first video editing algorithm is used to deblur the video, it can start processing the video frames one by one from the beginning of the first video.
[0122] For example, referring to FIG7, based on the above embodiment, the implementation process of editing the first video sequentially based on the first video editing algorithm and the second video editing algorithm in the video editing method provided in this application includes: First, reading and processing each video frame of the first video 31 by the first video editing tool 71, and writing the video frames of the second video 32 obtained by processing each video frame of the first video 31 based on the first video editing algorithm into the video storage queue 300. The second video editing tool 72 determines whether the video storage queue 300 includes video frames of the second video that have not been edited based on the second video editing algorithm. If not, it waits for the first video editing tool 71 to write new video frames of the second video into the video storage queue 300. If yes, it reads the video frames of the second video that have not been edited based on the second video editing algorithm from the video storage queue 300, and edits the video frames read based on the second video editing algorithm. Then, it writes the video frames of the third video 43 obtained by processing each video frame of the second video 32 based on the second video editing algorithm into the video storage queue 300.
[0123] Since the video frames of the first video can be edited based on the first video editing algorithm, the resulting video frames of the second video can be written into the video storage queue. Moreover, when the video storage queue includes video frames of the second video that have not been edited based on the second video editing algorithm, the editing of the video frames to be edited based on the second video editing algorithm can begin. Therefore, the above embodiment does not need to wait for the first video editing algorithm to complete the editing of all video frames of the first video before performing video editing through the second video editing algorithm. Thus, the embodiment of this application can reduce the editing time of video editing, thereby improving the user experience.
[0124] In some embodiments, the video editing method provided above further includes naming the second video and the third video by performing the following steps:
[0125] Step a: Generate a video ID based on the video content of the first video and the first algorithm.
[0126] In some embodiments, the first algorithm is a hash algorithm. That is, the video content of the first video is calculated using a hash algorithm, and the calculation result is used as the video ID of the original video.
[0127] That is, Video ID = hash(First Video)
[0128] If the draft video obtained from editing uses an absolute path, the filenames of the draft video and the original video may be duplicated. In order to distinguish them, this application embodiment calculates a hash value based on the video content to generate a video ID, and uses this video ID to replace the original video name as part of the naming parameters.
[0129] Step b: Combine the video ID and the configuration parameters of the first video editing algorithm to obtain the first combined value.
[0130] For example, the configuration parameters of a video editing algorithm may include: the type of algorithm used by the video editing algorithm, speed information, and other configuration parameters.
[0131] Let the first stitching value be defined as stitching value_1, and the configuration parameter of the first video editing algorithm be defined as info_1. Then: Stitching value_1 = Video ID + info_1
[0132] Step c: Obtain the first product ID based on the first splicing value and the second algorithm.
[0133] In some embodiments, the second algorithm is a hash algorithm.
[0134] If we define the first product ID as ID_1, then we have: ID_1 = hash(video ID + info_1)
[0135] Step d: Combine the product ID of the second video and the configuration parameters of the second video editing algorithm to obtain the second splicing value.
[0136] Let the second stitching value be defined as stitching value_2, and the configuration parameter of the second video editing algorithm be defined as info_2. Then we have: Stitching value_2 = ID_1 + info_2
[0137] Step e: Obtain the second product ID based on the second splicing value and the second algorithm.
[0138] If we define the ID of the second product as ID_2, then we have: ID_2 = hash(ID_1 + info_2)
[0139] Step f: Name the second video and the third video according to the first product ID and the second product ID, respectively.
[0140] In some embodiments, the second video and the third video are named according to the first product ID and the second product ID, respectively, including:
[0141] The second video is named according to the first product ID, the start timestamp of the second video, and the duration of the second video;
[0142] The third video is named according to the second product ID, the start timestamp of the third video, and the duration of the third video.
[0143] For example, if the second video is in MP4 format, its start timestamp is 02:16, and its duration is 05:30, then the name of the second video could be:
[0144] First Product ID_02:16_05:30.mp4.
[0145] It should be noted that the naming method for the video obtained by further editing the third video based on the video editing algorithm is similar to the naming method for the third video. For example, referring to Figure 8, Figure 8 illustrates the implementation method of naming the products of video editing algorithms based on video editing algorithm A, video editing algorithm B, and video editing algorithm C in sequence. The implementation process of obtaining the names of the video editing results corresponding to video editing algorithm A, video editing algorithm B, and video editing algorithm C includes:
[0146] S81. Perform hash calculation on the video content of the first video to generate a video ID.
[0147] S82. Combine the video ID with the configuration parameters (info_a) of video editing algorithm A to obtain the splicing value corresponding to video editing algorithm A, and perform hash calculation on the splicing value corresponding to video editing algorithm A to generate the product ID (ID_a) of video editing algorithm A.
[0148] S83. Obtain the splicing value corresponding to video editing algorithm B by combining the product ID of video editing algorithm A with the configuration parameters (info_b) of video editing algorithm B, and perform hash calculation on the splicing value corresponding to video editing algorithm B to generate the product ID (ID_b) of video editing algorithm B.
[0149] S84. Obtain the splicing value corresponding to video editing algorithm C by combining the product ID of video editing algorithm B with the configuration parameters (info_c) of video editing algorithm C, and perform hash calculation on the splicing value corresponding to video editing algorithm C to generate the product ID (ID_c) of video editing algorithm C.
[0150] Finally, the names of the video editing results corresponding to video editing algorithms A, B, and C are obtained based on the product IDs of video editing algorithm A, B, and C, respectively.
[0151] Based on the video editing method provided in the above embodiments, the video editing method provided in this application embodiment may further include the following steps ① to ⑥:
[0152] Step ①: Receive the sixth and seventh video editing operations.
[0153] The sixth video editing operation and the seventh video editing operation are used to trigger the editing of the sixth video sequentially based on the first video editing algorithm and the second video editing algorithm; the sixth video and the first video are different video segments that overlap in the same video.
[0154] The overlap between the first video and the sixth video means that the start and / or end point of the first video clip is located between the start and end points of the sixth video clip.
[0155] Step 2: Based on the start and end points of the first video and the start and end points of the sixth video, obtain the segments in the sixth video that belong to the first video and the segments in the sixth video that do not belong to the first video that need to be edited.
[0156] For example, referring to FIG9, the starting point of the first video 91 is S1, the ending point of the first video 91 is E1, the starting point of the sixth video 92 is S2, the ending point of the sixth video 92 is E2, the segment to be spliced in the sixth video 92 that belongs to the first video 91 is video segment 93 (starting point S2, ending point E1), and the segment to be edited in the sixth video 92 that does not belong to the first video 91 is video segment 94 (starting point E1, ending point E2).
[0157] For example, referring to FIG10, the starting point of the first video 101 is S1, the ending point of the first video 101 is E1, the starting point of the sixth video 102 is S2, the ending point of the sixth video 102 is E2, the segment to be spliced in the sixth video 102 that belongs to the first video 101 is video segment 103 (starting point S1, ending point E1), and the segments to be edited in the sixth video 102 that do not belong to the first video 101 include video segment 104 (starting point S2, ending point S1) and video segment 105 (starting point E1, ending point E2).
[0158] Step 3: Read the third video from the video storage queue.
[0159] Step 4: Extract the video editing results corresponding to the segment to be spliced from the third video.
[0160] That is, the video editing result corresponding to the segment to be spliced is cropped from the third video according to the start and end points of the segment to be spliced.
[0161] As illustrated in the example in Figure 9, step ④ involves cutting out video segment 93 from the third video as the video editing result corresponding to the segment to be spliced.
[0162] Step 5: Edit the segment to be edited sequentially based on the first video editing algorithm and the second video editing algorithm to obtain the video editing result corresponding to the segment to be edited.
[0163] As illustrated in the example shown in Figure 10, step ⑤ involves processing video segment 104 and video segment 105 sequentially based on the first video editing algorithm and the second video editing algorithm.
[0164] Step 6: Combine the video editing results corresponding to the segment to be combined and the video editing results corresponding to the segment to be edited to obtain the video editing result corresponding to the seventh video editing operation.
[0165] In the above embodiment, when obtaining the video editing result corresponding to the seventh video editing operation, the starting and ending points of the first video clip and the starting and ending points of the sixth video are used to obtain the segments to be spliced that belong to the first video and the segments to be edited that do not belong to the first video in the sixth video. Then, the video editing result corresponding to the segments to be spliced is extracted from the third video, and the segments to be edited are processed sequentially based on the first video editing algorithm and the second video editing algorithm to obtain the video editing result corresponding to the segments to be edited. Finally, the video editing result corresponding to the segments to be spliced and the video editing result corresponding to the segments to be edited are spliced together to obtain the video editing result corresponding to the seventh video editing operation. Therefore, the above embodiment can avoid repeatedly processing video segments, thereby further improving the efficiency of video editing.
[0166] Based on the video editing method provided in the above embodiments, the video editing method provided in this application embodiment may further include the following steps 1 and 2:
[0167] Step 1: Receive the eighth and ninth video editing operations.
[0168] The first video editing operation and the second video editing operation are used to trigger the editing of the seventh video based on the first video editing algorithm and the second video editing algorithm respectively, wherein the seventh video belongs to the first video.
[0169] In this embodiment of the application, the seventh video belonging to the first video means that the start and end points of the seventh video are both located between the start and end points of the first video.
[0170] Step 2: Crop the third video according to the start and end points of the seventh video to obtain the video editing result corresponding to the ninth video editing operation.
[0171] In other words, when the length of the first video is shortened, the third video can be directly cropped without having to process the new video again.
[0172] Based on the same inventive concept, as an implementation of the above method, this application also provides a video editing device. This embodiment corresponds to the aforementioned method embodiment. For ease of reading, this embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the video editing device in this embodiment can implement all the contents of the aforementioned method embodiment.
[0173] This application provides a video editing device. Figure 11 is a schematic diagram of the structure of the video editing device. As shown in Figure 11, the video editing device 1100 includes:
[0174] The receiving unit 111 is used to receive a first video editing operation and a second video editing operation; the first video editing operation and the second video editing operation are used to trigger the editing of the first video sequentially based on the first video editing algorithm and the second video editing algorithm;
[0175] Create unit 112 to create a video storage queue;
[0176] Editing unit 113 is used to edit the first video based on the first video editing algorithm to obtain a second video, and save the second video to the video storage queue;
[0177] The editing unit 113 is further configured to edit the second video based on the second video editing algorithm to obtain a third video, and save the third video to the video storage queue.
[0178] As an optional implementation method of this application,
[0179] The receiving unit 111 is further configured to receive a third video editing operation; the third video editing operation is configured to trigger the cancellation of the second video editing operation;
[0180] The editing unit 113 is further configured to, in response to the third video editing operation, read the second video from the video storage queue to obtain the video editing result corresponding to the third video editing operation.
[0181] As an optional implementation method of this application,
[0182] The receiving unit 111 is further configured to receive a fourth video editing operation; the fourth video editing operation is configured to trigger the cancellation of the first video editing operation;
[0183] The editing unit 113 is further configured to, in response to the fourth video editing operation, edit the first video based on the second video editing algorithm to obtain the fourth video, and save the fourth video to the video storage queue.
[0184] As an optional implementation method of this application,
[0185] The receiving unit 111 is further configured to receive a fifth video editing operation; the fifth video editing operation is configured to trigger editing of the second video based on a third video editing algorithm;
[0186] The editing unit 113 is further configured to, in response to the fifth video editing operation, read the second video from the video storage queue, edit the second video based on the third video editing algorithm to obtain the fifth video, and save the fifth video to the video storage queue.
[0187] As an optional implementation of this application, the editing unit 113 is specifically used to edit the video frames of the first video one by one based on the first video editing algorithm to obtain the corresponding video frames of the second video, and save the video frames of the second video to the video storage queue respectively; when the video storage queue includes video frames to be edited, the video frames to be edited are edited based on the second video editing algorithm to obtain the corresponding video frames of the third video, and the video frames of the third video are saved to the video storage queue respectively, wherein the video frames to be edited are the video frames of the second video stored in the video storage queue that have not been edited based on the second video editing algorithm.
[0188] As an optional implementation of this application, the editing unit 113 is further configured to: generate a video ID based on the video content of the first video and the first algorithm; concatenate the video ID and the configuration parameters of the first video editing algorithm to obtain a first concatenation value; obtain the first product ID based on the first concatenation value and the second algorithm; concatenate the product ID of the second video and the configuration parameters of the second video editing algorithm to obtain a second concatenation value; obtain the second product ID based on the second concatenation value and the second algorithm; and name the second video and the third video based on the first product ID and the second product ID, respectively.
[0189] As an optional implementation of this application, the editing unit 113 is specifically used to name the second video according to the first product ID, the start timestamp of the second video, and the duration of the second video; and to name the third video according to the second product ID, the start timestamp of the third video, and the duration of the third video.
[0190] As an optional implementation method of this application,
[0191] The receiving unit 111 is further configured to receive a sixth video editing operation and a seventh video editing operation, the sixth video editing operation and the seventh video editing operation being configured to trigger editing of a sixth video sequentially based on the first video editing algorithm and the second video editing algorithm; the sixth video and the first video are different video segments that overlap within the same video;
[0192] The editing unit 113 is further configured to: obtain, based on the start and end points of the first video and the start and end points of the sixth video, segments in the sixth video that belong to the first video and segments in the sixth video that do not belong to the first video that need to be edited; read the third video from the video storage queue; extract the video editing results corresponding to the segments to be spliced from the third video; edit the segments to be edited sequentially based on the first video editing algorithm and the second video editing algorithm to obtain the video editing results corresponding to the segments to be edited; and splice the video editing results corresponding to the segments to be spliced and the video editing results corresponding to the segments to be edited to obtain the video editing results corresponding to the seventh video editing operation.
[0193] The video editing device provided in this application embodiment can execute the video editing method provided in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0194] Based on the same inventive concept, this application also provides an electronic device. Figure 12 is a schematic diagram of the structure of the electronic device provided in this application embodiment. As shown in Figure 12, the electronic device provided in this embodiment includes: a memory 121 and a processor 122. The memory 121 is used to store a computer program, and the processor 122 is used to execute the video editing method provided in the above embodiment when executing the computer program.
[0195] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the computing device to implement the video editing method provided in the above embodiments.
[0196] Based on the same inventive concept, this application also provides a computer program product that, when run on a computer, enables the computing device to implement the video editing method provided in the above embodiments.
[0197] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0198] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0199] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0200] Computer-readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media can store information using any method or technology; the information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0201] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some or all of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A video editing method, comprising: Receive the first video editing operation and the second video editing operation; The first video editing operation and the second video editing operation are used to trigger the editing of the first video based on the first video editing algorithm and the second video editing algorithm in sequence; Create a video storage queue; The first video is edited based on the first video editing algorithm to obtain the second video, and the second video is saved to the video storage queue; as well as The second video is edited based on the second video editing algorithm to obtain the third video, and the third video is saved to the video storage queue.
2. The method according to claim 1, further comprising: Receive third-party video editing operations; The third video editing operation is used to trigger the undo of the second video editing operation; as well as In response to the third video editing operation, the second video is read from the video storage queue to obtain the video editing result corresponding to the third video editing operation.
3. The method according to claim 1, further comprising: Receive the fourth video editing operation; The fourth video editing operation is used to trigger the undo of the first video editing operation; as well as In response to the fourth video editing operation, the first video is edited based on the second video editing algorithm to obtain the fourth video, and the fourth video is saved to the video storage queue.
4. The method according to claim 1, further comprising: Receive the fifth video editing operation; The fifth video editing operation is used to trigger the editing of the second video based on the third video editing algorithm; as well as In response to the fifth video editing operation, the second video is read from the video storage queue, the second video is edited based on the third video editing algorithm to obtain the fifth video, and the fifth video is saved to the video storage queue.
5. The method according to any one of claims 1-4, The process of editing the first video based on the first video editing algorithm to obtain the second video and saving the second video to the video storage queue includes: Based on the first video editing algorithm, the video frames of the first video are edited one by one to obtain the corresponding video frames of the second video, and the video frames of the second video are saved to the video storage queue respectively. The process of editing the second video based on the second video editing algorithm to obtain a third video and saving the third video to the video storage queue includes: When the video storage queue includes video frames to be edited, the video frames to be edited are edited based on the second video editing algorithm to obtain the corresponding video frames of the third video, and the video frames of the third video are saved to the video storage queue respectively. The video frames to be edited are the video frames of the second video saved in the video storage queue that have not been edited based on the second video editing algorithm.
6. The method according to any one of claims 1-4, further comprising: Based on the video content of the first video and the first algorithm, a video ID is generated; The video ID and the configuration parameters of the first video editing algorithm are concatenated to obtain the first concatenation value; Based on the first concatenation value and the second algorithm, obtain the first product ID; The second splicing value is obtained by combining the product ID of the second video and the configuration parameters of the second video editing algorithm; Based on the second concatenation value and the second algorithm, obtain the second product ID; as well as The second video and the third video are named according to the first product ID and the second product ID, respectively.
7. The method according to claim 6, wherein naming the second video and the third video according to the first product ID and the second product ID respectively includes: The second video is named according to the first product ID, the start timestamp of the second video, and the duration of the second video; as well as The third video is named according to the second product ID, the start timestamp of the third video, and the duration of the third video.
8. The method according to any one of claims 1-4, further comprising: Receive a sixth video editing operation and a seventh video editing operation, the sixth video editing operation and the seventh video editing operation being used to trigger the editing of the sixth video sequentially based on the first video editing algorithm and the second video editing algorithm; The sixth video and the first video are different video segments that overlap within the same video; Based on the start and end points of the first video and the start and end points of the sixth video, obtain the segments in the sixth video that belong to the first video and the segments in the sixth video that do not belong to the first video that need to be edited; Read the third video from the video storage queue; Extract the video editing results corresponding to the segment to be spliced from the third video; The segment to be edited is edited sequentially based on the first video editing algorithm and the second video editing algorithm to obtain the video editing result corresponding to the segment to be edited; as well as The video editing results corresponding to the segment to be spliced and the video editing results corresponding to the segment to be edited are combined to obtain the video editing result corresponding to the seventh video editing operation.
9. A video editing device, comprising: The receiving unit is used to receive the first video editing operation and the second video editing operation; The first video editing operation and the second video editing operation are used to trigger the editing of the first video based on the first video editing algorithm and the second video editing algorithm in sequence; Create a unit to create a video storage queue; An editing unit is configured to edit the first video based on the first video editing algorithm to obtain a second video, and save the second video to the video storage queue; as well as The editing unit is further configured to edit the second video based on the second video editing algorithm to obtain a third video, and save the third video to the video storage queue.
10. An electronic device, comprising: A memory and a processor, the memory being used to store a computer program and the processor being used to cause the electronic device to implement the video editing method according to any one of claims 1-8 when executing the computer program.
11. A computer-readable storage medium storing a computer program that, when executed by a computing device, causes the computing device to implement the video editing method according to any one of claims 1-8.
12. A computer program product, when run on a computer, causes the computer to implement the video editing method according to any one of claims 1-8.
Citation Information
Patent Citations
Video editing method and system
CN108600843A
Online collaborative video editing method and device
CN111277905A
Video processing method and electronic equipment
CN114845157A
Target object processing method and device and electronic equipment
CN114968564A
Dynamically providing customized versions of video content
US20200092610A1