Video editing method and apparatus, electronic device and storage medium

By generating and adjusting the properties of editing materials on the video playback layer, the system addresses users' needs for flexibility and diversity in video editing, achieving privacy protection and personalized addition of dynamic materials, thus improving the efficiency of video editing.

WO2026001780A1PCT designated stage Publication Date: 2026-01-02HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/101669
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-26
Filing Date
2025-06-18
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Existing technologies are insufficient to meet users' needs for flexible video editing, especially in terms of protecting privacy information, adding personalized materials, and generating dynamic materials.

Method used

The editing footage is generated on the original video playback layer, and its properties are adjusted during video playback. The adjustment process is recorded, and an edited video with the edited footage is generated.

Benefits of technology

It enables greater flexibility and diversity in video editing, meeting users' needs for privacy protection, personalized additions, and dynamic materials, thereby improving the efficiency and flexibility of video editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025101669_02012026_PF_FP_ABST
    Figure CN2025101669_02012026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing. Provided in the embodiments of the present application are a video editing method and apparatus, an electronic device and a storage medium. The method comprises: in response to an operation of adding an editing material, generating at a layer above an original video playback layer an editing material; during playback of the original video, adjusting the properties of the editing material so that the editing material changes along with the video playback, the editing material being manually adjusted and / or automatically adjusted; recording the process of adjustment of the properties of the editing material during a playback time period of the original video; and, in response to a video saving operation, on the basis of the original video and the recorded process of adjustment of the properties of the editing material, generating an edited video with the editing material, wherein changes of the editing material during playback of the edited video are consistent with the adjustment process. The solution provided by the embodiments of the present application can be used for video editing.
Need to check novelty before this filing date? Find Prior Art

Description

Video editing method and device, electronic device and storage medium

[0001] The present application claims priority to the Chinese patent application No. 202410840749.0, filed on June 26, 2024, and entitled "Video editing method and device, electronic device and storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

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

[0003] Video is widely used in various scenarios due to its large amount of information and rich content. Users have different needs for using video in different scenarios, and video editing is often needed to meet their own needs.

[0004] For example, there may be user privacy information in the video, which may lead to user privacy leakage if the video is directly used. Therefore, the video needs to be edited to protect user privacy. SUMMARY

[0005] The purpose of the embodiments of the present application is to provide a video editing method and device, electronic device and storage medium to edit video. The specific technical solutions are as follows:

[0006] In a first aspect, the embodiments of the present application provide a video editing method, which comprises:

[0007] In response to an editing material adding operation, generating an editing material on a layer above an original video playing layer;

[0008] During the original video playing process, adjusting the properties of the editing material to make the editing material change with the video playing, wherein the adjustment of the editing material is artificial adjustment and / or automatic adjustment;

[0009] Recording the adjustment process of the properties of the editing material in the time period of the original video playing;

[0010] In response to a video saving operation, generating an edited video with the editing material according to the original video and the recorded adjustment process of the properties of the editing material, wherein the change of the editing material in the edited video during the playing process is the same as the adjustment process.

[0011] In a second aspect, the embodiments of the present application provide a video editing device, which comprises:

[0012] The editing material generation module is configured to generate the editing material on a layer above the original video playing layer in response to an adding editing material operation.

[0013] The editing material adjustment module is configured to adjust the attribute of the editing material in the process of playing the original video, so that the editing material changes with the video playing, wherein the adjustment of the editing material is manual adjustment and / or automatic adjustment.

[0014] The adjustment process recording module is configured to record the adjustment process of the attribute of the editing material in the time period of playing the original video.

[0015] The video generation module is configured to generate an edited video with the editing material in response to a video saving operation, according to the original video and the recorded adjustment process of the attribute of the editing material, wherein the edited video changes the editing material in the playing process, and the change of the editing material is the same as the adjustment process.

[0016] In a third aspect, an electronic device is provided, comprising:

[0017] The memory is configured to store a computer program.

[0018] The processor is configured to execute the program stored in the memory, and implement the method of the first aspect.

[0019] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method of the first aspect.

[0020] In a fifth aspect, a computer program product containing instructions is provided, and when the computer program product is executed on a computer, the computer program product causes the computer to execute the method of the first aspect.

[0021] As can be seen from the above, when the scheme provided in the embodiments of the present application is applied to video editing, the editing material can be generated on a layer above the original video playing layer. Then, in the process of playing the original video, the attribute of the editing material can be adjusted, so that the editing material changes with the video playing, and the adjustment process of the attribute of the editing material in the time period of playing the original video is recorded. In this way, in response to a video saving operation, an edited video with the editing material can be generated according to the original video and the recorded adjustment process of the attribute of the editing material, which realizes adding the editing material to the video picture, that is, editing the video.

[0022] In addition, the attribute of the edited material can be adjusted during the playing of the original video, that is, the attribute of the generated edited material is not fixed during the playing of the original video, but can be changed flexibly at any time, and the edited material can have different attributes at different video playing times. In this way, after recording the adjustment process of the attribute of the edited material in the time period of the playing of the original video, the edited video with the attribute of the edited material changing continuously can be generated according to the original video and the adjustment process of the attribute of the edited material, and the change of the edited material in the edited video is the same as the adjustment process, which can meet the diversified video editing needs of the user and improve the flexibility during video editing.

[0023] Of course, implementing any product or method of the present application does not necessarily require achieving all the advantages described above at the same time. BRIEF DESCRIPTION OF DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.

[0025] FIG. 1a is a schematic diagram of a first video editing interface provided by an embodiment of the present application;

[0026] FIG. 1b is a schematic diagram of a second video editing interface provided by an embodiment of the present application;

[0027] FIG. 1c is a schematic diagram of a third video editing interface provided by an embodiment of the present application;

[0028] FIG. 1d is a schematic diagram of a fourth video editing interface provided by an embodiment of the present application;

[0029] FIG. 1e is a schematic diagram of a fifth video editing interface provided by an embodiment of the present application;

[0030] FIG. 1f is a schematic diagram of a sixth video editing interface provided by an embodiment of the present application;

[0031] FIG. 1g is a schematic diagram of a seventh video editing interface provided by an embodiment of the present application;

[0032] FIG. 1h is a schematic diagram of an eighth video editing interface provided by an embodiment of the present application;

[0033] FIG. 1i is a schematic diagram of a ninth video editing interface provided by an embodiment of the present application;

[0034] FIG. 1j is a schematic diagram of a tenth video editing interface provided by an embodiment of the present application;

[0035] FIG. 1k is a schematic diagram of a twelfth video editing interface according to an embodiment of the present application;

[0036] FIG. 1k is a schematic diagram of a twelfth video editing interface according to an embodiment of the present application;

[0037] FIG. 2 is a schematic diagram of a video editing method according to an embodiment of the present application;

[0038] FIG. 3a is a schematic diagram of a thirteenth video editing interface according to an embodiment of the present application;

[0039] FIG. 3b is a schematic diagram of a fourteenth video editing interface according to an embodiment of the present application;

[0040] FIG. 3c is a schematic diagram of a fifteenth video editing interface according to an embodiment of the present application;

[0041] FIG. 3d is a schematic diagram of a sixteenth video editing interface according to an embodiment of the present application;

[0042] FIG. 4a is a schematic diagram of a path point according to an embodiment of the present application;

[0043] FIG. 4b is a schematic diagram of a first scaling amount according to an embodiment of the present application;

[0044] FIG. 4c is a schematic diagram of a second scaling amount according to an embodiment of the present application;

[0045] FIG. 5 is a schematic diagram of an editing material change process according to an embodiment of the present application;

[0046] FIG. 6 is a signaling interaction diagram of a video editing method according to an embodiment of the present application;

[0047] FIG. 7 is a schematic diagram of a video editing apparatus according to an embodiment of the present application;

[0048] FIG. 8 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art based on the present application are within the scope of protection of the present application.

[0050] First, the execution subject of the solution provided in the embodiments of the present application is described.

[0051] The execution subject of the scheme provided in the embodiments of the present application is: any electronic device with data processing, storage and other functions.

[0052] The electronic device is not limited in the embodiments of the present application. In one case, the electronic device can be a computer installed with video editing software for implementing the scheme provided in the embodiments of the present application.

[0053] The application scenarios of the scheme provided in the embodiments of the present application are described below.

[0054] The application scenarios of the scheme provided in the embodiments of the present application are: various scenarios in which a user edits a video, which are exemplarily introduced below.

[0055] In one case, there can be user privacy information in the video. In order to prevent the leakage of the privacy information, the user needs to shield the area where the privacy information is located in the video to protect the user privacy security. For example, the user can want to let the mosaic shield the license plate number in the video.

[0056] In another case, the user needs to label or add a sticker to an object in the video picture to meet the personalized needs. For example, the user can want to display a text box describing personnel A near personnel A to realize the labeling of personnel A. For another example, the user can want to add a sticker near food, animals or persons in the video picture to make the video style more lively and the content more rich.

[0057] In another case, the user wants to generate materials that move constantly with the playing of the video picture. For example, after the user adds a sticker or special effect to the video picture, the user can want to generate the sticker or special effect that moves from the left side of the video picture to the right side of the video picture with the playing of the video picture.

[0058] In order to facilitate the understanding of the scheme provided in the embodiments of the present application, the scheme provided in the embodiments of the present application is introduced below from the perspective of the operation performed by the user when editing a video by using a video editing software and the interface change of the video editing software in response to the user operation (the above operation is divided into four stages below).

[0059] It should be noted that the user operation and the interface change of the video editing software in response to the user operation shown below are only one embodiment of the scheme provided in the present application, and do not constitute a limitation on the scheme provided in the present application.

[0060] Stage 1: Open a video file by using the video editing software installed in the electronic device, and click the play button on the interface of the video editing software. The electronic device starts playing the video picture.

[0061] The video file can be any video file stored in the electronic device, and embodiments of the present application do not limit the video file. In one case, the video file can be a video file collected by a camera deployed on a road.

[0062] The video editing software is pre-installed in the electronic device, and the user can open the video file through the video editing software.

[0063] In one embodiment, the user can browse the video file to be edited from the local file system, right-click the video file to be edited, select the "open mode" option from the expanded tabs, and then select the video editing software from the sub-options of the open mode option.

[0064] In another embodiment, the user can open the video editing software, click the "file" button in the video editing software, click the "open" option from the expanded tabs, enter the local file system, select the video to be edited, and thus open the video file in the video editing software.

[0065] After opening the video file, as shown in FIG. 1a, the video editing interface 10 displays the video in a paused state by default. The user can click the pause button 101 on the video editing interface 10, and then the pause button 101 changes to a play button 102, and the video editing software starts playing the video. FIG. 1a also shows a speed adjustment control 103 for adjusting the speed of the video playback. In FIG. 1a and the subsequent video editing interface-related drawings, the text or icons displayed are used to represent the related controls or related display information on the video editing software interface, and do not need to be paid attention to unless otherwise specified.

[0066] Stage 2: Trigger the add editing material operation, and the electronic device generates the editing material in the layer above the original video playback layer.

[0067] After generating the editing material, the editing material will be displayed above the video playback layer with the video playing the editing material.

[0068] The add editing material operation is used to indicate the addition of editing material on the video, which can be triggered in multiple ways. Depending on the triggering method, the generated editing material can also be in different areas in the layer, which will be introduced below.

[0069] In one embodiment, the user can click the editing material addition control on the video editing interface, and the click operation of the editing material addition control is the add editing material operation. In this case, the editing material can be generated in a preset area above the original video playback layer.

[0070] The above-mentioned editing material adding control is used to add an editing material to a video. There can be one editing material adding control on the video editing interface, or there can be different editing material adding controls.

[0071] Referring to FIG. 1b, it can be seen that the editing material adding controls on the video editing interface can include an add text control 104, an add mosaic control 105, and an add sticker control 106. The above-mentioned editing material adding controls are respectively used to add a text, a mosaic, and a sticker to a region to be edited in a video.

[0072] Of course, the editing material adding controls can also include an add special effect control, an add letter control, and the like, which are not limited in the embodiments of the present application.

[0073] The above-mentioned preset region can be a preset middle region, a preset upper region, a preset lower region, and the like in a layer, which are not limited in the embodiments of the present application.

[0074] In the present embodiment, after the user clicks the editing material adding control, an editing material can be generated in the preset region on the layer, without the need to frame a region for the editing material generation on the video screen, and the operation is relatively convenient.

[0075] In another embodiment, the user can click the editing material adding control on the video editing interface to perform a region framing operation on the upper layer of the video playing screen. The clicking operation of the editing material adding control and the region framing operation are the adding editing material operation. In this case, an editing material can be generated in the upper layer of the original video playing layer for the region to be edited in the video playing screen.

[0076] The above-mentioned region to be edited will be introduced below.

[0077] In the present embodiment, the above-mentioned region to be edited can be a region corresponding to the region framed by the region framing operation in the video screen. It should be noted that after the user selects one editing material adding control, one or more region framing operations can be performed. When one region framing operation is performed, the above-mentioned region to be edited can be one region in the video screen. When multiple region framing operations are performed, the above-mentioned region to be edited can be multiple different regions in the video screen.

[0078] In one case, the user can perform a region framing operation on the upper layer of the video playing screen according to the position and size of the object to be edited in the currently played video screen.

[0079] In this case, the above-mentioned region to be edited is a region determined based on the region where the object to be edited is located in the video screen.

[0080] The to-be-edited object can be any object in the video picture, for example, can be an object to be occluded, or an object to be labeled, etc., which can be set according to actual needs, and embodiments of the present application do not limit this.

[0081] Referring to FIG. 1c, taking adding a mosaic in a video as an example, a user wants to occlude a license plate number in a video picture by using a mosaic, the user clicks the add mosaic control 105, and then performs a region framing operation in an upper layer of the video playing picture according to a position and a size of a region where the license plate (to-be-edited object) is located in the video picture, at this time, the to-be-edited region is a region 107 corresponding to the region framed by the region framing operation in the video picture. In this way, a mosaic 108 can be generated in the to-be-edited region 107.

[0082] It can be seen that in this case, the to-be-edited region is actually a region where the to-be-edited object is located in the video picture.

[0083] Referring to FIG. 1d, taking adding a text box in a video as an example, a user wants to label a person in a video picture by using a text box, the user clicks the add text box control 104, and then performs a region framing operation in an upper layer of the video playing picture according to a position and a size of a region where the person (to-be-edited object) is located in the video picture, at this time, the to-be-edited region is a region 109 corresponding to the region framed by the region framing operation in the video picture. In this way, a text box 110 can be generated in the to-be-edited region 109, and a word "person A" input by the user in the text box 110 is obtained, finally, a text box 111 including text is generated on the video picture, and the text box 111 includes the text "person A".

[0084] It can be seen that in this case, the to-be-edited region is not a region where the to-be-edited object is located in the video picture, but a region determined based on the region where the to-be-edited object is located in the video picture.

[0085] In the above manner, the user determines a to-be-edited region according to a to-be-edited object on a playing video picture, so that the electronic device can generate an editing material in the to-be-edited region.

[0086] Of course, as the video is played, when a new to-be-edited object appears on the video picture, the user can determine a new to-be-edited region for the new to-be-edited object in the above manner, so that the electronic device can generate a new editing material in the new to-be-edited region, which is not described herein again.

[0087] It should be noted that the editing material generated in the to-be-edited region can be with a background color or without a background color, and can be with a border line or without a border line. For example, the text box generated in the to-be-edited region can be without a background color and with a border line. In addition, the transparency, the border line width, and the border line type of the editing material generated in the to-be-edited region can be adjusted, and details are not described herein.

[0088] It should be noted that the examples shown in FIGS. 1c and 1d are cases in which there is only one to-be-edited object on the video screen. In a case in which there are multiple to-be-edited objects on the video screen, the user can repeat the above operations for each to-be-edited object, thereby determining multiple to-be-edited regions, and generating multiple editing materials for the determined multiple to-be-edited regions. The case in which there are multiple to-be-edited objects is described below based on FIG. 1e.

[0089] Referring to FIG. 1e, the video screen includes a vehicle and a person. The user can first generate a mosaic 108 for the license plate in the vehicle, and then generate a text box 111 for the person. The processes of generating the mosaic and the text box are the same as those shown in FIGS. 1c and 1d, and are omitted in FIG. 1e.

[0090] In another implementation, the user can click the intelligent editing control on the video editing interface, and then the electronic device can perform target recognition on the currently played video screen, automatically determine the to-be-edited object therein, and determine the to-be-edited region in the video playing screen according to the position and size of the to-be-edited object.

[0091] Referring to FIG. 1f, the user clicks the intelligent editing control 112, and then the electronic device determines the license plate as the to-be-edited object by performing target recognition on the currently played video screen, and then determines the to-be-edited region 113 according to the position and size of the region in which the license plate is located in the video screen. In this way, the mosaic 114 can be generated in the to-be-edited region 113.

[0092] In an embodiment of the present application, after the user clicks the intelligent editing control, an object selection control can be popped up on the video editing interface, and preset to-be-edited objects can be displayed in the object selection control. The user can select the to-be-edited object in the object selection control, and the electronic device recognizes the to-be-edited object selected by the user in the video screen.

[0093] In an embodiment of the present application, after the user clicks the intelligent editing control, an editing type control can be popped up on the video editing interface, and preset editing types can be displayed in the editing type control. The user can select the editing type in the object selection control, and the electronic device determines the to-be-edited region in the video screen according to the editing type selected by the user.

[0094] For example, if the editing type selected by the user is the occlusion type, the electronic device can directly determine the region in which the object to be edited is located in the video picture as the region to be edited; if the editing type selected by the user is the annotation type, the electronic device can determine the region to be edited based on the region in which the object to be edited is located in the video picture, for example, determine a region at a preset distance from the region in which the object to be edited is located in the video picture in a target direction as the region to be edited, where the target direction can be any direction such as up, down, etc., which is not limited in the embodiments of the present application.

[0095] In the above manner, the electronic device determines the region to be edited according to the object to be edited on the played video picture, so that the editing material can be generated in the region to be edited. It should be noted that the electronic device can perform object following recognition on the object to be edited in the video picture, and when the electronic device recognizes a new object to be edited as the video is played, the electronic device can determine a new region to be edited for the new object to be edited in the above manner, so that a new editing material can be generated in the new region to be edited, which will not be described herein.

[0096] It should be noted that the example shown in FIG. 1f is a case where there is only one object to be edited on the video picture, and in a case where the electronic device detects that there are multiple objects to be edited on the video picture, the above operation can be repeated for each object to be edited, so that multiple regions to be edited are determined, and multiple editing materials are generated for the determined multiple regions to be edited.

[0097] In an embodiment of the present application, the above adding editing material operation can be an editing operation on the played video in a preset speed.

[0098] The preset speed can be less than 1, for example, 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.

[0099] That is, the above adding editing material operation can be an editing operation on the played video in a slow playback state.

[0100] When the video is in a slow playback state, the position and size of the object to be edited in the video picture also change relatively slowly. Since the position and size of the region to be edited can be determined based on the position and size of the object to be edited in the video picture, this is advantageous to improve the accuracy when the position and size of the region to be edited are subsequently determined, and thus can improve the accuracy when the position and size of the generated editing material are adjusted according to the change of the position and size of the region to be edited.

[0101] The preset speed can also be greater than 1, for example, 1.5, 2, 4, etc.

[0102] That is, the adding and editing material operation described above can be an editing operation for the played video when the video is in the fast play state.

[0103] When the video is in the fast play state, the video frames are switched quickly, and the time required to play the entire video is short. In this case, the editing material can be quickly added to the video frame, and the video editing efficiency is improved.

[0104] Of course, the preset speed described above can also be a normal speed, i.e., 1 speed.

[0105] Stage 3: Adjust the properties of the editing material during the playing of the original video.

[0106] In one case, the user can adjust the properties of the editing material during the playing of the original video according to the user's individual needs.

[0107] In this case, the user can flexibly adjust the properties of the editing material according to the user's preferences, which will be introduced below through three examples.

[0108] Example 1:

[0109] After generating the special effect in the upper area of the upper layer of the original video playing layer, if the user wants to achieve the effect of moving the special effect from the upper area of the video frame to the lower area, the user can adjust the position of the generated special effect from top to bottom during the playing of the original video.

[0110] Example 2:

[0111] After generating the map in the upper area of the upper layer of the original video playing layer, during the playing of the original video, the user can adjust the transparency, color, line width, line type, appearance, and disappearance of the generated map. Settings.

[0112] The line width described above can refer to the width of the border line of the map, which can be 1 width unit, 2 width units, etc.; the line type described above can refer to the line type of the border line of the map, which can be a solid line type, a dashed line type, etc.

[0113] The appearance described above can include direct appearance, appearance according to fade-in, etc.; the disappearance described above can include direct disappearance, disappearance according to fade-out, etc.

[0114] Example 3:

[0115] After generating the map in the upper area of the upper layer of the original video playing layer, during the playing of the original video, the user can adjust the rotation angle of the generated map.

[0116] Referring to FIG. 1g, the video is playing at a speed of 1 / 16, after the cloud-shaped sticker 120 is generated in the video picture, the user wants to change the rotation angle of the sticker 120, and thus the user can drag the rotation control point 1201 of the sticker 120, so that the sticker 120 can be rotated as a whole in the direction of the arrow by dragging the rotation control point 1201 in the direction of the arrow.

[0117] The rotation control point 1201 can be called out by clicking the sticker, double-clicking the sticker, and the like, which are not limited in the embodiments of the present application.

[0118] In another case, the user can adjust the attribute of the to-be-edited region according to the attribute change of the to-be-edited object, so that the electronic device can adjust the attribute of the generated editing material according to the attribute change of the to-be-edited region.

[0119] As known from the foregoing, the position and size of the to-be-edited region can be determined based on the position and size of the to-be-edited object in the video picture, and thus the position and size of the to-be-edited region can change with the position and size of the to-be-edited object in the video picture.

[0120] In an embodiment of the present application, the position and size of the generated editing material can be adjusted when the video is playing at a preset speed.

[0121] The following introduces the way of adjusting the position and size of the generated editing material by taking the to-be-edited region as an example.

[0122] In a first case, the position of the generated editing material is adjusted.

[0123] First, taking the editing material as a mosaic as an example, referring to FIG. 1h, the video is playing at a speed of 1 / 16, after the mosaic 108 is generated in the region where the license plate is located in the video picture, the video editing software will play the mosaic 108 in the upper layer of the video picture with the playing of the video. With the playing of the video, the vehicle in the video picture moves from the right side of the video picture to the left side of the video picture in the driving process, and thus the license plate also moves from the right side of the video picture to the left side of the video picture. In this way, the user can drag the generated mosaic 108 according to the change of the position of the license plate in the video picture, and adaptively drag the mosaic 108 from the right side to the left side, so that the mosaic 108 can dynamically shield the license plate.

[0124] As shown in FIG. 1h, the user starts to drag the mosaic 108 when the video plays to the first second, and continuously drags the mosaic 108 as the video plays, and drags the mosaic 108 from the first position to the second position when the video plays to the third second; continues to drag the mosaic 108 as the video plays, and drags the mosaic 108 from the second position to the third position when the video plays to the fifth second, so that the mosaic 108 can dynamically obscure the license plate.

[0125] Again, taking the editing material as a sticker as an example, referring to FIG. 1i, the video is playing at 1 / 16 speed, and after the sticker 118 is generated in the area where the license plate is located in the video picture, the video editing software will play the sticker 118 on the upper layer of the video picture as the video plays. As the video plays, the vehicle in the video picture continuously moves from the right side of the video picture to the left side of the video picture, so that the license plate also continuously moves from the right side of the video picture to the left side of the video picture. In this way, the user can drag the generated sticker 118 according to the change of the position of the license plate in the video picture, and adaptively drag the sticker 118 from the right side to the left side, so that the sticker 118 can dynamically obscure the license plate.

[0126] As shown in FIG. 1i, the user starts to drag the sticker 118 when the video plays to the first second, and continuously drags the sticker 118 as the video plays, and drags the sticker 118 from the first position to the second position when the video plays to the third second; continues to drag the sticker 118 as the video plays, and drags the sticker 118 from the second position to the third position when the video plays to the fifth second, so that the sticker 118 can dynamically obscure the license plate.

[0127] The second case is to adjust the size of the generated editing material.

[0128] Referring to FIG. 1j, the video is playing at 1 / 16 speed, and after the mosaic 115 is generated in the area where the license plate is located in the video picture, the video editing software will play the mosaic 115 on the upper layer of the video picture, and as the video plays, the vehicle in the video picture continuously approaches the video acquisition device in the driving process, so that the size of the vehicle in the video picture becomes larger and larger, and the size of the license plate also becomes larger and larger. In this way, the user can stretch the generated mosaic 115 according to the change of the size of the license plate in the video picture, and adaptively stretch the mosaic 115 from small to large, so that the mosaic 115 can dynamically obscure the license plate.

[0129] As shown in FIG. 1j, the user starts to stretch the mosaic 115 when the video plays to the first second, and continuously stretches the mosaic 115 as the video plays, and stretches the size of the mosaic 115 to the same size as the license plate when the video plays to the third second, so that the mosaic 115 can dynamically obscure the license plate.

[0130] Of course, the user can also reduce the generated mosaics from large to small according to actual conditions, and the embodiments of the application will not be repeated.

[0131] Also, in some cases, when adjusting the size of the generated editing material, the shape of the editing material can change.

[0132] For example, if the shape of the editing material is a rectangle, after adjusting the size of the editing material, the length and width of the editing material are changed to the same value, and the shape of the adjusted editing material is a square.

[0133] It should be noted that the examples shown in FIGS. 1h-1j are cases of adjusting the position and size of a generated editing material according to the position and size of the region to be edited. In the case of generating multiple editing materials, the above operation of adjusting the properties of the editing material can be performed for each generated editing material, so that multiple editing materials can change with the properties of the region to be edited.

[0134] When the region to be edited is a region automatically determined by the electronic device, the electronic device can continuously detect the position and size of the editing target in the video picture, determine the properties of the region to be edited according to the detected position and size, and adaptively adjust the properties of the generated editing material to be consistent with the properties of the region to be edited. In the case of generating multiple editing materials, the electronic device can simultaneously perform the above property adjustment operation for each generated editing material, so that the properties of multiple editing materials can be adjusted simultaneously.

[0135] In the case of text box and picture paste, the way to adjust the size of the generated editing material is similar to the case of the above-mentioned editing material being a mosaic, which will not be repeated here.

[0136] The third case is to adjust the shape of the generated editing material.

[0137] In some cases, by adjusting the shape of the generated editing material, the generated editing material can cover the region to be edited in real time.

[0138] Referring to FIG. 1k, the video is playing at a speed of 1 / 16, and after the ellipsoidal sticker 119 is generated in the area where the license plate is located in the video picture, the video editing software plays the sticker 119 on the upper layer of the video picture. As the video plays, the vehicle in the video picture continuously approaches the video capture device during the driving process, so the size of the vehicle in the video picture becomes larger and larger, and the size of the license plate also becomes larger and larger. In this way, the user can continuously stretch the generated sticker 119 in the short axis direction according to the change in the size of the license plate in the video picture, and adaptively stretch the sticker 119 from small to large in the short axis direction. In this way, the length of the short axis of the sticker 119 becomes larger and larger, so that the sticker 119 can dynamically occlude the license plate.

[0139] As shown in FIG. 1k, the user starts to stretch the sticker 119 when the video plays to the first second, and continuously drags the sticker 119 in the short axis direction as the video plays. When the video plays to the third second, the shape of the sticker 119 is stretched from an ellipse to a circle, so that the sticker 119 can dynamically occlude the license plate.

[0140] In the case of editing the material as a text box or a mosaic, the way of adjusting the shape of the generated editing material is similar to the case of editing the material as a sticker, which will not be illustrated one by one here.

[0141] In an embodiment of the present application, if the editing material is a text box containing text, the editing material can also be updated according to the updated text in response to the editing operation on the text in the text box.

[0142] As can be seen, in the above embodiments, the editing material can change synchronously with the area to be edited in the video playing picture of the original video, which improves the flexibility during video editing.

[0143] Referring to FIG. 1l, the video is playing at a speed of 1 / 16, and after the text box 111 is generated above the area where the person is located in the video picture, the video editing software plays the text box 111 on the upper layer of the video picture. As the video plays, the user finds that the person in the video picture is labeled incorrectly, so the user can click the text box 111, and the text box 111 displays an outer frame. The user can delete the original text "Person A" in the text box 111 and input a new text "Person B", so that the electronic device can obtain the text "Person B", update the text in the text box 111 to "Person B", and obtain a new text box 121.

[0144] As can be seen, in the present embodiment, the text box can also be updated according to the updated text in response to the editing operation on the text in the text box. That is, the user can update the text in the text box according to his own needs during the playing process of the video, which realizes displaying different texts at different playing moments of the video and improves the flexibility of the user in video editing.

[0145] In one embodiment of the present application, after the user adjusts the attribute of the editing material, the user can change the playing time of the video and adjust the attribute of the generated editing material again on the video playing screen. In this way, the user can conveniently adjust the attribute of the editing material again, so that the user can more accurately adjust the attribute of the editing material, and the convenience of the editing operation is improved.

[0146] Stage 4: Triggering a video saving operation to generate an edited video with the editing material.

[0147] The electronic device can record the adjustment process of the attribute of the editing material in the time period of the original video playing. Thus, after the user triggers the video saving operation, the electronic device can generate an edited video with the editing material according to the recorded adjustment process of the editing material, and in the playing process of the edited video, the change of the editing material is the same as the adjustment process.

[0148] The specific manner in which the electronic device generates the above video is described in subsequent embodiments, which is not described here.

[0149] Next, the video editing scheme provided by the embodiments of the present application is introduced in combination with the flowchart shown in FIG. 2.

[0150] Referring to FIG. 2, which is a flowchart of a video editing method provided by an embodiment of the present application, the method includes the following steps S201-S204.

[0151] Step S201: Generating an editing material on a layer above an original video playing layer in response to an adding editing material operation.

[0152] In addition to the text, the sticker, and the mosaic mentioned above, the editing material can also include letters, special effects, etc., which are not limited by the embodiments of the present application.

[0153] In this way, a variety of editing materials can be added to the video, which is conducive to meeting the personalized needs of the user and improving the flexibility during video editing.

[0154] The triggering manner of the adding editing material operation has been described above, and thus is not described here.

[0155] The original video playing layer refers to a layer playing a video screen in the original video.

[0156] In this step, the editing material generated on the layer above the original video playing layer can be one or multiple, and the layers generated by these editing materials are introduced below.

[0157] In the case of generating one editing material:

[0158] The editing material can be generated on a layer above the original video playing layer.

[0159] In the case of generating multiple editing materials:

[0160] In the first mode, the multiple editing materials can be generated on the same layer above the original video layer. That is, the multiple editing materials are located on the same layer.

[0161] It can be understood that when the multiple editing materials are located on the same layer, in the video playing process, the user can simultaneously, staggered or intermittently adjust the properties of each editing material, so that multiple editing materials can be added on the layer in one video playing, and the properties of the multiple editing materials are adjusted with the video playing, improving the video editing efficiency. Of course, the user can also play the video multiple times, and adjust the properties of one of the editing materials each time, which is more accurate. The specific adjustment mode is not limited here.

[0162] In addition, in the video playing process, the user can pause the video at any time, and the generated edited video does not contain the paused time, that is, the generated edited video is played smoothly, corresponding to the length of the played original video. When the video is in a paused state, the user can adjust the properties of the editing material on the layer above the paused video screen, or pause the adjustment of the properties of the editing material.

[0163] In the second mode, the multiple editing materials can be generated on different layers above the original video layer. That is, the multiple editing materials can be distributed on at least two layers above the original video playing layer.

[0164] Among them, for the at least two layers on which the multiple editing materials are distributed, one editing material can be distributed on each layer, or multiple editing materials can be distributed on each layer.

[0165] In one case, when generating an editing material, the editing material to which the adding editing material operation instruction is generated on the layer above the last generated editing material. For example, editing material A is generated on layer 1 above the original video playing layer, in response to the adding editing material operation, it is determined that the editing material to which the adding editing material operation instruction is editing material B, and editing material B can be generated on layer 2 above layer 1. In this case, the generated multiple materials are distributed on different layers.

[0166] Similarly, when the multiple editing materials are located on different layers, in the video playing process, the user can also simultaneously, staggered or intermittently adjust the properties of each editing material, or can also play the video multiple times, and adjust the properties of one of the editing materials each time, or can also pause the video at any time, and adjust the properties of the editing material on the layer above the paused video screen.

[0167] When two editing materials displayed on different layers are overlaid, the editing material displayed on the upper layer covers the material displayed on the lower layer.

[0168] In this way, multiple editing materials can be distributed on different layers above the original video playing layer, so that the display relationship of the multiple editing materials when overlaid can be changed by setting the layer where the editing material is located, and the flexibility during video editing is improved.

[0169] The area where the editing material generated on the upper layer is located in the layer is introduced below.

[0170] In one embodiment, after triggering the operation of adding an editing material, the editing material can be generated in a preset area in the upper layer of the original video playing layer.

[0171] In another embodiment, a region corresponding to the region to be edited can be determined in the upper layer of the original video playing layer, and the editing material is generated in the determined region. The specific implementation has been described in the foregoing user operation embodiment, and thus is not described herein.

[0172] In one embodiment of the present application, the initial value of the first information in the attribute of the generated editing material can be the same as the initial value of the first information in the attribute of the region to be edited.

[0173] First, the meaning of the attribute of the editing material is introduced.

[0174] The attribute can include first information representing the position and size of the editing material, and can also include the rotation angle, transparency, scaling ratio, color, line width, line type, appearance mode, disappearance mode, and the like of the editing material, which are not limited in the embodiments of the present application.

[0175] In this way, when the editing material is generated, multiple attributes of the editing material can be considered, and the adjustment process of the multiple attributes of the editing material can be recorded subsequently, so that the edited video can be generated according to the recorded adjustment process, and the flexibility during video editing is improved.

[0176] The first information can be any information capable of representing the position and size, which is not limited in the embodiments of the present application, and is described below by way of example.

[0177] In one case, the first information can be the coordinates of the corner point of the editing material.

[0178] For example, if the shape of the editing material is a rectangle, the first information can be the coordinates of four vertices of the editing material, can be the coordinates of three vertices of the editing material, or can be the coordinates of two vertices, such as the coordinates of the upper left vertex and the lower right vertex, or the coordinates of the lower left vertex and the upper right vertex.

[0179] In another case, the first information can be the coordinates of the center point of the editing material and the side length.

[0180] For example, if the shape of the editing material is a rectangle, the first information can be the coordinates of the center point of the editing material and the length and width of the editing material.

[0181] In another case, the first information can be the coordinates of the corner point of the editing material and the side length.

[0182] For example, if the shape of the editing material is a rectangle, the first information can be the coordinates of any one vertex of the editing material and the length and width of the editing material.

[0183] The attributes of the to-be-edited region and the meaning of the first information are similar to the attributes of the editing material and the meaning of the first information, and will not be described here.

[0184] The initial value of the first information of the editing material is the same as the initial value of the first information of the to-be-edited region, and the first information represents the position and size, i.e., the initial value of the position and size of the editing material is the same as the initial value of the position and size of the to-be-edited region.

[0185] That is, after determining the initial value of the position and size of the to-be-edited region according to the position and size of the to-be-edited object, the initial value of the position and size of the to-be-edited region is determined as the initial value of the position and size of the editing material, and then the editing material is generated according to the initial value of the position and size of the editing material.

[0186] Taking the foregoing FIG. 1c as an example, the initial value of the position and size of the to-be-edited region 107 is determined according to the region where the license plate is located in the video picture, and then the initial value of the position and size of the to-be-edited region 107 can be determined as the initial value of the position and size of the editing material, and finally the mosaic 108 is generated in the region corresponding to the to-be-edited region 107 in the upper layer of the original video playing layer as shown in FIG. 1c.

[0187] As known from the foregoing description, the editing material can be generated in a preset region of a layer, or a corresponding region can be determined in the layer based on the to-be-edited region, and the editing material is generated in the determined region. According to the different regions where the editing material is generated, the specific way of generating the editing material can also be different, which will be described in detail in subsequent embodiments, and will not be described here.

[0188] Step S202: In the process of playing the original video, the attribute of the editing material is adjusted so that the editing material changes with the playing of the video.

[0189] The adjustment of the editing material can be manual adjustment or automatic adjustment, and the specific manner has been introduced in the foregoing user operation part.

[0190] The editing material changes with the playing of the video, that is, the attribute of the editing material is adjusted according to the attribute of the to-be-edited region in the video playing picture.

[0191] According to the foregoing introduction, the attribute of the generated editing material can be determined based on the attribute of the to-be-edited region. In one case, in the process of playing the original video, the attribute of the editing material can be adjusted according to the attribute change of the to-be-edited region, so that the editing material changes with the playing of the video.

[0192] According to the foregoing introduction, the attribute of the to-be-edited region in the video playing picture can be determined according to the attribute of the to-be-edited object in the video playing picture. Therefore, the attribute of the editing material can be understood as being adjusted according to the attribute of the to-be-edited object in the video playing picture.

[0193] The manner of adjusting the attribute of the editing material according to the attribute of the to-be-edited region in the video picture will be described in subsequent embodiments, which will not be described here.

[0194] In one embodiment of the present application, when performing the above step S202, the playing time period of the editing material can also be determined. In the process of playing the original video, the attribute of the editing material is adjusted in the playing time period of the video picture, so that the editing material changes with the playing of the video picture in the playing time period.

[0195] The manner of determining the playing time period of the editing material will be introduced below.

[0196] In one embodiment, in response to the adding editing material operation, a playing progress bar for the editing material can be displayed in the setting region of the video playing interface. Then, in response to the adjusting operation of the playing progress bar, the playing time period of the editing material can be determined according to the start and end time corresponding to the adjusted playing progress bar.

[0197] Referring to FIG. 3a, taking the generated mosaic 108 as an example, after the mosaic 108 is generated in response to the adding editing material operation, the playing progress bar 116 of the mosaic 108 can be displayed in the lower region of the video playing interface. The playing progress bar 116 includes the playing start time 1161 and the playing end time 1162. The playing start time 1161 shown in FIG. 3a is 0s (second) of the video, and the playing end time 1162 is 60s of the video, that is, the playing time period of the editing material is 0s-60s.

[0198] In one case, the start time and / or the end time of the playing progress bar can be determined in response to a dragging operation, and the start time and the end time of the playing progress bar after the dragging operation can be determined, so as to obtain the playing time period of the editing material.

[0199] Referring to FIG. 3b, after the user drags the start time 1161 of the playing progress bar 116, the electronic device determines the start time 1161 after the dragging operation as the 6th second, and the end time 1162 remains unchanged, so as to adjust the playing time period of the editing material to the 6th second to the 60th second. The case where the user drags the end time 1162 of the playing progress bar is similar to the case shown in FIG. 3b, and will not be described in detail here.

[0200] In another case, the start time and / or the end time of the playing progress bar can be determined in response to a moving operation, and the start time and the end time of the playing progress bar after the moving operation can be determined, so as to obtain the playing time period of the editing material.

[0201] Referring to FIG. 3c, the start time 1161 of the playing progress bar is the 5th second of the video, the end time 1161 of the playing progress bar is the 40th second of the video, and after the user moves the playing progress bar 116, the electronic device determines the time offset indicated by the moving operation as 5 seconds in response to the moving operation of the user. Then, the electronic device can determine the start time 1161 after the dragging operation as the 5th + 5 = 10th second, and the end time 1162 after the dragging operation as the 40th + 5 = 45th second, that is, the playing time period of the adjusted editing material is the 10th second to the 45th second.

[0202] It should be noted that in the case where a plurality of editing materials are generated, each editing material can display a respective playing progress bar, and the playing time period of each editing material can be determined independently based on the playing progress bar of each editing material.

[0203] Referring to FIG. 3d, the playing progress bar 116 is the playing progress bar of the mosaic 108, and the playing progress bar 117 is the playing progress bar of the text box 111. The user can determine the playing time period of the mosaic 108 and the text box 111 respectively by operating the playing progress bar 116 and the playing progress bar 117 respectively.

[0204] In this way, the user can flexibly determine the playing time period of different editing materials according to actual needs, so as to display different editing materials in different time periods, which is beneficial to meet the diversified video editing needs of the user and improve the flexibility during video editing.

[0205] In this way, the playing time period of the editing material can be determined intuitively and quickly by adjusting the playing progress bar of the editing material.

[0206] In another implementation, the playing time period of the editing material can be directly determined as the complete playing time period of the video.

[0207] It can be seen that in the embodiment, the playing time period of the editing material can be determined, so that the editing material is played on the upper layer of the video playing picture only when the video picture in the playing time period is played, that is, the playing time period of the editing material can be adjusted purposefully, and the flexibility in video editing is further improved.

[0208] Step S203: record the adjustment process of the attribute of the editing material in the playing time period of the original video.

[0209] The playing time period of the editing material in the playing time period of the original video can be the time period in which the electronic device plays the editing material on the upper layer of the video playing picture.

[0210] According to the description of the foregoing step S202, in one case, the electronic device can determine the playing time period of the editing material after generating the editing material.

[0211] In another case, when the electronic device automatically generates the editing material by performing object recognition on the video playing picture, the electronic device can follow the object position of the to-be-edited object in the video playing picture while playing the video, and stop playing the generated editing material when the to-be-edited object disappears. In this case, the playing time period is the time period between the moment of generating the editing material and the moment of disappearance of the to-be-edited object.

[0212] Since the attribute of the editing material is adjusted in the playing process of the original video in step S202, in this step, the adjustment process of the attribute of the editing material in the playing time period of the original video can be recorded. The specific manner of recording the adjustment process will be described in subsequent embodiments, which will not be described here.

[0213] In one embodiment of the application, if the editing material is a text box containing text, the electronic device can further record the text contained in the text box.

[0214] Similarly, the electronic device can record the correspondence between each playing moment and the text contained in the text box, or record the correspondence between the frame number of each video frame included in the video and the text contained in the text box.

[0215] Of course, the electronic device can also record the size, color, font, and other information of the text.

[0216] In this way, the electronic device can generate a video including the text recorded in the text box in the video picture based on the recorded text contained in the text box, to meet the personalized needs of the user.

[0217] Step S204: in response to the video saving operation, generating the edited video with the editing material according to the adjustment process of the attribute of the original video and the recorded editing material.

[0218] Wherein, in the playing process, the change of the editing material is the same as the adjustment process.

[0219] Since the adjustment process of the attribute of the editing material is recorded in the foregoing step S203, in this step, the edited video with the editing material changing in the playing process can be generated based on the recorded adjustment process.

[0220] As known from the foregoing description, the editing material can be generated in the preset area of the layer, or the corresponding area in the layer can be determined based on the to-be-edited area, and the editing material is generated in the determined area. According to the difference of the area where the editing material is generated, the specific way of generating the edited video with the editing material can also be different, which will be introduced respectively.

[0221] For the case of generating the editing material based on the to-be-edited area:

[0222] Specifically, according to the difference of the editing material, the following ways can be adopted to generate the edited video:

[0223] In the first embodiment, if the editing material is a mosaic, the to-be-edited area in the decoded image of the video frame in the original video can be determined according to the recorded adjustment process of the attribute of the editing material, and then the pixel value of the pixel in the to-be-edited area is adjusted according to the pixel value of the pixel in the to-be-edited area in each decoded image, and the edited video is obtained by video encoding based on the decoded image after adjusting the pixel value.

[0224] The video frame in the original video participating in determining the to-be-edited area can be a video frame located in the playing time period of the editing material.

[0225] Wherein, the video frame can be decoded or the decoded image can be encoded to obtain the video frame by using the related common method, which will not be described in detail here.

[0226] As known from the foregoing description, the attribute of the editing material can include a variety of information, and the position and size of the editing material can be determined based on the included information.

[0227] For example, if the attribute of the editing material includes the left upper vertex coordinate and the right lower vertex coordinate, the difference between the horizontal coordinates of the left upper vertex coordinate and the right lower vertex coordinate can be taken as the length of the editing material, and the difference between the vertical coordinates of the left upper vertex coordinate and the right lower vertex coordinate can be taken as the width of the editing material, so as to calculate the remaining vertex coordinates of the editing material according to the left upper vertex coordinate and the right lower vertex coordinate and the determined length and width, and then the position and size of the editing material are obtained.

[0228] For example, if the attribute of the editing material includes the center point coordinates and the length and width, the remaining vertex coordinates of the editing material can be calculated according to the center point coordinates and the length and width, and then the position and size of the editing material are obtained.

[0229] The position and size of the editing material are obtained, that is, the region of the editing material in the video picture is obtained, and the determined region is the corresponding editing region in the decoded image.

[0230] The manner in which the pixel value of the pixel in the editing region in each decoded image is adjusted can refer to the manner in which the pixel value of the pixel in the editing region is adjusted to generate the mosaic picture.

[0231] In this way, after the pixel value of the pixel in the editing region in the decoded image is adjusted, the editing region in the decoded image is a blurred mosaic region, which is equivalent to synthesizing the mosaic into the decoded image of the video frame, and then encoding the decoded image to obtain the video frame, that is, a video is generated, which includes the mosaic and is played in the playing time period.

[0232] It can be seen that by adjusting the pixel value of the pixel in the editing region in each decoded image, the mosaic can be synthesized into the decoded image of the video frame, so that when the edited video is finally played, the mosaic can cover the editing region in the video playing picture, so that the human eye cannot see the picture content in the editing region, and the picture content in the editing region can be protected, thereby improving the security of the picture content in the video.

[0233] In the second implementation, if the editing material is a sticker, for each video frame in the playing time period, the to-be-synthesized picture can be synthesized into the video frame according to the position represented by the target attribute, to obtain an edited video including the synthesized video frame.

[0234] The target attribute is the recorded attribute corresponding to the video frame, and the to-be-synthesized picture is a picture obtained by adjusting the set picture to the size represented by the target attribute.

[0235] The manner in which the material position is determined based on the attribute of the editing material has been described above, and will not be described here.

[0236] For the video frames corresponding to the same target attribute in the playing time period, the attributes of the set image in these video frames do not change, so after the to-be-synthesized picture is generated for the first video frame of these video frames, the remaining video frames can directly use the generated to-be-synthesized picture, without the need for re-generation.

[0237] Specifically, in this embodiment, the position represented by the target attribute is the position of the to-be-edited region, and for each video frame in the playing time period, the to-be-combined picture can be combined into the position determined in the video frame to obtain a combined video frame.

[0238] In this way, the map can be combined into the to-be-edited region of the video frame, and finally when the edited video is played, the map can cover the to-be-edited region in the video playing picture, so that the human eye cannot see the picture content in the to-be-edited region, and the picture content in the to-be-edited region can be protected, improving the security of the picture content in the video; and the map can display personalized content, taking into account the personalized needs of the user while protecting the picture content in the to-be-edited region.

[0239] In the third embodiment, if the editing material is a text box, for each video frame in the original video corresponding to the adjustment process, the to-be-combined text box can be combined into the video frame according to the position represented by the target attribute to obtain an edited video containing a combined video frame.

[0240] The to-be-combined text box is a text box containing the recorded editing material text, and the size of the to-be-combined text box is the same as the size of the target attribute representation.

[0241] In this embodiment, the way of combining the to-be-combined text box into the video frame is similar to the way of combining the to-be-combined picture into the video frame, and the only difference is that the to-be-combined text box also includes the text of the editing material, which will not be repeated here.

[0242] In this way, the text box can be combined into the to-be-edited region of the video frame, and finally when the edited video is played, the human eye can see the text in the text box with the playing of the video, which is conducive to meeting the personalized needs of the user and improving the flexibility of video editing.

[0243] For the case of generating editing material based on a preset region:

[0244] In this case, the specific implementation of generating an edited video can be obtained based on the foregoing embodiment of generating an edited video based on a to-be-edited region, and the only difference is that the region considered when generating the editing material is different, which will not be repeated here.

[0245] From the above, when the scheme provided by the embodiments of the present application is applied to video editing, the editing material can be generated on the layer above the original video playing layer; then, when the original video is in the playing process, the properties of the editing material can be adjusted to make the editing material change with the video playing, and the adjustment process of the properties of the editing material in the time period of the original video playing is recorded. In this way, in response to the video saving operation, the edited video with the editing material can be generated according to the original video and the recorded adjustment process of the properties of the editing material, realizing the addition of the editing material to the video picture, that is, the editing of the video.

[0246] In addition, the properties of the editing material can be continuously adjusted during the original video playing process, in other words, during the playing process of the original video, the properties of the generated editing material are not fixed but can be flexibly changed at any time, and the editing material can have different properties at different video playing time. In this way, after the adjustment process of the properties of the editing material in the time period of the original video playing is recorded, the edited video with the editing material with continuously changing properties can be generated according to the original video and the recorded adjustment process of the properties of the editing material, and the change of the editing material in the edited video is the same as the adjustment process, which can meet the diversified video editing needs of users and improve the flexibility during video editing.

[0247] Furthermore, when the scheme provided by the embodiments of the present application is applied to video editing, the adjustment process of the editing material is recorded first, and the editing material is actually generated in the video picture only when the video saving operation is received. It can be seen that during the video editing process of the user, the operations such as editing material generation and video picture synthesis will not be performed, so as not to affect the normal playing of the video picture, improving the fluency of video editing and thus improving the video editing experience of the user.

[0248] The way of generating the editing material in different cases mentioned in step S201 will be introduced below.

[0249] For the case of generating the editing material based on the to-be-edited region:

[0250] As introduced before, the adding editing material operation can be the operation of the user performing region box selection on the to-be-edited region in the layer above the video playing picture, and the specific way of generating the editing material based on the above box selection operation will be introduced below.

[0251] The first way can determine the to-be-edited region in the video playing picture according to the selected region of the adding editing material operation, adjust the pixel values of the pixels in the to-be-edited region according to the pixel values of the pixels in the to-be-edited region, obtain a picture with the same size as the selected region as the editing material, and display the editing material on the layer above the original video playing layer.

[0252] The operation flow of the user in this embodiment can refer to the foregoing description for Fig. 1c.

[0253] The to-be-edited region in the video playing picture is the region corresponding to the above-mentioned selected region.

[0254] Specifically, the pixel values of the pixels in the to-be-edited region can be adjusted to blur or deteriorate the pixels, and a picture with the same size as the selected region is generated according to the adjusted pixels as the editing material; or the pixel values of the pixels in the to-be-edited region can be scrambled to generate a picture with the same size as the selected region as the editing material; or the pixel values of the pixels in the to-be-edited region can be adjusted in combination with the above-mentioned processing manners to obtain the editing material, which is not limited in the embodiments of the present application.

[0255] In this case, the generated editing material is actually a blurred picture for the human eye, and the generated editing material can be called a mosaic or a mosaic picture.

[0256] It can be seen that in this embodiment, the pixel values of the pixels in the to-be-edited region can be adjusted to obtain a picture with the same size as the selected region as the editing material, and the generated editing material can be called a mosaic, which can cover the to-be-edited region in the video playing picture when playing the video in the upper layer of the to-be-edited region, so that the human eye cannot see the picture content in the to-be-edited region, and the picture content in the to-be-edited region can be protected, thereby improving the security of the picture content in the video.

[0257] The second way is to generate a picture with the same size as the selected region as the editing material according to the set picture, and display the editing material in the upper layer of the original video playing layer.

[0258] The above-mentioned set picture can be a pre-set picture or a picture selected by the user, which can be called a sticker.

[0259] It can be seen that in this embodiment, a picture with the same size as the selected region can be generated as the editing material, and the generated editing material can be called a sticker, which can cover the to-be-edited region in the video playing picture when playing the video in the upper layer of the to-be-edited region, so that the human eye cannot see the picture content in the to-be-edited region, and the picture content in the to-be-edited region can be protected, thereby improving the security of the picture content in the video; and the above-mentioned picture can display personalized content, which takes into account the user's personalized needs while protecting the picture content in the to-be-edited region.

[0260] The third mode can generate a text box with the same size as the framed region, display the text box on a layer above the original video playing layer, obtain the text input by the user in the text box, and obtain the text box containing the obtained text as the editing material.

[0261] The operation flow of the user in this embodiment can refer to the foregoing description for FIG. 1d.

[0262] It can be seen that in this embodiment, a text box with the same size as the framed region can be generated as the editing material, and the text input by the user can be displayed in the text box. When the video is played on the layer above the to-be-edited region, the user can see the text in the text box with the video, which is beneficial to meet the personalized needs of the user and improves the flexibility during video editing.

[0263] For the case of generating the editing material based on the preset region:

[0264] In this case, the specific implementation of generating the editing material can be obtained based on the foregoing embodiment of generating the editing material based on the to-be-edited region, and the only difference is that the region considered when generating the editing material is different. The following is a brief description:

[0265] The first mode can adjust the pixel value of the pixel in the preset region according to the pixel value of the pixel in the preset region to obtain a picture with the same size as the preset region as the editing material. The second mode can generate a picture with the same size as the preset region according to the set picture as the editing material. The third mode can generate a text box with the same size as the preset region, display the text box on a layer above the original video playing layer, obtain the text input by the user in the text box, and obtain the text box containing the obtained text as the editing material.

[0266] The following describes the manner of adjusting the attribute of the editing material in the foregoing step S202.

[0267] For the case of adjusting the editing material by the user:

[0268] The attribute information of the editing material at the current playing time can be recorded continuously in response to the operation of adjusting the editing material by the user.

[0269] The foregoing current playing time is a dynamic concept. When the attribute of the editing material is adjusted, the original video is in a playing state, the playing picture changes constantly, the playing time is updated constantly, and the current playing time is constantly changing.

[0270] The continuous recording of the attribute information of the editing material at the current playing time can be understood as the recording of the attribute information of the editing material at each playing time.

[0271] The attribute of the editing material can include various information, and the following describes a manner of recording attribute information when a user adjusts the various information included in the attribute.

[0272] In a first manner, at least one of the following information of the editing material at the current playing time can be continuously recorded in response to a user operation of dragging the editing material: position information, movement path information.

[0273] The operation of dragging the editing material is also an operation of moving the editing material, such as the operation of dragging the mosaic mentioned above. After the operation of dragging the editing material is performed, the position of the editing material changes.

[0274] The movement path information can be path point coordinates of the editing material on the movement path, and the path point coordinates can be touch point coordinates on the dragging path collected at each playing time according to the user operation of dragging.

[0275] For example, referring to FIG. 4a, the user drags the mosaic from right to left, and the electronic device can collect the coordinates of each touch point on the user's dragging path at each playing time as the path point coordinates.

[0276] The position information is various information reflecting the position of the editing material, and the position information at each playing time can be obtained by detecting the editing material from the video image and locating the position of the detected editing material.

[0277] The position information can also be obtained based on the path point coordinates. Specifically, according to different position representation manners of the editing material, the position information of the editing material at each playing time can be determined as follows.

[0278] In one case, if the position of the editing material is represented by the corner point coordinates of the editing material, the updated corner point coordinates of the editing material corresponding to each path point can be calculated according to the offset between the touch point coordinates and the corner point coordinates, so as to obtain the position information of the editing material at each playing time.

[0279] For example, the attribute of the editing material is the top-left corner point coordinates and the bottom-right corner point coordinates. Taking the top-left corner point as an example, if the horizontal coordinate offset of the touch point coordinates and the top-left corner point coordinates is t, and the vertical coordinate offset is d, for the path point l1(x1, y1), the difference between the horizontal coordinate x1 of l1 and the horizontal coordinate offset t can be calculated, and the difference between the vertical coordinate y1 of l1 and the vertical coordinate offset d can be calculated, so as to obtain the top-left corner point coordinates v1(x1-t, y1-d) of the editing material corresponding to the path point l1. Similarly, the top-left corner point coordinates and the bottom-right corner point coordinates of the editing material corresponding to each path point can be obtained.

[0280] In another case, if the position of the editing material is represented by the center point coordinate of the editing material, the updated center point coordinate of the editing material corresponding to each path point can be calculated according to the offset between the touch point coordinate and the center point coordinate, so as to obtain the position information of the editing material at each playing time.

[0281] In this case, the manner of calculating the center point coordinate of the editing material corresponding to each path point is similar to the manner of calculating the corner point coordinate of the editing material in the above manner, and the difference is only that the corner point coordinate is replaced by the center point coordinate, which will not be described here.

[0282] In the second manner, at least one of the following information of the editing material at the current playing time can be continuously recorded in response to the operation of scaling the editing material: the scaling amount, the scaling ratio, the position information, and the size.

[0283] The scaling amount can be determined based on the moving distance of the attribute adjustment operation in the scaling direction.

[0284] For example, referring to FIG. 4b, it can be seen that the user stretches the short side of the editing material in the length direction of the editing material, and the moving distance of the stretching operation of the user in the length direction can be determined as the scaling amount.

[0285] For another example, referring to FIG. 4c, it can be seen that the user stretches the lower right corner of the editing material in the diagonal direction of the editing material, and the moving distance of the stretching operation of the user in the diagonal direction can be determined as the scaling amount.

[0286] The scaling ratio can be determined based on the scaling amount and the size of the editing material.

[0287] Still taking FIG. 4b as an example, assuming that the length of the editing material is length 1 and the scaling amount is △length, the scaling ratio can be length 1:(length 1+△length).

[0288] For the position information and the size, the editing material can be detected from the video picture at each playing time, the position of the detected editing material is located, and the size of the detected editing material is measured, so as to obtain the position information and the size at each playing time.

[0289] In an embodiment of the present application, the position information and the size of the editing material can also be determined according to the scaling amount. According to different representation manners of the position and size of the editing material, the position information and the size of the editing material at each playing time can be determined as follows.

[0290] If the scaling direction is the length direction or the width direction of the editing material:

[0291] In one case, if the position and size of the editing material are represented by corner point coordinates, for each play time, the sum of the horizontal coordinate or the vertical coordinate in the corner point coordinates in the attribute of the editing material and the scaling amount corresponding to the play time can be calculated, and the updated corner point coordinates of the editing material are obtained according to the calculation result, and then the position information and the size of the editing material at each play time are obtained.

[0292] For example, if the attribute of the editing material includes the right bottom vertex coordinate v2(x2, y2), the scaling direction is to stretch right along the length direction of the editing material, and the scaling amount is δ, the sum of the horizontal coordinate x2 in the right bottom vertex coordinate in the attribute of the editing material and the scaling amount can be calculated as the updated horizontal coordinate, and finally the updated right bottom vertex coordinate is v2'(x2+δ, y2).

[0293] In another case, if the position and size of the editing material are represented by center point coordinates and side length, for each play time, the sum of the horizontal coordinate or the vertical coordinate in the center point coordinates in the attribute of the editing material and the scaling amount corresponding to the play time can be calculated first, and the updated center point coordinates of the editing material are obtained according to the calculation result, which can be obtained on the basis of the way of calculating the updated corner point coordinates, which will not be described here; and then the sum of the length or the width of the editing material and the scaling amount is calculated, and the updated length or width of the editing material is obtained according to the calculation result. In this way, the center point coordinates and the side length in the attribute of the editing material at each play time are obtained, and the position and size information of the editing material at each play time are obtained.

[0294] If the scaling direction is the diagonal direction of the editing material:

[0295] In this case, the first component and the second component of the scaling amount in the length direction and the width direction can be determined based on the aspect ratio of the editing material.

[0296] For example, if the aspect ratio of the editing material is 4:3 and the scaling amount is δ, the first component of the scaling amount in the length direction can be determined as 4 / 5×δ, and the second component of the scaling amount in the width direction can be determined as 3 / 5×δ.

[0297] Then, the position information and the size of the editing material are calculated as follows.

[0298] In one case, if the position and size of the editing material are represented by corner point coordinates, for each play time, the sum of the horizontal coordinate or the vertical coordinate in the corner point coordinates in the attribute of the editing material and the scaling amount corresponding to the play time can be calculated, and the updated corner point coordinates of the editing material are obtained according to the calculation result, and then the position information and the size of the editing material at each play time are obtained.

[0299] For example, if the attribute of the editing material includes a lower right vertex coordinate v3(x3, y3), the scaling direction is stretching right along the diagonal direction, and the scaling amount is δ, the first component of the scaling amount in the length direction can be determined as 4 / 5×δ, and the second component in the width direction can be determined as 3 / 5×δ. Then, the updated horizontal coordinate of the lower right vertex coordinate in the attribute of the editing material can be calculated as the sum of x3 and the first component, and the updated vertical coordinate of the lower right vertex coordinate in the attribute of the editing material can be calculated as the sum of y3 and the second component. Finally, the updated lower right vertex coordinate v3'(x3+4 / 5×δ, y3+3 / 5×δ) can be obtained.

[0300] In another case, if the position information and the size of the editing material are represented by a center point coordinate and a side length, for each playback time, the horizontal and vertical coordinates of the center point coordinate can be calculated respectively as the sum of the first component and the second component corresponding to the playback time, and the updated center point coordinate of the editing material can be obtained according to the calculation result. This method can be based on the method of calculating the updated corner point coordinate, which will not be described in detail here. Then, the length and the width of the editing material can be calculated respectively as the sum of the first component and the second component, and the updated length and width of the editing material can be obtained according to the calculation result. In this way, the center point coordinate and the side length in the attribute of the editing material at each playback time are obtained, and the position and size information of the editing material at each playback time are obtained.

[0301] In a third way, at least one of the following information of the editing material at the current playback time can be recorded continuously in response to the operation of manually rotating the editing material: a rotation angle, position information.

[0302] For the rotation angle and the position information, the editing material can be detected from the video image at each playback time, and the position of the detected editing material can be located. The rotation angle of the detected editing material can be measured, so as to obtain the rotation angle and the position information at each playback time.

[0303] In a fourth way, at least one of the following settings of the editing material at the current playback time can be recorded continuously in response to the operation of manually editing the settings of the editing material: transparency, color, line width, line type, appearance mode, and disappearance mode.

[0304] In some cases, the user can set various attributes of the material through the settings of the editing material. The electronic device can detect the settings of the generated editing material at each playback time, and record the attribute corresponding to each playback time according to the detection result.

[0305] It can be seen that, in the video playing process, according to the various operations of the human for the edited material, the various attribute information of the edited material at each playing time can be continuously recorded, so that when the edited video is generated according to the recorded information, the various attribute information of the edited material on the playing screen of the edited material can be continuously changed, and the flexibility during video editing is improved.

[0306] In the embodiment, in the case of adjusting the edited material by the human in the video playing process, the attribute information of the edited material at each playing time can be continuously recorded according to the human adjustment operation, so that when the edited video is generated according to the recorded information, the change of the edited material in the playing process of the edited video is the same as the process of the human adjustment operation, to meet the personalized needs of the user.

[0307] For the case of automatically adjusting the edited material:

[0308] The edited material corresponding to the position and size of the preset content can be generated in response to automatically identifying the preset content in the original video, the edited material follows the preset content, and the attribute information of the edited material at the current playing time is continuously recorded.

[0309] The above-mentioned preset content can be a preset object, corresponding to the aforementioned to-be-edited object, such as a person, an animal, a license plate, etc.

[0310] Specifically, object following identification can be performed on the video frames of the original video, that is, the same object in each frame of video is identified. In this way, in the process of object following identification, according to the difference of the same object in each frame of video, the change of the position and size of the object can be determined, so that the attribute of the edited material can be changed according to the change of the position and size of the object. For example, the position, size, shape, rotation angle, zoom amount, etc. of the edited material are changed according to the change of the position and size of the object, and the attribute information of the edited material at each playing time is continuously recorded.

[0311] In the embodiment, in the case of automatically adjusting the edited material in the video playing process, the edited material can be generated according to the size and position of the preset content automatically identified in the original video, and the edited material is made to follow the preset content, and the attribute information of the edited material at each playing time is continuously recorded. In this way, when the edited video is generated according to the recorded information, the change of the edited material in the playing process of the edited video is consistent with the change of the preset content, the user does not need to manually adjust the edited material during the entire video editing process, and the convenience during video editing is improved.

[0312] In one embodiment of the present application, in the case of automatically adjusting the edited material in the video playing process, the following step A can also be performed before step S204 is performed:

[0313] Step A: in response to the video replay operation, replaying the original video, playing the editing material on the upper layer based on the adjustment process of the attribute of the recorded editing material, and continuously updating the attribute information of the recorded editing material at the current playing time in response to the manual adjustment operation of the editing material.

[0314] After the video replay operation is triggered, the original video can be replayed, that is, the original video is played again. In the process of playing the original video last time, the editing material has been automatically adjusted, and the attribute adjustment process of the editing material has been recorded. Therefore, in the process of replaying the original video, the editing material can be played on the upper layer according to the recorded adjustment process.

[0315] It can be seen that in the process of replaying the original video, the editing material will also change with the automatic adjustment of the editing material in the process of playing the original video last time.

[0316] On this basis, the user can also manually adjust the played editing material according to the actual needs of the user in the process of watching the change of the editing material in the video picture, which can also be called "secondary adjustment". Therefore, the electronic device can continuously update the attribute information of the recorded editing material at the current playing time in response to the manual adjustment operation of the editing material.

[0317] The way of continuously updating the attribute information of the editing material can be obtained on the basis of the way of continuously recording the attribute information of the editing material introduced in the foregoing, which will not be described here.

[0318] In this embodiment, in the process of playing the video, the editing material can be automatically adjusted first, and the attribute information of the editing material at each playing time is continuously recorded. Then, the video can be replayed, and the attribute information of the recorded editing material at each playing time is continuously updated in response to the manual adjustment operation of the editing material in the replay process. In this way, the edited video finally generated according to the recorded attribute information can not only reflect the automatic adjustment operation, but also reflect the manual adjustment operation of the user. Moreover, the user does not need to manually adjust the editing material throughout the process of playing the video, but only needs to make secondary adjustment according to the actual needs of the user on the basis of automatically adjusting the editing material, which not only ensures the convenience of the video editing operation, but also meets the individual needs of the user.

[0319] The overall flow of the video editing scheme provided by the embodiment of the application will be introduced intuitively in combination with specific examples and the accompanying drawings.

[0320] Referring to FIG. 5, taking adding a mosaic in a video picture as an example, a video editing scheme provided by an embodiment of the present application is introduced through the following steps P1-P5. FIG. 5 shows a time axis, and the numbers above the time axis represent respective time instants, in seconds.

[0321] Step P1: At time instant t1, the user starts to manually add a mosaic 1 in the video picture, and adjusts the shape of the mosaic 1 to S1, and within time interval A, the user moves the position of the mosaic 1 along with playing the picture, and curve L1 in FIG. 5 reflects the position change of the mosaic 1 within time interval A.

[0322] Step P2: At the start of time interval B, the user adjusts the shape of the mosaic 1, and the adjusted shape is S2, and within time interval B, the user moves the position of the mosaic 1 along with playing the picture, and curve L2 in FIG. 5 reflects the position change of the mosaic 1 within time interval B.

[0323] Step P3: At the start of time interval C, the user adjusts the shape of the mosaic 1, and the adjusted shape is S3, and within time interval C, the user moves the position of the mosaic 1 along with playing the picture, and curve L3 in FIG. 5 reflects the position change of the mosaic 1 within time interval C.

[0324] Step P4: At the start of time interval D, the user adjusts the shape of the mosaic 1, and the adjusted shape is S4, and within time interval D, the user moves the position of the mosaic 1 along with playing the picture, and at time instant t2, the adjustment of the mosaic is ended, and curve L4 in FIG. 5 reflects the position change of the mosaic 1 within time interval D.

[0325] Step P5: The user triggers a video saving operation, and the electronic device composites the mosaic into the video picture to obtain an edited video.

[0326] During the adjustment of the mosaic 1 by the user, the electronic device internally records the shape S and the position coordinates L of the mosaic 1 in real time, and records the frame number of the video frame corresponding to the shape and the position, to form a one-to-one correspondence relationship, in which each frame number corresponds to one shape and one position.

[0327] After the user triggers the saving of the video, the electronic device obtains the mosaic positions and shapes corresponding to each frame saved in the memory, then decodes the code stream including the video frames from the stream data of the video, and matches the frame numbers of the video frames included in the code stream with the frame numbers recorded in the memory. If there is a matching frame number, the mosaic region in the decoded image of the video frame corresponding to the matching frame number is determined based on the mosaic positions and shapes in the memory. Then, the pixel values of the pixels in the mosaic region are adjusted based on the pixel values of the pixels in the mosaic region, the decoded image after the adjustment of the pixel values is encoded to obtain an updated video frame, so as to obtain a code stream including the updated video frame, and the code stream data is written into the disk for saving, thereby completing the saving of the video.

[0328] Next, the overall flow of the video editing scheme provided by the embodiment of the application will be introduced in the form of a signaling diagram in combination with FIG. 6.

[0329] Referring to FIG. 6, a signaling interaction diagram of a video editing flow provided by the embodiment of the application is shown.

[0330] It can be seen that the user can trigger the operation of adding an editing material on the operation interface, the operation interface sends the editing material information to the data recording module, that is, synchronizes the related information of the editing material to the data recording module; the data recording module can record the playback time and the editing material information; at the same time, the operation interface can also update the editing material information along with the playback of the video, and notify the data recording module to update the information; the operation interface can also return the recording result to the user, and the recording result can be information indicating that the saving is successful; after the user triggers the saving operation, the operation interface can trigger the video synthesis, that is, sends a video synthesis instruction to the data recording module, the data recording module reads the recorded data, that is, the editing material information, and calls an algorithm to instruct the video synthesis; in this way, the video processing module can synthesize the video, specifically, the editing material can be synthesized into the video frame according to the editing material information, and the synthesis result is returned to the data recording module; the data recording module returns the synthesis result to the operation interface, and the operation interface returns the synthesis result to the user, and the synthesis result can be information indicating that the video synthesis is successful.

[0331] In the technical scheme of the application, the operations of obtaining, storing, using, processing, transmitting, providing and disclosing of the user's personal information are all performed after the user's authorization is obtained.

[0332] It should be noted that the two-dimensional face image in the embodiment is from a public data set.

[0333] Corresponding to the video editing method described above, the embodiment of the application provides a video editing device.

[0334] Referring to FIG. 7, a structural schematic diagram of a video editing device provided by an embodiment of the present application is shown, and the device comprises the following modules:

[0335] An editing material generation module 701 is configured to generate an editing material on a layer above a layer of a playing original video in response to an operation of adding the editing material;

[0336] An editing material adjustment module 702 is configured to adjust a property of the editing material in a process of playing the original video, so that the editing material changes with the playing of the video, wherein the adjustment of the editing material is manual adjustment and / or automatic adjustment;

[0337] An adjustment process recording module 703 is configured to record an adjustment process of the property of the editing material in a time period of playing the original video;

[0338] A video generation module 704 is configured to generate an edited video with the editing material in response to an operation of saving the video, according to the original video and the recorded adjustment process of the property of the editing material, wherein in a process of playing the edited video, the change of the editing material is the same as the adjustment process.

[0339] As can be seen from the above, when a video is edited by using the scheme provided by the embodiment of the present application, an editing material can be generated on a layer above a layer of a playing original video, then in a process of playing the original video, a property of the editing material can be adjusted, so that the editing material changes with the playing of the video, and an adjustment process of the property of the editing material in a time period of playing the original video can be recorded, thus in response to an operation of saving the video, an edited video with the editing material can be generated according to the original video and the recorded adjustment process of the property of the editing material, which realizes adding the editing material to a video picture, that is, editing the video.

[0340] In addition, the property of the editing material can be continuously adjusted in the process of playing the original video, in other words, the property of the generated editing material is not fixed but can be flexibly changed at any time, and the editing material can have different properties at different video playing time. Thus, after the adjustment process of the property of the editing material in the time period of playing the original video is recorded, an edited video with the continuously changing property of the editing material can be generated according to the original video and the recorded adjustment process of the property of the editing material, and the change of the editing material in the edited video is the same as the adjustment process, which can meet the diversified video editing requirements of users and improve the flexibility in video editing.

[0341] In an embodiment of the present application, the adjustment of the editing material comprises manual adjustment.

[0342] The adjustment process recording module 703 comprises:

[0343] The adjustment operation response sub-module is configured to, in response to a human adjustment operation on the editing material, continuously record attribute information of the editing material at a current playing time.

[0344] In this embodiment, in the case of human adjustment of the editing material during video playing, attribute information of the editing material at each playing time can be continuously recorded according to the human adjustment operation, so that when the edited video is generated according to the recorded information subsequently, the edited video can have the same change of the editing material as the human adjustment operation during playing, thereby meeting the personalized needs of the user.

[0345] In one embodiment of the present application,

[0346] The adjustment operation response sub-module is specifically configured to, in response to a human operation of dragging the editing material, continuously record position information and / or movement path information of the editing material at a current playing time; and / or, in response to a human operation of scaling the editing material, continuously record at least one of the following information of the editing material at the current playing time: scaling amount, scaling ratio, position information, size; and / or, in response to a human operation of rotating the editing material, continuously record a rotation angle and / or position information of the editing material at the current playing time; and / or, in response to a human operation of editing a setting item of the editing material, continuously record at least one of the following setting items of the editing material at the current playing time: transparency, color, line width, line type, appearance mode, disappearance mode.

[0347] It can be seen that, during video playing, according to various human operations on the editing material, various attribute information of the editing material at each playing time can be continuously recorded, so that when the edited video is generated according to the recorded information subsequently, various attribute information of the editing material on the playing screen of the edited material can be changed constantly, thereby improving the flexibility during video editing.

[0348] In one embodiment of the present application, the adjustment of the editing material comprises automatic adjustment.

[0349] The adjustment process recording module 703 is specifically configured to, in response to automatic identification of a preset content in the original video, generate the editing material corresponding to the position and size of the preset content, the editing material following the preset content to move, and continuously record attribute information of the editing material at a current playing time.

[0350] In the embodiment, in the case of automatically adjusting the editing material during the video playing, the editing material can be generated according to the size and position of the preset content automatically recognized in the original video, and the editing material can follow the preset content to move, and the attribute information of the editing material at each playing time can be recorded continuously. Thus, when the edited video is generated according to the recorded information, the change of the editing material in the edited video can be consistent with the change of the preset content during the playing, and the user does not need to manually adjust the editing material in the whole video editing process, and the convenience of the video editing is improved.

[0351] In an embodiment of the present application, the adjustment of the editing material further includes manual adjustment.

[0352] The device further includes an attribute updating module, configured to, before the video generating module responds to the video saving operation, replay the original video based on the recorded adjustment process of the attribute of the editing material, play the editing material on the upper layer, and continuously update the attribute information of the editing material at the current playing time in response to the manual adjustment operation of the editing material.

[0353] In the embodiment, during the video playing, the editing material can be automatically adjusted first, and the attribute information of the editing material at each playing time can be recorded continuously. Then, the video can be replayed, and the attribute information of the editing material at each playing time can be continuously updated in response to the manual adjustment operation of the editing material during the replay. Thus, the edited video generated according to the recorded attribute information can reflect the automatic adjustment operation and the manual adjustment operation of the user. The user does not need to manually adjust the editing material during the whole video playing, but can make secondary adjustment according to the own demand on the basis of the automatic adjustment of the editing material, which ensures the convenience of the video editing operation and meets the individual demand of the user.

[0354] In an embodiment of the present application, the editing material is at least one of a word, a letter, a picture, a mosaic, and a special effect.

[0355] Thus, the editing material of various types can be added in the video, which is beneficial to meet the individual demand of the user and improve the flexibility of the video editing.

[0356] In an embodiment of the present application, the attribute represents at least one of a position, a size, a rotation angle, a transparency, a scaling ratio, a color, a line width, a line type, an appearance mode, and a disappearance mode.

[0357] Thus, when generating the editing material, various attributes of the editing material can be considered, and the adjustment process of the various attributes of the editing material can be recorded, so that the edited video can be generated according to the recorded adjustment process, and the flexibility during video editing is improved.

[0358] In an embodiment of the present application, the adding editing material operation is an editing operation on the played video in a preset speed, wherein the preset speed is less than or greater than 1 times.

[0359] When the video is in a slow playing state, the position and size of the to-be-edited object in the video picture change slowly, and since the position and size of the to-be-edited region can be determined based on the position and size of the to-be-edited object in the video picture, this is beneficial to improve the accuracy when determining the position and size of the to-be-edited region, and thus the accuracy when adjusting the position and size of the generated editing material according to the position and size change of the to-be-edited region is improved; when the video is in a fast playing state, the video pictures of each frame change quickly, and the time required for playing the entire video is short, and in this case, the editing material can be quickly added to the video picture, and the video editing efficiency is improved.

[0360] In addition, the editing material can be multiple, and the multiple editing materials are distributed in at least two layers above the original video playing layer.

[0361] Thus, the multiple editing materials can be distributed in different layers above the original video playing layer, so that the display relationship of the multiple editing materials when being superimposed and displayed can be changed by setting the layer where the editing material is located, and the flexibility during video editing is improved.

[0362] In an embodiment of the present application, the editing material changes synchronously with the to-be-edited region in the video playing picture of the original video.

[0363] It can be seen that in the above embodiments, the editing material can change synchronously with the to-be-edited region in the video playing picture of the original video, and the flexibility during video editing is improved.

[0364] In an embodiment of the present application, the adding editing material operation is a region box selection operation on the to-be-edited region in the upper layer of the video playing picture of the original video.

[0365] The editing material generation module is specifically configured to, in response to an adding editing material operation, determine a region to be edited in a video playing picture of the original video according to a region framed by the adding editing material operation, adjust pixel values of pixels in the region to be edited according to pixel values of the pixels in the region to be edited, obtain a picture with a same size as the framed region as editing material, and display the editing material on a layer above the original video playing layer; and / or generate a picture with a same size as the framed region as editing material according to a set picture, and display the editing material on a layer above the original video playing layer; and / or generate a text box with a same size as the framed region, display the text box on a layer above the original video playing layer, obtain text input by a user in the text box, and obtain a text box containing the obtained text as the editing material.

[0366] It can be seen that, in this embodiment, the pixel values of the pixels in the region to be edited are adjusted to obtain a picture with a same size as the framed region as editing material. The generated editing material can be called a mosaic. When the editing material is displayed on a layer above the region to be edited and video playing is performed, the editing material can cover the region to be edited in the video playing picture, so that the human eye cannot see the picture content in the region to be edited, and the picture content in the region to be edited is protected, improving the security of the picture content in the video. A picture with a same size as the framed region can be generated as editing material. The generated editing material can be called a sticker. When the editing material is displayed on a layer above the region to be edited and video playing is performed, the editing material can cover the region to be edited in the video playing picture, so that the human eye cannot see the picture content in the region to be edited, and the picture content in the region to be edited is protected, improving the security of the picture content in the video. The picture can display personalized content, protecting the picture content in the region to be edited while taking into account the personalized needs of the user. A text box with a same size as the framed region can also be generated as editing material, and text input by the user can be displayed in the text box. When the editing material is displayed on a layer above the region to be edited and video playing is performed, the human eye can see the text in the text box as the video is played, which is conducive to meeting the personalized needs of the user and improving the flexibility of video editing.

[0367] In an embodiment of the present application, the video generation module is specifically configured to, in response to a video saving operation, determine a to-be-edited region in a decoded image of a video frame in the original video according to a recorded adjustment process of the attribute of the editing material; adjust pixel values of pixels in the to-be-edited region in each decoded image; perform video encoding based on the decoded image after the pixel values are adjusted to obtain an edited video; and / or, for each video frame in the original video corresponding to the adjustment process, synthesize a to-be-combined picture into the video frame according to a position represented by a target attribute to obtain an edited video containing a synthesized video frame, wherein the target attribute is a recorded attribute corresponding to the video frame, and the to-be-combined picture is a picture obtained by adjusting a set picture to a size represented by the target attribute; and / or, for each video frame in the original video corresponding to the adjustment process, synthesize a to-be-combined text box into the video frame according to a position represented by the target attribute to obtain an edited video containing a synthesized video frame, wherein the to-be-combined text box is a text box containing a recorded text of the editing material, and the size of the to-be-combined text box is the same as a size represented by the target attribute.

[0368] It can be seen that, by adjusting pixel values of pixels in the to-be-edited region in each decoded image, the mosaic can be synthesized into the decoded image of the video frame, so that when the edited video is finally played, the mosaic can cover the to-be-edited region in the video playing picture, so that the human eye cannot see the picture content in the to-be-edited region, and the picture content in the to-be-edited region can be protected, thereby improving the security of the picture content in the video; and the map can be synthesized into the to-be-edited region of the video frame, so that when the edited video is finally played, the map can cover the to-be-edited region in the video playing picture, so that the human eye cannot see the picture content in the to-be-edited region, and the picture content in the to-be-edited region can be protected, thereby improving the security of the picture content in the video; and the map can display personalized content, which takes into account the personalized needs of the user while protecting the picture content in the to-be-edited region; and the text box can also be synthesized into the to-be-edited region of the video frame, so that when the edited video is finally played, the human eye can see the text in the text box with the playing of the video, which is conducive to meeting the personalized needs of the user and improving the flexibility of video editing.

[0369] In an embodiment of the present application, the device further comprises:

[0370] a playing time period determination module configured to determine a playing time period of the editing material;

[0371] The editing material adjusting module is specifically configured to adjust the attribute of the editing material during playing of the video picture in the playing time period, so that the editing material changes with the playing of the video picture in the playing time period.

[0372] It can be seen that, in the embodiment, the playing time period of the editing material can be determined, so that the editing material is displayed in the upper layer of the video playing picture only when the video picture in the playing time period is played, that is, the playing time period of the editing material can be adjusted purposefully, and the flexibility during video editing is further improved.

[0373] In an embodiment of the present application, the playing time period determining module is specifically configured to display a playing progress bar of the editing material in a set area of the video playing interface in response to an adding editing material operation, and determine the playing time period of the editing material according to the start time and end time corresponding to the adjusted playing progress bar in response to an adjusting operation on the playing progress bar.

[0374] In this way, the playing time period of the editing material can be determined intuitively and quickly by adjusting the playing progress bar of the editing material.

[0375] Corresponding to the video editing method described above, the embodiments of the present application further provide an electronic device, a computer readable storage medium and a computer program.

[0376] The embodiments of the present application provide an electronic device, as shown in FIG. 8, which includes:

[0377] The memory 801 is used to store a computer program.

[0378] The processor 802 is used to execute the program stored in the memory 801, and realize the video editing method described above.

[0379] The electronic device described above can further include a communication bus and / or a communication interface, and the processor 802, the communication interface and the memory 801 can complete mutual communication through the communication bus.

[0380] The communication bus mentioned in the electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or only one type of bus.

[0381] The communication interface is configured to communicate between the electronic device and other devices.

[0382] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0383] The aforementioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. It can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0384] In another embodiment provided in the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any of the above video editing methods.

[0385] In another embodiment provided in the present application, a computer program product containing instructions is also provided, and when the computer program product is executed on a computer, the computer is caused to execute any of the video editing methods in the above embodiments.

[0386] In the embodiments described above, all or some of the steps can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, all or some of the steps can be implemented in the form of one or more computer programs or program elements. The computer programs reside (at least temporarily) in a memory of a computer during execution. The memory can be a RAM memory, a flash memory, a ROM memory, an EPROM memory, or any other suitable memory. The memory can be integral to or separate from the computer. The computer programs can be written in any suitable programming language, such as C, C++, Java, Visual Basic, etc. The computer programs can be written in assembly or machine language, if desired. The computer programs can be distributed over network coupled file servers, or can be distributed by any other suitable means.

[0387] It should be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Furthermore, the term "comprising" is intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.

[0388] Each of the embodiments described in the present specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device, electronic device, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the description of the method embodiments.

[0389] The above merely provides the preferred embodiment of the present application, and not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

A video editing method, characterized by, The method comprises: in response to an editing material adding operation, generating an editing material above a layer of an original video player; in the process of playing the original video, adjusting the properties of the editing material so that the editing material changes with the video playing, wherein the adjustment of the editing material is manual adjustment and / or automatic adjustment; recording the adjustment process of the properties of the editing material in the time period of the original video playing; in response to a video saving operation, generating an edited video with the editing material according to the original video and the recorded adjustment process of the properties of the editing material, wherein in the process of playing the edited video, the change of the editing material is the same as the adjustment process. The method of claim 1, wherein The adjustment of the editing material comprises manual adjustment; The recording of the adjustment process of the properties of the editing material in the time period of the original video playing comprises: in response to a manual adjustment operation of the editing material, continuously recording the property information of the editing material at the current playing time. The method according to claim 2, characterized in that The continuously recording the property information of the editing material at the current playing time in response to the manual adjustment operation of the editing material comprises: in response to a manual dragging operation of the editing material, continuously recording the position information and / or movement path information of the editing material at the current playing time; and / or, in response to a manual scaling operation of the editing material, continuously recording at least one of the following information of the editing material at the current playing time: scaling amount, scaling ratio, position information, size; and / or, in response to a manual rotation operation of the editing material, continuously recording the rotation angle and / or position information of the editing material at the current playing time; and / or, in response to a manual editing operation of the editing material setting item, continuously recording at least one of the following setting items of the editing material at the current playing time: transparency, color, line width, line type, appearance mode, disappearance mode. The method of claim 1, wherein The adjustment of the editing material comprises automatic adjustment; The recording of the adjustment process of the properties of the editing material in the time period of the original video playing comprises: in response to automatically identifying a preset content in the original video, generating the editing material corresponding to the position and size of the preset content, the editing material following the movement of the preset content, and continuously recording the property information of the editing material at the current playing time. The method according to claim 4, characterized in that The adjustment of the editing material further comprises manual adjustment; Before responding to the video saving operation, further comprising: in response to a video replay operation, replaying the original video, playing the editing material on the upper layer based on the recorded adjustment process of the properties of the editing material, and continuously updating the recorded property information of the editing material at the current playing time in response to a manual adjustment operation of the editing material. According to the method of claim 1, wherein the editing material is at least one of text, letters, pictures, mosaics, and special effects; and / or the properties represent at least one of position, size, rotation angle, transparency, scaling ratio, color, line width, line type, appearance mode, and disappearance mode; and / or, The adding editing material operation is an editing operation on the played video in a preset speed, and the preset speed is less than or greater than 1 times. And / or, The editing materials are multiple, and the multiple editing materials are distributed on at least two layers above the original video playing layer. The method according to any one of claims 1-6, characterized in that, The editing material changes synchronously with a to-be-edited region in a video playing picture of the original video. The method of claim 7, wherein The adding editing material operation is a region framing operation on the to-be-edited region in a layer above the video playing picture of the original video. The method further comprises: The adding editing material operation is a region framing operation on the to-be-edited region in a layer above the video playing picture of the original video. According to the framed region, a to-be-edited region in the video playing picture of the original video is determined, pixel values of pixels in the to-be-edited region are adjusted according to pixel values of the pixels in the to-be-edited region, a picture with the same size as the framed region is obtained as an editing material, and the editing material is displayed on a layer above the original video playing layer. And / or, According to a set picture, a picture with the same size as the framed region is generated as an editing material, and the editing material is displayed on a layer above the original video playing layer. And / or, The method according to any one of claims 1-6, characterized in that A text box with the same size as the framed region is generated, the text box is displayed on a layer above the original video playing layer, text input by a user in the text box is obtained, a text box containing the obtained text is obtained as the editing material. The method further comprises: According to the recorded attribute of the editing material, a to-be-edited region in a decoded image of a video frame in the original video is determined, pixel values of pixels in the to-be-edited region are adjusted according to pixel values of the pixels in the to-be-edited region, and video encoding is performed based on the decoded image after the pixel values are adjusted to obtain an edited video. And / or, For each video frame in the original video corresponding to the adjustment process, a to-be-combined picture is combined into the video frame according to a position represented by a target attribute to obtain an edited video containing the combined video frame, wherein the target attribute is a recorded attribute corresponding to the video frame, and the to-be-combined picture is a picture obtained by adjusting a set picture to a size represented by the target attribute. And / or, The method according to any one of claims 1-6, characterized in that For each video frame in the original video corresponding to the adjustment process, a to-be-combined text box is combined into the video frame according to a position represented by a target attribute to obtain an edited video containing the combined video frame, wherein the to-be-combined text box is a text box containing text of the recorded editing material, and the size of the to-be-combined text box is the same as a size represented by the target attribute. The method further comprises: A playing time period of the editing material is determined. The method further comprises: In the process of playing the original video, the attribute of the editing material is adjusted so that the editing material changes with the video playing. In the process of playing the video picture in the playing time period of the original video, the attribute of the editing material is adjusted so that the editing material changes with the playing of the video picture in the playing time period. The method of claim 10, wherein The determining of the playing time period of the editing material comprises: In response to an editing material adding operation, a playing progress bar for the editing material is displayed in a setting area of a video playing interface; In response to an adjusting operation on the playing progress bar, the playing time period of the editing material is determined according to the start and end time corresponding to the adjusted playing progress bar. A video editing apparatus characterized by comprising: The device comprises: An editing material generating module, configured to generate an editing material on a layer above an original video playing layer in response to an editing material adding operation; An editing material adjusting module, configured to adjust the attribute of the editing material in the process of original video playing so that the editing material changes with the playing of the video, wherein the adjustment of the editing material is manual adjustment and / or automatic adjustment; An adjustment process recording module, configured to record the adjustment process of the attribute of the editing material in the time period of the original video playing; A video generating module, configured to generate an edited video with the editing material in response to a video saving operation according to the original video and the recorded adjustment process of the attribute of the editing material, wherein the change of the editing material in the edited video in the playing process is the same as the adjustment process. According to the device of claim 12, wherein The adjustment of the editing material comprises manual adjustment; The adjustment process recording module comprises an adjusting operation response sub-module, configured to continuously record the attribute information of the editing material at the current playing time in response to the manual adjustment operation of the editing material; Or The adjusting operation response sub-module is specifically configured to: continuously record the position information and / or movement path information of the editing material at the current playing time in response to the operation of manually dragging the editing material; and / or, continuously record at least one of the following information of the editing material at the current playing time in response to the operation of manually scaling the editing material: scaling amount, scaling ratio, position information, size; and / or, continuously record the rotation angle and / or position information of the editing material at the current playing time in response to the operation of manually rotating the editing material; and / or, continuously record at least one of the following setting items of the editing material at the current playing time in response to the operation of manually editing the setting items of the editing material: transparency, color, line width, line type, appearance mode, disappearance mode; Or The adjustment of the editing material comprises automatic adjustment; the adjustment process recording module is specifically configured to generate the editing material corresponding to the position and size of the preset content in the original video in response to automatic identification of the preset content, the editing material follows the movement of the preset content, and continuously records the attribute information of the editing material at the current playing time; Or The adjustment of the editing material also includes manual adjustment; the device further comprises an attribute updating module configured to, before the video generation module responds to the video saving operation, replay the original video in response to a video replay operation, play the editing material on the upper layer based on the recorded adjustment process of the attribute of the editing material, and continuously update the attribute information of the editing material recorded at the current playing time in response to a human adjustment operation of the editing material; Or The editing material is at least one of text, letters, pictures, mosaics, and special effects; and / or, the attribute represents at least one of position, size, rotation angle, transparency, scaling ratio, color, line width, line type, appearance mode, and disappearance mode; and / or, the adding editing material operation is an editing operation on the played video under the condition of playing the video at a preset speed, wherein the preset speed is less than or greater than 1 times; and / or, the editing material is multiple, and the multiple editing materials are distributed on at least two layers above the original video playing layer; Or The editing material and the to-be-edited region in the video playing picture of the original video change synchronously; Or The adding editing material operation is a region marquee operation on the to-be-edited region in the video playing picture of the original video; the editing material generation module is specifically configured to, in response to the adding editing material operation, determine the to-be-edited region in the video playing picture of the original video according to the marquee region of the adding editing material operation, adjust the pixel value of the pixel in the to-be-edited region according to the pixel value of the pixel in the to-be-edited region, obtain a picture with the same size as the marquee region as the editing material, and display the editing material on the upper layer of the original video playing layer; and / or, generate a picture with the same size as the marquee region as the editing material according to a set picture, and display the editing material on the upper layer of the original video playing layer; and / or, generate a text box with the same size as the marquee region, display the text box on the upper layer of the original video playing layer, obtain the text input by a user in the text box, and obtain a text box containing the obtained text as the editing material; Or The video generation module is specifically configured to, in response to a video saving operation, determine a to-be-edited region in a decoded image of a video frame in the original video according to a recorded adjustment process of the attribute of the editing material; adjust pixel values of pixels in the to-be-edited region in each decoded image according to the pixel values of the pixels; perform video encoding based on the decoded image after the pixel values are adjusted to obtain an edited video; and / or, for each video frame in the original video corresponding to the adjustment process, synthesize a to-be-combined picture into the video frame according to a position represented by a target attribute to obtain an edited video containing a synthesized video frame, wherein the target attribute is a recorded attribute corresponding to the video frame, and the to-be-combined picture is a picture obtained by adjusting a set picture to a size represented by the target attribute; and / or, for each video frame in the original video corresponding to the adjustment process, synthesize a to-be-combined text box into the video frame according to a position represented by the target attribute to obtain an edited video containing a synthesized video frame, wherein the to-be-combined text box is a text box containing a recorded text of the editing material, and the size of the to-be-combined text box is the same as a size represented by the target attribute. Or The device further includes a playing time period determination module configured to determine a playing time period of the editing material; and the editing material adjustment module is specifically configured to adjust the attribute of the editing material during playing of a video picture in the playing time period of the original video, so that the editing material changes with the playing of the video picture in the playing time period. Or The playing time period determination module is specifically configured to, in response to an adding editing material operation, display a playing progress bar for the editing material in a set region of a video playing interface; and in response to an adjustment operation on the playing progress bar, determine the playing time period of the editing material according to start and end times corresponding to the adjusted playing progress bar. An electronic device, characterized by comprising: The computer program is stored in the memory and executed by the processor to implement the method in any of claims 1-11. The computer program is stored in the computer readable storage medium and executed by the processor to implement the method in any of claims 1-11. ​ A computer-readable storage medium, characterized by ​

Citation Information

Patent Citations

  • Video file processing method, related device and equipment

    CN110582018A

  • Multimedia data processing method, multimedia data generating method and related equipment

    CN112073649A

  • Video tracking processing method and device, electronic equipment and storage medium

    CN114816190A

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

    CN118450198A

  • Electronic device for mosaic processing for image and method for operating thereof

    KR102357908B1