Video editing method, device, electronic device and storage medium
By generating and adjusting editing materials during the video playback process, the problem of insufficient flexibility in video editing in the existing technology is solved, the flexibility and privacy protection of video editing are achieved, and diverse needs are met.
Patent Information
- Application Number
- CN202410840749.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-26
AI Technical Summary
Existing technology makes it difficult to effectively edit videos, especially when protecting user privacy and meeting diverse video editing needs, and the editing process is not flexible enough.
By generating and adjusting editing materials during video playback, recording changes in material properties, and generating edited videos with editing materials, synchronized changes in editing materials and videos are achieved.
It improves the flexibility and efficiency of video editing and meets the diverse video editing needs of users, especially in terms of protecting user privacy and personalized editing.
Smart Images

Figure CN118450198B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a video editing method, device, electronic device and storage medium. Background Art
[0002] Videos are widely used in various scenarios due to their large amount of information and rich content. Users have different needs for using videos in different scenarios, and often need to edit videos to meet their own needs.
[0003] For example, there may be user privacy information in the video. If the video is used directly, it is easy to cause user privacy leakage. Therefore, the video needs to be edited to protect user privacy security. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a video editing method, device, electronic device and storage medium to edit a video. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a video editing method, the method comprising:
[0006] In response to the operation of adding editing material, generating editing material in a layer above the original video playback layer;
[0007] During the playback of the original video, adjusting the properties of the editing material so that the editing material changes as the video is played, wherein the editing material is adjusted manually and / or automatically;
[0008] Recording the adjustment process of the attributes of the editing material during the time period of the original video playback;
[0009] In response to a video saving operation, an edited video with the editing material is generated according to the original video and the recorded adjustment process of the properties of the editing material, wherein during the playback of the edited video, the changes of the editing material are the same as the adjustment process.
[0010] In a second aspect, an embodiment of the present application provides a video editing device, the device comprising:
[0011] An editing material generating module, used for generating editing materials on a layer above the original video playing layer in response to an operation of adding editing materials;
[0012] An editing material adjustment module, used for adjusting the properties of the editing material during the playback of the original video, so that the editing material changes with the video playback, wherein the adjustment of the editing material is manual adjustment and / or automatic adjustment;
[0013] An adjustment process recording module, used to record the adjustment process of the attributes of the editing material during the time period of the original video playback;
[0014] A video generation module is used to generate an edited video with the editing material in response to a video saving operation, based on the original video and the recorded adjustment process of the attributes of the editing material, wherein during the playback of the edited video, the changes of the editing material are the same as the adjustment process.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0016] Memory, used to store computer programs;
[0017] The processor is used to implement the method described in the first aspect when executing the program stored in the memory.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including:
[0019] Memory, used to store computer programs;
[0020] The processor is used to implement the method described in the first aspect when executing the program stored in the memory.
[0021] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect.
[0022] As can be seen from the above, when the solution provided in the embodiment of the present application is used for video editing, editing materials can be generated in the layer above the original video playback layer. Then, while the original video is being played, the properties of the editing materials can be adjusted so that the editing materials change as the video is played, and the adjustment process of the properties of the editing materials during the time period of the original video playback is recorded. In this way, in response to the video save operation, an edited video with the editing materials can be generated based on the adjustment process of the properties of the original video and the recorded editing materials, thereby realizing the addition of the editing materials to the video screen, that is, realizing the editing of the video.
[0023] In addition, the properties of the edited material can be continuously adjusted during the playback of the original video. In other words, during the playback of the original video, the properties of the generated edited material are not fixed, but can be flexibly changed at any time. At different video playback moments, the edited material can have different properties. In this way, after recording the adjustment process of the properties of the edited material during the time period of the original video playback, based on the original video and the adjustment process of the properties of the recorded edited material, an edited video with constantly changing properties of the edited material can be generated, and the changes of the edited material in the edited video are the same as the adjustment process, which can meet the diverse video editing needs of users and improve the flexibility of video editing.
[0024] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0026] Figure 1a A schematic diagram of a first video editing interface provided in an embodiment of the present application;
[0027] Figure 1b A schematic diagram of a second video editing interface provided in an embodiment of the present application;
[0028] Figure 1c A schematic diagram of a third video editing interface provided in an embodiment of the present application;
[0029] Figure 1d A schematic diagram of a fourth video editing interface provided in an embodiment of the present application;
[0030] Figure 1e A schematic diagram of a fifth video editing interface provided in an embodiment of the present application;
[0031] Figure 1f A schematic diagram of a sixth video editing interface provided in an embodiment of the present application;
[0032] Figure 1g A schematic diagram of a seventh video editing interface provided in an embodiment of the present application;
[0033] Figure 1h A schematic diagram of an eighth video editing interface provided in an embodiment of the present application;
[0034] Figure 1iA schematic diagram of a ninth video editing interface provided in an embodiment of the present application;
[0035] Figure 1j A schematic diagram of a tenth video editing interface provided in an embodiment of the present application;
[0036] Figure 1k A schematic diagram of an eleventh video editing interface provided in an embodiment of the present application;
[0037] Figure 1l A schematic diagram of a twelfth video editing interface provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of a video editing method provided in an embodiment of the present application;
[0039] Figure 3a A schematic diagram of a thirteenth video editing interface provided in an embodiment of the present application;
[0040] Figure 3b A schematic diagram of a fourteenth video editing interface provided in an embodiment of the present application;
[0041] Figure 3c A schematic diagram of a fifteenth video editing interface provided in an embodiment of the present application;
[0042] Figure 3d A schematic diagram of a sixteenth video editing interface provided in an embodiment of the present application;
[0043] Figure 4a A schematic diagram of a path point provided in an embodiment of the present application;
[0044] Figure 4b A schematic diagram of a first scaling amount provided in an embodiment of the present application;
[0045] Figure 4c A schematic diagram of a second scaling amount provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of a process of changing an editing material provided in an embodiment of the present application;
[0047] Figure 6 A signaling interaction diagram of a video editing method provided in an embodiment of the present application;
[0048] Figure 7 A schematic diagram of the structure of a video editing device provided in an embodiment of the present application;
[0049] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0051] First, the execution subject of the solution provided in the embodiment of the present application is described.
[0052] The executor of the solution provided in the embodiment of the present application is: any electronic device with data processing, storage and other functions.
[0053] The embodiments of the present application do not limit the above-mentioned electronic device. In one case, the above-mentioned electronic device may be a computer installed with video editing software for implementing the solution provided by the embodiments of the present application.
[0054] The following further describes the application scenarios of the solutions provided in the embodiments of the present application.
[0055] The application scenarios of the solution provided in the embodiments of the present application are: various scenarios in which users edit videos, which are introduced with examples below.
[0056] In one case, there may be user privacy information in the video. In order to prevent the leakage of privacy information, the user needs to block the area where the private information is located in the video to protect the user's privacy security. For example, the user may want to use mosaic to block the license plate number in the video.
[0057] In another case, the user needs to mark the object in the video screen or add a sticker to meet his or her own personalized needs. For example, the user may want to display a text box describing person A near person A to achieve the marking of person A.
[0058] In another case, the user wants to generate a material that moves continuously as the video screen is played. For example, after the user adds a sticker or special effect to the video screen, the user may want the sticker or special effect to move from the left side of the video screen to the right side of the video screen as the video screen is played.
[0059] To facilitate understanding of the solution provided by the embodiment of the present application, the solution provided by the embodiment of the present application will be introduced from the perspective of the operations performed when the user uses video editing software to edit the video and the interface changes in response to the user operations (the above operations are divided into four stages below).
[0060] It should be noted that the user operations and interface changes in response to the user operations shown below are merely an embodiment of the solution provided in the present application and do not constitute a limitation on the solution provided in the present application.
[0061] Stage 1: Use the video editing software installed in the electronic device to open the video file and click the play button on the video editing software interface, and the electronic device starts playing the video.
[0062] The above-mentioned video file can be a video file of any video stored in the electronic device, and the embodiment of the present application does not limit this. In one case, the above-mentioned video file can be a video file captured by a camera deployed on the road.
[0063] The video editing software is pre-installed in the electronic device, and the user can open the video file through the video editing software.
[0064] In one implementation, the user can browse the video file of the video to be edited from the local file system, then right-click the video file of the video to be edited, select the "Open with" option from the expanded tab, and then select to open with video editing software from the sub-options of the Open with option.
[0065] In another implementation, the user can open the video editing software, click the "File" button in the video editing software, click the "Open" option from the expanded tab, enter the local file system, select the video to be edited, and open the video file in the video editing software.
[0066] After opening the video file, Figure 1a As shown, the video editing interface 10 displays the video in the 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 the playing button 102, and the video editing software starts playing the video. Figure 1a Also shown is a speed adjustment control 103, which is used to adjust the speed of video playback. Figure 1a The text or icons displayed in the subsequent drawings related to the video editing interface are used to represent the relevant controls on the video editing software interface. Unless otherwise specified, no attention is needed.
[0067] Phase 2: triggering the operation of adding editing materials, the electronic device generates editing materials on the layer above the original video playback layer.
[0068] Among them, after the editing material is generated, the editing material will be displayed in the upper layer of the video playback screen along with the video playback editing material.
[0069] The above-mentioned operation of adding editing materials is used to indicate adding editing materials on the video screen, which can be triggered in a variety of ways. Depending on the triggering method, the area of the generated editing materials in the layer may also be different, which are introduced below.
[0070] In one embodiment, the user can click on the editing material adding control on the video editing interface, and the clicking operation of clicking on the editing material adding control is the adding editing material operation. In this case, the editing material can be generated in a preset area in the upper layer of the original video playback layer.
[0071] The above-mentioned editing material adding control is used to add editing materials to the video. There may be one editing material adding control or multiple different editing material adding controls on the video editing interface.
[0072] See also Figure 1b It can be seen that the editing material adding controls on the video editing interface may include an adding text control 104, an adding mosaic control 105 and an adding sticker control 106, and the above-mentioned editing material adding controls are used to add text, mosaic and sticker to the area to be edited in the video respectively.
[0073] Of course, editing material and adding controls may also include adding special effect controls, adding letter controls, etc., which is not limited in this embodiment of the present application.
[0074] The above-mentioned preset area can be a preset middle area, a preset upper area, a preset lower area, etc. in the layer, and the embodiment of the present application is not limited to this.
[0075] In this implementation, after the user clicks the editing material adding control, the editing material can be generated in the preset area on the layer, without having to select the area for generating the editing material on the video screen, and the operation is relatively convenient.
[0076] In another implementation, the user can click on the editing material adding control on the video editing interface and perform a region selection operation in the layer above the video playback screen. The above-mentioned click operation of clicking on the editing material adding control and the region selection operation are the operations of adding editing materials. In this case, editing materials can be generated for the to-be-edited region of the video playback screen in the layer above the original video playback layer.
[0077] The above-mentioned area to be edited is introduced below.
[0078] In this implementation, the above-mentioned area to be edited may be an area in the video screen corresponding to the area framed by the above-mentioned area frame selection operation, may be one area on the video screen, or may be multiple different areas on the video screen.
[0079] In one case, the user can perform a region selection operation on the layer above the video playback screen according to the position and size of the object to be edited on the currently playing video screen.
[0080] In this case, the above-mentioned area to be edited is an area determined based on the area where the object to be edited is located on the video screen.
[0081] The above-mentioned object to be edited can be any object in the video screen, such as an object to be blocked, an object to be marked, etc., which can be set according to actual needs and is not limited in this embodiment of the present application.
[0082] See also Figure 1c Taking adding mosaics to a video as an example, the user wants to use mosaics to cover the license plate number in the video screen. The user clicks the add mosaic control 105, and then performs a region selection operation in the upper layer of the video playback screen according to the position and size of the region where the license plate (the object to be edited) is located in the video screen. At this time, the above-mentioned region to be edited is the region 107 corresponding to the region selected by the above-mentioned region selection operation in the video screen. In this way, a mosaic 108 can be generated in the region to be edited 107.
[0083] It can be seen that, in this case, the above-mentioned area to be edited is actually the area where the object to be edited is located in the video screen.
[0084] See also Figure 1d , taking adding a text box in a video as an example, the user wants to use a text box to mark the person in the video screen, the user clicks the add text box control 104, and then performs a region selection operation on the upper layer of the video playback screen according to the position and size of the area where the person (the object to be edited) is located in the video screen. At this time, the above-mentioned area to be edited is the area 109 corresponding to the area selected by the above-mentioned region selection operation in the video screen. In this way, a text box 110 can be generated in the area to be edited 109, and then the text "person A" entered by the user in the text box 110 is obtained, and finally a text box 111 including text is generated on the video screen, and the text box 111 includes the text "person A".
[0085] It can be seen that in this case, the above-mentioned area to be edited is not the area where the object to be edited is located in the video picture, but an area determined based on the area where the object to be edited is located in the video picture.
[0086] According to the above method, the user determines the area to be edited according to the object to be edited on the played video screen, so that the electronic device can generate editing materials in the area to be edited.
[0087] Of course, as the video plays, when a new object to be edited appears on the video screen, the user can use the above method to determine a new area to be edited for the new object to be edited, so that the electronic device can generate new editing materials in the area to be edited, which will not be repeated here.
[0088] It should be noted that the editing material generated in the area to be edited can have a background color or no background color; can have border lines or no border lines. For example, the text library generated in the area to be edited can have no background color and border lines. In addition, the transparency, border line width, border line type, etc. of the editing material generated in the area to be edited can be adjusted, and the specific adjustment method will not be repeated here.
[0089] It should be noted that Figure 1c , Figure 1d The example shown is a case where there is only one object to be edited on the video screen. When there are multiple objects to be edited on the video screen, the user can repeat the above operation for each object to be edited, thereby determining multiple areas to be edited, and generating multiple editing materials for the determined multiple areas to be edited.
[0090] See also Figure 1e The video screen includes vehicles and people. The user can first generate a mosaic 108 for the license plate of the vehicle, and then generate a text box 111 for the person. The process of generating a mosaic and generating a text box is the same as the above. Figure 1c , Figure 1d The process shown is the same, so Figure 1e Omitted in .
[0091] In another embodiment, the user can click on the smart editing control on the video editing interface, and then the electronic device can perform target recognition on the currently playing video screen, automatically determine the object to be edited, and determine the area to be edited in the video playback screen based on the position and size of the target to be edited.
[0092] See also Figure 1f , the user clicks on the smart editing control 112, and then the electronic device identifies the license plate as the object to be edited by performing target recognition on the currently played video screen, and then determines the area to be edited 113 according to the position and size of the area where the license plate is located in the video screen. In this way, a mosaic 114 can be generated in the area to be edited 113.
[0093] In one embodiment of the present application, after the user clicks on the smart editing control, an object selection control may pop up on the video editing interface. The object selection control may display preset objects to be edited. The user may select the object to be edited in the target selection control, and the electronic device may identify the object to be edited in the video screen.
[0094] In one embodiment of the present application, after the user clicks on the smart editing control, an editing type control may pop up on the video editing interface, and preset editing types may be displayed in the editing type control. The user may select the editing type in the target selection control, and the electronic device determines the area to be edited in the video screen according to the editing type selected by the user.
[0095] For example, if the editing type selected by the user is an occlusion type, the electronic device can directly determine the area where the object to be edited is located in the video screen as the area to be edited; if the editing type selected by the user is an annotation type, the electronic device can determine the area to be edited based on the area where the object to be edited is located in the video screen, such as determining an area at a preset distance from the area where the object to be edited is located in the target direction as the area to be edited. The above-mentioned target direction can be any direction such as up, down, etc., and the embodiments of the present application are not limited to this.
[0096] According to the above method, the electronic device determines the area to be edited according to the object to be edited on the played video screen, so that the editing material can be generated in the area to be edited. It should be noted that the electronic device can perform object tracking recognition on the object to be edited in the video screen. As the video is played, when the electronic device recognizes a new object to be edited, the above method can be used to determine a new area to be edited for the new object to be edited, so that new editing material can be generated in the area to be edited, which will not be repeated here.
[0097] It should be noted that Figure 1f The example shown is a case where there is only one object to be edited on the video screen. When the electronic device detects that there are multiple objects to be edited on the video screen, the above operation can be repeated for each object to be edited, thereby determining multiple areas to be edited, and generating multiple editing materials for the determined multiple areas to be edited.
[0098] In one embodiment of the present application, the above-mentioned operation of adding editing materials may be: an editing operation on the played video when the video is played at a preset speed.
[0099] Among them, the above-mentioned preset speed can be less than 1 speed, such as 1 / 2 speed, 1 / 4 speed, 1 / 8 speed, 1 / 16 speed, etc.
[0100] That is, the above-mentioned operation of adding editing materials is an editing operation on the video being played when the video is in a slow playback state.
[0101] When the video is in slow playback mode, the position and size of the object to be edited in the video screen also change slowly. Since the position and size of the area to be edited can be determined based on the position and size of the object to be edited in the video screen, this is conducive to improving the accuracy of subsequent determination of the position and size of the area to be edited, and thus can improve the accuracy of adjusting the position and size of the generated editing material according to the changes in the position and size of the area to be edited.
[0102] The above preset speed may also be greater than 1 speed, such as 1.5 times speed, 2 times speed, 4 times speed, etc.
[0103] That is, the above-mentioned operation of adding editing materials is an editing operation on the video being played when the video is in a fast-playing state.
[0104] When the video is in fast playback mode, each frame of the video switches quickly and the time required to play the entire video is short. In this case, editing materials can be quickly added to the video screen to improve video editing efficiency.
[0105] Of course, the above preset speed may also be a normal speed, that is, 1x speed.
[0106] Stage 3: Adjust the properties of the edited material while the original video is playing.
[0107] In one case, the user can adjust the properties of the edited material during the playback of the original video according to his or her own personalized needs.
[0108] In this case, users can flexibly adjust the properties of the editing material according to their own preferences. The following three examples are used to introduce this.
[0109] Example 1:
[0110] After the special effects are generated in the upper area of the upper layer of the original video playback layer, if the user wants to move the special effects from the upper area to the lower area of the video screen, the user can adjust the position of the generated special effects from top to bottom during the original video playback.
[0111] Example 2:
[0112] After a map is generated in the upper area of the upper layer of the original video playback layer, during the original video playback, the user can adjust settings such as transparency, color, line width, line type, appearance mode, disappearance mode, etc. of the generated map.
[0113] The above-mentioned line width may refer to the width of the border line of the map, which may be specifically 1 width unit, 2 width units, etc.; the above-mentioned line type may refer to the line type of the border line of the map, which may be specifically a solid line type, a dotted line type, etc.
[0114] The above-mentioned appearance modes may include direct appearance, appearance in a fade-in mode, etc.; the above-mentioned disappearance modes may include direct disappearance, disappearance in a fade-out mode, etc.
[0115] Example 3:
[0116] After a map is generated in the upper area of the upper layer of the original video playback layer, during the playback of the original video, the user can adjust the rotation angle of the generated map.
[0117] See also Figure 1g , the video is being slowed down at a speed of 1 / 16. After a cloud-shaped sticker 120 is generated in the video screen, the user wants to change the rotation angle of the sticker 120. Therefore, the user can drag the rotation control point 1201 of the sticker 120. In this way, by dragging the rotation control point 1201 in the direction of the arrow, the sticker 120 can be rotated in the direction of the arrow as a whole.
[0118] Among them, the rotation control point 1201 can be called out by clicking on the sticker, double-clicking the sticker, etc., and this embodiment of the present application is not limited to this.
[0119] In another case, the user can adjust the properties of the area to be edited according to the property changes of the object to be edited, so that the electronic device can adjust the properties of the generated editing material according to the property changes of the area to be edited.
[0120] From the above introduction, it can be seen that the position and size of the area to be edited can be determined based on the position and size of the object to be edited in the video screen. Then, as the video plays, the position and size of the object to be edited in the video screen may change, and thus, the position and size of the area to be edited may also change accordingly.
[0121] In one embodiment of the present application, the position and size of the generated editing material can be adjusted when the video is played at a preset speed.
[0122] The following takes the example that the area to be edited is an area determined by the user, and introduces the method of adjusting the position and size of the generated editing material according to different situations.
[0123] In the first case, adjust the position of the generated editing material.
[0124] First, take the editing material as mosaic as an example, see Figure 1hThe video is being slowed down at a speed of 1 / 16. After the mosaic 108 is generated in the area where the license plate is located in the video screen, the video editing software will play the mosaic 108 in the upper layer of the video screen as the video is played. As the video is played, the vehicle in the video screen continuously moves from the right side of the video screen to the left side of the video screen during driving, so that the license plate also continuously moves from the right side of the video screen to the left side of the video screen. The user can continuously drag the generated mosaic 108 according to the changes in the position of the license plate in the video screen, and adaptively drag the mosaic 108 from the right side to the left side, so that the mosaic 108 can dynamically cover the license plate.
[0125] like Figure 1h As shown, the user starts dragging the mosaic 108 when the video plays to the 1st second, and continues dragging the mosaic 108 as the video plays. When the video plays to the 3rd second, the mosaic 108 is dragged from the first position to the second position; the user continues dragging the mosaic 108 as the video plays, and when the video plays to the 5th second, the mosaic 108 is dragged from the second position to the third position, so that the mosaic 108 can dynamically cover the license plate.
[0126] Take editing a texture as an example, see Figure 1i , the video is being slowed down at a speed of 1 / 16. After the sticker 118 is generated in the area where the license plate is located in the video screen, the video editing software will play the sticker 118 in the upper layer of the video screen as the video is played. As the video is played, the vehicle in the video screen moves from the right side of the video screen to the left side of the video screen while driving, so that the license plate also moves from the right side of the video screen to the left side of the video screen. The user can continuously drag the generated sticker 118 according to the changes in the position of the license plate in the video screen, and adaptively drag the sticker 118 from the right side to the left side, so that the sticker 118 can dynamically cover the license plate.
[0127] like Figure 1i As shown, the user starts dragging sticker 118 at the 1st second of the video playback, and continues to drag sticker 118 as the video plays. At the 3rd second of the video playback, sticker 118 is dragged from the first position to the second position; the user continues to drag sticker 118 as the video plays, and at the 5th second of the video playback, sticker 118 is dragged from the second position to the third position, so that sticker 118 can dynamically cover the license plate.
[0128] The editing material is a text box device, so the size of the vehicle in the video screen becomes larger and larger, and the size of the license plate becomes larger and larger. The user can adjust the position of the generated editing material according to the situation. The method is similar to the above-mentioned case where the editing material is a mosaic or a texture. Examples are not given here one by one.
[0129] In the second case, adjust the size of the generated editing material.
[0130] See also Figure 1j The video is being slowed down at a speed of 1 / 16. After the mosaic 115 is generated in the area where the license plate is located in the video screen, the video editing software will play the mosaic 115 in the upper layer of the video screen as the video is played. As the video is played, the vehicle in the video screen is constantly approaching the video to capture the changes in the size of the license plate in the video screen, and the generated mosaic 115 is continuously stretched, and the mosaic 115 is adaptively stretched from small to large so that the mosaic 115 can dynamically cover the license plate.
[0131] like Figure 1j As shown, the user starts stretching mosaic 115 at the 1st second of the video playback, and continues dragging mosaic 115 as the video plays. At the 3rd second of the video playback, the size of mosaic 115 is stretched and enlarged to the same size as the license plate, so that mosaic 115 can dynamically cover the license plate.
[0132] Of course, the user can also reduce the generated mosaic from large to small according to the actual situation, and the embodiments of the present application will not give examples one by one.
[0133] Also, in some cases, when the size of the generated editing material is adjusted, the shape of the editing material may change.
[0134] 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 editing material after adjustment is a square.
[0135] It should be noted that Figure 1h-1j The example shown is a case where the position and size of a generated editing material are adjusted according to the changes in the position and size of the area to be edited. In the case where multiple editing materials have been generated, the above-mentioned 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 changes in the properties of the area to be edited.
[0136] When the area to be edited is an area automatically determined by the electronic device, the electronic device can continuously detect the position and size of the object to be edited in the video screen, determine the attributes of the area to be edited according to the detected position and size, and adaptively adjust the attributes of the generated editing material to be consistent with the attributes of the area to be edited. In the case where multiple editing materials have been generated, the above-mentioned attribute adjustment operation can be performed simultaneously for each of the generated editing materials, so that the attributes of multiple editing materials can be adjusted simultaneously.
[0137] When the editing material is a text box or a texture, the method of adjusting the size of the generated editing material is similar to the above-mentioned case where the editing material is a mosaic, and examples are not given here one by one.
[0138] The third case is to adjust the shape of the generated editing material.
[0139] In some cases, by adjusting the shape of the generated editing material, the generated editing material can cover the area to be edited in real time.
[0140] See also Figure 1k , the video is being slowed down at a speed of 1 / 16. After an elliptical texture 119 is generated in the area where the license plate is located in the video screen, the video editing software will play the texture 119 in the upper layer of the video screen as the video is played. As the video is played, the vehicle in the video screen is constantly approaching the video acquisition device during driving, so that the size of the vehicle in the video screen is getting bigger and bigger, and the size of the license plate is also getting bigger and bigger. The user can continuously stretch the generated texture 119 in the short axis direction according to the change in the size of the license plate in the video screen, and adaptively stretch the texture 119 from small to large, so that the short axis length of the texture 119 becomes larger and larger, so that the texture 119 can dynamically cover the license plate.
[0141] like Figure 1k As shown, the user starts stretching sticker 119 at the 1st second of the video playback, and continues to drag sticker 119 in the short axis direction as the video plays. At the 3rd second of the video playback, the shape of sticker 119 is stretched from an ellipse to a circle, so that sticker 119 can dynamically cover the license plate.
[0142] When the editing material is a text box or a mosaic, the method of adjusting the shape of the generated editing material is similar to the above-mentioned case where the editing material is a texture, and examples are not given here one by one.
[0143] In one 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 an editing operation on the text in the text box.
[0144] It can be seen that in the above embodiment, the editing material can change synchronously with the to-be-edited area in the video playback screen of the original video, thereby improving the flexibility of video editing.
[0145] See also Figure 1l, the video is being slowed down at a speed of 1 / 16. After a text box 111 is generated above the area where the person is located in the video screen, the video editing software will play the text box 111 in the layer above the video screen as the video is played. As the video is played, the user finds that the person in the video screen is incorrectly labeled, so the user can click on the text box 111. The text box 111 displays an outer border. The user can delete the original text "Person A" in the text box 111 and enter a new text "Person B", so that the electronic device can obtain the text "Person B" and update the text in the text box 111 to "Person B" to obtain a new text box 121.
[0146] It can be seen that in this 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 or her own needs during the playback of the video, thereby realizing the display of different texts at different playback times of the video, thereby improving the flexibility of the user in video editing.
[0147] In one embodiment of the present application, after adjusting the properties of the editing material, the user can also change the video playback time and adjust the properties of the generated editing material again on the video playback screen. In this way, the user can conveniently make a second adjustment to the properties of the editing material, so that the user can more accurately adjust the properties of the editing material, thereby improving the convenience of the editing operation.
[0148] Stage 4: Triggering the video saving operation to generate an edited video with the edited footage.
[0149] The electronic device can record the adjustment process of the attributes of the editing material within the time period of the original video playback. In this way, after the user triggers the video save operation, the electronic device can generate an edited video with the editing material based on the recorded adjustment process of the editing material, and during the playback of the edited video, the changes in the editing material are the same as the adjustment process.
[0150] The specific manner in which the electronic device generates the above video is detailed in the subsequent embodiments and will not be described in detail here.
[0151] Next, combine Figure 2 The flowchart shown introduces the video editing solution provided in the embodiment of the present application.
[0152] See also Figure 2 A flowchart of a video editing method provided in an embodiment of the present application includes the following steps S201-S204.
[0153] Step S201: In response to the operation of adding editing materials, editing materials are generated in the layer above the original video playback layer.
[0154] In addition to the text, stickers and mosaics mentioned above, the editing materials may also include letters, special effects, etc., which are not limited in the embodiments of the present application.
[0155] In this way, a rich variety of editing materials can be added to the video, which is conducive to meeting the personalized needs of users and improving the flexibility of video editing.
[0156] The triggering method for adding and editing material operations has been explained in the previous article and will not be repeated here.
[0157] The original video playback layer refers to the layer that plays the video images in the original video.
[0158] In this step, the editing material generated in the layer above the original video playback layer can be one or more. The layers generated by these editing materials are introduced below according to different situations.
[0159] When generating an edit material:
[0160] The edited material may be generated as a layer above the original video playback layer.
[0161] When generating multiple edit materials:
[0162] The first method is to generate multiple editing materials on the same layer above the original video layer. In other words, multiple editing materials are located on one layer.
[0163] It is understood that when multiple editing materials are located on the same layer, during the video playback, the user can adjust the properties of each editing material simultaneously, staggered or intermittently, so that multiple editing materials can be added to the layer and the properties of multiple editing materials can be adjusted as the video is played, thereby improving the efficiency of video editing. Of course, the user can also play the video multiple times and adjust the properties of one of the editing materials each time it is played, so that the adjustment is more precise. The specific adjustment method is not limited here.
[0164] In addition, during video playback, users can pause the video at any time, and the generated edited video does not contain the pause time, that is, the generated edited video is played smoothly and corresponds to the duration of the original video being played. When the video is paused, users can adjust the properties of the edited material in the layer above the paused video screen, or pause to adjust the properties of the edited material.
[0165] In the second way, 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 playback layer.
[0166] Among them, for the at least two layers on which the multiple editing materials are distributed, each layer may be distributed with one editing material or multiple editing materials.
[0167] In one case, when generating editing materials, the editing materials indicated by the adding editing material operation can be generated on the upper layer of the last editing material generated. For example, editing material A is generated on layer layer 1 above the original video playback layer. In response to the adding editing material operation, the editing material indicated by the adding editing material operation is determined to be editing material B, and the editing material can be generated on layer layer 2 above layer layer 1. In this case, the generated multiple materials are distributed in different layers.
[0168] Similarly, when multiple editing materials are located in different layers, during video playback, the user can also adjust the properties of each editing material simultaneously, alternately or intermittently, or play the video multiple times and adjust the properties of one of the editing materials each time, or pause the video at any time and adjust the properties of the editing material in the layer above the paused video screen.
[0169] When two editing clips displayed on different layers overlap, the editing clip displayed on the upper layer will cover the clip displayed on the lower layer.
[0170] In this way, multiple editing materials can be distributed on different layers above the original video playback layer, so that by setting the layer where the editing materials are located, the display relationship of multiple editing materials when they are superimposed can be changed, thereby improving the flexibility of video editing.
[0171] The following is an introduction to the area in the layer where the editing materials generated in the upper layer are located.
[0172] In one implementation, after the operation of adding editing materials is triggered, the editing materials may be generated in a preset area in a layer above the original video playback layer.
[0173] In another implementation, an area corresponding to the area to be edited may be determined in the layer above the original video playback layer, and editing materials may be generated in the determined area. The specific implementation has been introduced in the above user operation embodiment, and will not be repeated here.
[0174] In this implementation manner, the initial value of the first information in the attribute of the generated editing material may be the same as the initial value of the first information in the attribute of the area to be edited.
[0175] First, the meaning of the attributes of the editing material is introduced.
[0176] The above attributes may include first information characterizing the position and size of the editing material, and may also include information such as the rotation angle, transparency, scaling, color, line width, line type, appearance mode, disappearance mode, etc. of the editing material, which is not limited in the embodiments of the present application.
[0177] In this way, when generating editing materials, various attributes of the editing materials can be considered, and the adjustment process of the various attributes of the editing materials can be recorded later, so that the edited video can be generated according to the recorded adjustment process, which improves the flexibility of video editing.
[0178] The above-mentioned first information can be any information that can characterize the position and size. The embodiment of the present application is not limited to this, and is explained below by way of example.
[0179] In one case, the first information may be the coordinates of a corner point of the editing material.
[0180] For example, if the shape of the editing material is a rectangle, the above attributes can be the coordinates of the four vertices of the editing material, the coordinates of the three vertices of the editing material, or 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.
[0181] In another case, the first information may be the center point coordinates and side length of the editing material.
[0182] For example, if the shape of the editing material is a rectangle, the above attributes may be the coordinates of the center point of the editing material and the length and width of the editing material.
[0183] In another case, the first information may be the corner point coordinates and side length of the editing material.
[0184] For example, if the shape of the editing material is a rectangle, the above attributes may be the coordinates of any vertex of the editing material and the length and width of the editing material.
[0185] The meanings of the attributes of the to-be-edited area and the first information are similar to the meanings of the attributes of the editing material and the first information, and are not described in detail here.
[0186] The initial value of the first information of the editing material is the same as the initial value of the first information of the area to be edited, and the first information represents the position and size, that is, 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 area to be edited.
[0187] That is, after determining the initial values of the position and size of the area to be edited according to the position and size of the object to be edited, the initial values of the position and size of the area to be edited are determined as the initial values of the position and size of the editing material, and then the editing material is generated according to the initial values of the position and size of the editing material.
[0188] With the aforementioned Figure 1c For example, the position and initial size of the area to be edited 107 are determined according to the area where the license plate is located in the video screen, and the position and initial size of the area to be edited 107 can be determined as the initial values of the position and size of the editing material. Figure 1c The area corresponding to the to-be-edited area 107 in the upper layer of the original video playback layer is mosaic 108 .
[0189] As can be seen from the above description, the editing material can be generated in a preset area of the layer, or a corresponding area can be determined in the layer based on the area to be edited, and the editing material can be generated in the determined area. Depending on the area where the editing material is generated, the specific method of generating the editing material can also be different, as detailed in the subsequent embodiments, which will not be described in detail here.
[0190] Step S202: During the playback of the original video, adjust the properties of the editing material so that the editing material changes as the video plays.
[0191] The adjustment of editing materials can be manual or automatic, and the specific method has been introduced in the above user operation section.
[0192] The editing material changes as the video plays, that is, the properties of the editing material are adjusted according to the properties of the area to be edited in the video playing screen.
[0193] According to the above introduction, the attributes of the generated editing material can be determined based on the attributes of the area to be edited. In one case, during the playback of the original video, the attributes of the editing material can be adjusted according to the changes in the attributes of the area to be edited so that the editing material changes with the video playback.
[0194] From the above introduction, it can be seen that the properties of the area to be edited in the video playback screen can actually be determined according to the properties of the object to be edited in the video playback screen. Therefore, the properties of the editing material can essentially be understood as being adjusted according to the properties of the object to be edited in the video playback screen.
[0195] The manner of adjusting the attributes of the editing material according to the attributes of the area to be edited in the video screen is described in detail in the subsequent embodiments and will not be described in detail here.
[0196] In one embodiment of the present application, when executing the above-mentioned step S202, the playback time period of the editing material can also be determined. During the process of playing the video images within the playback time period in the original video, the properties of the editing material can be adjusted so that the editing material changes as the video images within the playback time period are played.
[0197] The following is an introduction to how to determine the playback time period of the edited material.
[0198] In one implementation, in response to an operation of adding editing materials, a playback progress bar for the editing materials can be displayed in a set area of the video playback interface, and then in response to an operation of adjusting the playback progress bar, the playback time period of the editing materials can be determined based on the start and end times corresponding to the adjusted playback progress bar.
[0199] See also Figure 3a , taking the generated mosaic 108 as an example, after the mosaic 108 is generated in response to the operation of adding editing materials, a play progress bar 116 of the mosaic 108 can be displayed in the lower area of the video play interface, and the play progress bar 116 includes a play start time 1161 and a play end time 1162. Figure 3a The playback start time 1161 shown is the 0th second of the video, and the playback end time 1162 is the 60th second of the video, that is, the playback time period of the edited material is from the 0th second to the 60th second.
[0200] In one case, in response to a dragging operation on the play start time and / or play end time of the play progress bar, the start and end times corresponding to the dragged play progress bar can be determined, thereby obtaining the play time period of the edited material.
[0201] See also Figure 3b , after the user drags the play start time 1161 included in the play progress bar 116, the electronic device responds to the user's dragging operation and determines that the play start time 1161 after dragging is the 6th second, and the play end time 1162 remains unchanged, then the adjusted play time period of the edited material is the 6th second to the 60th second. Figure 3b The situation shown is similar and will not be described in detail here.
[0202] In another case, in response to the movement operation on the entire play progress bar, the start and end times corresponding to the moved play progress bar can be determined, thereby obtaining the play time period of the edited material.
[0203] See also Figure 3c , the playback start time 1161 is the 5th second of the video, and the playback end time 1162 is the 40th second of the video. After the user moves the playback progress bar 116 as a whole, the electronic device responds to the user's movement operation and determines that the time offset indicated by the movement operation is 5s. It can be determined that the playback start time 1161 after dragging is the 5th+5=10th second, and the playback end time 1162 after dragging is the 40th+5=45th second. The playback time period of the adjusted editing material is from the 10th second to the 45th second.
[0204] It should be noted that, in the case where a plurality of editing materials are generated, each editing material may display its own play progress bar, and the play time period of each editing material may be independently determined based on the play progress bar of each editing material.
[0205] See also Figure 3d The play progress bar 116 is the play progress bar of the mosaic 108 , and the play progress bar 117 is the play progress bar of the text box 111 . The user can determine the play time periods of the mosaic 108 and the text box 111 respectively by operating the play progress bar 116 and the play progress bar 117 respectively.
[0206] In this way, users can flexibly determine the playback time periods of different editing materials according to actual needs, so that different editing materials can be displayed in different time periods, which is conducive to meeting users' diverse video editing needs and improving the flexibility of video editing.
[0207] In this way, by adjusting the playback progress bar of the edited material, the playback time period of the edited material can be determined intuitively and quickly.
[0208] In another implementation, the play time period of the edited material may be directly determined as the complete play time period of the video.
[0209] It can be seen that in this embodiment, the playback time period can be determined for the editing material. In this way, only when the video screen within the above playback time period is played, the editing material will be played along with the video in the layer above the video playback screen. That is, the playback time period of the editing material can be adjusted purposefully, further improving the flexibility of video editing.
[0210] Step S203: recording the adjustment process of the attributes of the editing material during the time period of the original video playback.
[0211] The time period when the editing material is played during the original video playback can be the time period when the electronic device plays the editing material in the layer above the video playback screen as the video plays.
[0212] According to the description of the aforementioned step S202, in one case, after generating the editing material, the electronic device can determine the playing time period of the editing material.
[0213] In another case, when the electronic device automatically generates editing materials by performing object recognition on the video playback screen, the electronic device can follow the position of the object to be edited in the video playback screen as the video is played, and stop playing the generated editing materials when it is detected that the object to be edited disappears. In this case, the playback time period is the time period between the generation time of the editing materials and the disappearance time of the object to be edited.
[0214] Since step S202 has adjusted the attributes of the edited material during the original video playback, in this step, the adjustment process of the attributes of the edited material during the original video playback period can be recorded. The specific method of recording the adjustment process is detailed in the subsequent embodiments and will not be described in detail here.
[0215] In one embodiment of the present application, if the editing material is a text box containing text, the electronic device can also record the text contained in the text box.
[0216] Similarly, the electronic device may record the correspondence between each playback time and the text contained in the text box, and may also record the correspondence between the frame number of each video frame included in the video and the text contained in the text box.
[0217] Of course, the electronic device can also record the size, color, font and other information of the above text.
[0218] In this way, the electronic device can generate a video including the text recorded in the text box in the video screen based on the text contained in the recorded text box to meet the personalized needs of the user.
[0219] Step S204: In response to the video saving operation, an edited video with the editing material is generated according to the adjustment process of the properties of the original video and the recorded editing material.
[0220] Among them, during the playback of the edited video, the changes in the editing material are the same as the adjustment process.
[0221] Since the aforementioned step S203 records the adjustment process of the attributes of the editing material, in this step, an edited video in which the editing material continuously changes during playback can be generated based on the recorded adjustment process.
[0222] As can be seen from the above description, editing materials can be generated in a preset area of a layer, or a corresponding area can be determined in the layer based on the area to be edited, and editing materials can be generated in the determined area. Depending on the area where the editing materials are generated, the specific methods of generating an edited video with editing materials can also be different, which are introduced below.
[0223] For the case where editing materials are generated based on the area to be edited:
[0224] Specifically, depending on the editing material, the following methods can be used to generate the edited video:
[0225] In the first implementation mode, if the editing material is a mosaic, the area to be edited in the decoded image of the video frame in the original video can be determined according to the adjustment process of the properties of the recorded editing material, and then the pixel values of the pixels in the to-be-edited area are adjusted according to the pixel values of the pixels in the to-be-edited area in each decoded image, and video encoding is performed based on the decoded image after the pixel values are adjusted to obtain the edited video.
[0226] The video frames in the original video involved in determining the area to be edited may be video frames within the playback time period of the editing material.
[0227] Among them, relevant common methods can be used to decode the video frame or encode the decoded image to obtain the video frame, which will not be described in detail here.
[0228] As can be seen from the above description, the attributes of the editing material may include a variety of information, and the position and size of the editing material can be determined based on the included information.
[0229] For example, if the attributes of the editing material include the coordinates of the upper left vertex and the lower right vertex, the difference between the horizontal coordinates of the upper left vertex and the lower right vertex can be used as the length of the editing material, and the difference between the vertical coordinates of the upper left vertex and the lower right vertex can be used as the width of the editing material. Based on the coordinates of the upper left vertex and the lower right vertex and the determined length and width, the coordinates of the remaining vertices of the editing material can be calculated to obtain the position and size of the editing material.
[0230] For another example, if the attributes of the editing material include the center point coordinates and the length and width, the coordinates of the remaining vertices of the editing material can be calculated based on the center point coordinates and the length and width, thereby obtaining the position and size of the editing material.
[0231] The position and size of the editing material are obtained, that is, the area of the editing material in the video picture is obtained. The determined area is the to-be-edited area corresponding to the editing material in the decoded image.
[0232] The manner of adjusting the pixel values of the pixels in the to-be-edited area according to the pixels in the to-be-edited area in each decoded image may refer to the aforementioned manner of adjusting the pixel values of the pixels in the to-be-edited area to generate a mosaic image.
[0233] In this way, after the pixel values of the pixels in the area to be edited in the decoded image are adjusted, the area to be edited in the decoded image is a blurred mosaic area, which is equivalent to synthesizing the mosaic into the decoded image of the video frame. After the decoded image is encoded to obtain the video frame, the video screen including the mosaic is generated and played during the playback time period.
[0234] It can be seen that by adjusting the pixel values of pixels in the area to be edited in each decoded image, the mosaic can be synthesized into the decoded image of the video frame. In this way, when the edited video is finally played, the mosaic can cover the area to be edited in the video playback screen, so that the human eye cannot see the picture content in the area to be edited, which can protect the picture content in the area to be edited and improve the security of the picture content in the video.
[0235] In a second implementation, if the editing material is a texture, the image to be synthesized can be synthesized into each video frame in the playback time period according to the position represented by the target attribute to obtain an edited video including the synthesized video frame.
[0236] The target attribute is: the recorded attribute corresponding to the video frame, and the above-mentioned picture to be synthesized is: the picture after the set picture is adjusted to the size represented by the target attribute.
[0237] Among them, the method of determining the location of the material based on the properties of the editing material has been explained in the previous article and will not be repeated here.
[0238] For video frames corresponding to the same target attributes within the playback time period, the attributes of the set images in these video frames have not changed. Therefore, after generating the image to be synthesized for the first video frame of these video frames, the remaining video frames can directly use the generated image to be synthesized without regeneration.
[0239] Specifically, in this embodiment, the position of the target attribute representation is also the position of the area to be edited. For each video frame in the playback time period, the image to be synthesized can be synthesized to the determined position in the video frame to obtain a synthesized video frame.
[0240] In this way, the sticker can be synthesized into the area to be edited in the video frame. When the edited video is finally played, the sticker can cover the area to be edited in the video playback screen, so that the human eye cannot see the screen content in the area to be edited, which can protect the screen content in the area to be edited and improve the security of the screen content in the video. In addition, the sticker can display personalized content, which protects the screen content in the area to be edited while taking into account the personalized needs of users.
[0241] A third implementation method is that if the editing material is a text box, for each video frame in the original video corresponding to the adjustment process, the text box to be synthesized can be synthesized into the video frame according to the position represented by the target attribute to obtain an edited video containing the synthesized video frame.
[0242] The text box to be synthesized is: a text box containing text of the recorded editing material, and the size of the text box to be synthesized is the same as the size of the target attribute representation.
[0243] In this implementation, the method of synthesizing the text box to be synthesized into the video frame is similar to the method of synthesizing the picture to be synthesized into the video frame. The only difference is that the text box to be synthesized also includes the text of the editing material, which will not be repeated here.
[0244] In this way, the text box can be synthesized into the area to be edited in the video frame. When the edited video is finally played, the human eye can see the text in the text box as the video is played, which is conducive to meeting the user's personalized needs and improving the flexibility of video editing.
[0245] For generating editing materials based on preset areas:
[0246] In this case, the specific implementation method of generating the edited video can be obtained based on the aforementioned implementation method of generating the edited video based on the area to be edited. The only difference is that the area considered when generating the editing material is different, which will not be repeated here.
[0247] As can be seen from the above, when the solution provided in the embodiment of the present application is used for video editing, editing materials can be generated in the layer above the original video playback layer. Then, while the original video is being played, the properties of the editing materials can be adjusted so that the editing materials change as the video is played, and the adjustment process of the properties of the editing materials during the time period of the original video playback is recorded. In this way, in response to the video save operation, an edited video with the editing materials can be generated based on the adjustment process of the properties of the original video and the recorded editing materials, thereby realizing the addition of the editing materials to the video screen, that is, realizing the editing of the video.
[0248] In addition, the properties of the edited material can be continuously adjusted during the playback of the original video. In other words, during the playback of the original video, the properties of the generated edited material are not fixed, but can be flexibly changed at any time. At different video playback moments, the edited material can have different properties. In this way, after recording the adjustment process of the properties of the edited material during the time period of the original video playback, based on the original video and the adjustment process of the properties of the recorded edited material, an edited video with constantly changing properties of the edited material can be generated, and the changes of the edited material in the edited video are the same as the adjustment process, which can meet the diverse video editing needs of users and improve the flexibility of video editing.
[0249] The following describes the method of generating editing materials in different situations mentioned in step S201.
[0250] For the case where editing materials are generated based on the area to be edited:
[0251] From the above introduction, it can be known that the operation of adding editing materials can be an operation in which the user selects an area to be edited in the upper layer of the video playback screen. The following introduces the specific method of generating editing materials based on the above selection operation.
[0252] The first method is to determine the area to be edited in the video playback screen based on the area selected by the operation of adding editing materials, and adjust the pixel values of the pixels in the area to be edited according to the pixel values of the pixels in the area to be edited to obtain a picture with the same size as the selected area as the editing material, and display the editing material on the layer above the original video playback layer.
[0253] The user's operation process in this embodiment can refer to the above Figure 1c Description.
[0254] Among them, the area to be edited in the video playback screen is the area corresponding to the above-mentioned framed area.
[0255] Specifically, the pixel values of the pixels in the editing area may be adjusted to blur or degrade the pixels, and a picture of the same size as the selected area may be generated based on the adjusted pixels as the editing material; the pixel values of the pixels in the editing area may be shuffled, and a picture of the same size as the selected area may be generated based on the adjusted pixels as the editing material; the pixel values of the pixels in the editing area may also be adjusted in combination with the above-mentioned processing methods to obtain the editing material, and the embodiments of the present application are not limited to this.
[0256] In this case, to the human eye, the generated editing material is actually a blurred image. The generated editing material can be called a mosaic, or a mosaic image.
[0257] It can be seen that in this embodiment, by adjusting the pixel values of the pixels in the area to be edited, a picture with the same size as the selected area can be obtained as the editing material. The editing material generated at this time can be called a mosaic. When the layer above the area to be edited is played with the video, it can cover the area to be edited in the video playback screen, so that the human eye cannot see the picture content in the area to be edited, which can protect the picture content in the area to be edited and improve the security of the picture content in the video.
[0258] The second method is to generate a picture of the same size as the selected area based on the set picture as the editing material, and display the editing material on the layer above the original video playback layer.
[0259] The above-mentioned set image can be a pre-set picture or a picture selected by the user, which can be called a sticker.
[0260] It can be seen that in this embodiment, a picture with the same size as the selected area can be generated as the editing material. The editing material generated at this time can be called a map. When the layer above the area to be edited is played with the video, it can cover the area to be edited in the video playback screen, so that the human eye cannot see the picture content in the area to be edited, which can protect the picture content in the area to be edited and improve the security of the picture content in the video; and the above-mentioned picture can display personalized content, which not only protects the picture content in the area to be edited but also takes into account the personalized needs of users.
[0261] The third method is to generate a text box of the same size as the selected area, and display the text box on the layer above the original video playback layer, obtain the text entered by the user in the text box, and obtain a text box containing the obtained text as an editing material.
[0262] The user's operation process in this embodiment can refer to the above Figure 1d Description.
[0263] It can be seen that in this embodiment, a text box with the same size as the selected area can be generated as an editing material, and the text entered by the user can be displayed in the text box. When the layer above the area to be edited is played with the video, the human eye can see the text in the text box as the video is played, which is conducive to meeting the user's personalized needs and improving the flexibility of video editing.
[0264] For generating editing materials based on preset areas:
[0265] In this case, the specific implementation of generating the editing material can be obtained based on the aforementioned implementation of generating the editing material based on the area to be edited. The only difference is that the area considered when generating the editing material is different. The following is a brief description:
[0266] The first method is to adjust the pixel values of the pixels in the preset area according to the pixel values of the pixels in the preset area, and obtain a picture with the same size as the preset area as the editing material; the second method is to generate a picture with the same size as the preset area according to the set picture, and use it as the editing material; the third method is to generate a text box with the same size as the preset area, display the text box on the layer above the original video playback layer, obtain the text entered by the user in the text box, and obtain a text box containing the obtained text as the editing material.
[0267] The following describes the method of adjusting the property of the recording editing material mentioned in the aforementioned step S202 in different situations.
[0268] Regarding the case of manually adjusting and editing the material:
[0269] In response to manual adjustment operations of the editing material, the attribute information of the editing material at the current playback moment can be continuously recorded.
[0270] The current playback time is a dynamic concept. When adjusting the properties of the editing material, the original video is in the playback state, the playback screen is constantly changing, the playback time is constantly updated, and the current playback time is constantly changing.
[0271] Continuously recording the attribute information of the editing material at the current playback moment can be understood as recording the attribute information of the editing material at each playback moment.
[0272] The attributes of the editing material may include a variety of information. The following describes the methods of recording the attribute information when manually adjusting the various information included in the above attributes.
[0273] The first way is to respond to the operation of manually dragging the editing material and continuously record at least one of the following information of the editing material at the current playback moment: position information and moving path information.
[0274] The operation of dragging the editing material is also the operation of dragging the editing material to move, such as the operation of dragging the mosaic to move mentioned above. After the operation of dragging the editing material is performed, the position of the editing material will change.
[0275] The above-mentioned moving path information may be the coordinates of the path points of the editing material on the moving path, and the path point coordinates may be the coordinates of the touch points on the dragging path collected at each playback moment according to the dragging operation of the user.
[0276] For example, see Figure 4a , the user drags the mosaic from right to left, then the electronic device can collect the coordinates of each touch point on the user's dragging path at each playback moment as the above-mentioned path point coordinates.
[0277] The above-mentioned position information is various information reflecting the position of the editing material. The editing material can be detected from the video screen at each playback moment, and the position of the detected editing material can be located, thereby obtaining the position information at each playback moment.
[0278] The above-mentioned position information may also be obtained based on the above-mentioned path point coordinates. Specifically, according to different ways of representing the position of the editing material, the position information of the editing material at each playback moment may be determined in the following cases.
[0279] 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 based on the offset between the touch point coordinates and the corner point coordinates, thereby obtaining the position information of the editing material at each playback time.
[0280] For example, the attributes of the editing material are the coordinates of the upper left vertex and the coordinates of the lower right vertex. Taking the upper left vertex as an example, if the horizontal coordinate offset between the above touch point coordinates and the upper left vertex coordinates is t, and the vertical coordinate offset is d, then for the path point l1 (x1, y1), the difference between the horizontal coordinate x1 of l1 and the horizontal coordinate offset t, and the difference between the vertical coordinate y1 of l1 and the vertical coordinate offset d can be calculated to obtain the coordinates v1 (x1-t, y1-d) of the upper left vertex of the editing material corresponding to the path point l1. By analogy, the coordinates of the upper left vertex and the lower right vertex of the editing material corresponding to each path point can be obtained.
[0281] In another case, if the position of the editing material is represented by the center point coordinates of the editing material, the updated center point coordinates of the editing material corresponding to each path point can be calculated based on the offset between the touch point coordinates and the center point coordinates, thereby obtaining the position information of the editing material at each playback time.
[0282] In this case, the method of calculating the center point coordinates of the editing material corresponding to each path point is similar to the method of calculating the corner point coordinates of the editing material in the previous method. The only difference is that the corner point coordinates are replaced by the center point coordinates, which will not be repeated here.
[0283] The second method is to respond to the operation of manually scaling the edited material and continuously record at least one of the following information of the edited material at the current playback moment: scaling amount, scaling ratio, position information, and size.
[0284] The above-mentioned scaling amount may be determined based on the moving distance of the attribute adjustment operation in the scaling direction.
[0285] For example, see Figure 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 user's stretching operation in the length direction can be determined as the scaling amount.
[0286] For example, see Figure 4c It can be seen that the user stretches the lower right vertex of the editing material in the diagonal direction of the editing material, and the moving distance of the user's stretching operation in the diagonal direction can be determined as the scaling amount.
[0287] The above-mentioned zoom ratio can be determined based on the zoom amount and the size of the editing material.
[0288] Still Figure 4b For example, assuming that the length of the editing material is length 1 and the scaling amount is △length, the above scaling ratio can be length 1: (length 1+△length).
[0289] As for the position information and size, the editing material can be detected from the video screen at each playback moment, the position of the detected editing material can be located, and the size of the detected editing material can be measured to obtain the position information and size at each playback moment.
[0290] In one embodiment of the present application, the position information and size of the editing material can also be determined based on the zoom amount. According to different ways of representing the position and size of the editing material, the position information and size of the editing material at each playback moment can be determined in the following situations.
[0291] If the scaling direction is the length or width of the edited material:
[0292] In one case, if the position and size of the editing material are expressed by corner point coordinates, then for each playback moment, the sum of the horizontal or vertical coordinates in the corner point coordinates in the attributes of the editing material and the scaling amount corresponding to the playback moment can be calculated, and the updated corner point coordinates of the editing material can be obtained based on the calculation results, thereby obtaining the position information and size of the editing material at each playback moment.
[0293] For example, if the attributes of the editing material include the coordinates of the lower right vertex v2 (x2, y2), the scaling direction is stretching to the right along the length direction of the editing material, and the scaling amount is δ, then the sum of the horizontal coordinate x2 in the coordinates of the lower right vertex in the attributes of the editing material and the above-mentioned scaling amount can be calculated as the updated horizontal coordinate, and the updated coordinates of the lower right vertex are finally obtained as v2' (x2+δ, y2).
[0294] In another case, if the position and size of the edited material are represented by the center point coordinates and the side length, then for each playback moment, the sum of the horizontal coordinate or vertical coordinate in the center point coordinates in the properties of the edited material and the above-mentioned scaling amount corresponding to the playback moment can be calculated first, and the updated center point coordinates of the edited material can be obtained based on the calculation result. This method can be obtained based on the method of calculating the updated corner point coordinates, which will not be described in detail here; then the length or width of the edited material is calculated and the sum of the above-mentioned scaling amount, and the updated length or width of the edited material can be obtained based on the calculation result. In this way, the center point coordinates and side lengths in the properties of the edited material at each playback moment are obtained, and the position and size information of the edited material at each playback moment is also obtained.
[0295] If the scaling direction is the diagonal direction of the editing material:
[0296] In this case, the first component and the second component of the scaling amount in the length and width directions may be determined based on the length-to-width ratio of the editing material.
[0297] For example, if the aspect ratio of the editing material is 4:3 and the scaling amount is δ, it can be determined that the first component of the scaling amount in the length direction is 4 / 5×δ and the second component in the width direction is 3 / 5×δ.
[0298] Then, calculate the position information and size of the editing material in the following cases.
[0299] In one case, if the position information and size of the editing material are expressed by corner point coordinates, then for each playback moment, the sum of the horizontal and vertical coordinates of the above corner point coordinates and the first component and the second component corresponding to the playback moment can be calculated respectively, and the updated corner point coordinates of the editing material can be obtained according to the calculation results, and then the position information and size of the editing material at each playback moment can be obtained.
[0300] For example, if the attributes of the editing material include the coordinates of the lower right vertex v3 (x3, y3), the scaling direction is stretching to the right along the diagonal direction, and the scaling amount is δ, then it can be determined that the component of the above scaling amount in the length direction is 4 / 5×δ, and the component in the width direction is 3 / 5×δ. Then, the sum of the horizontal coordinate x3 and the above first component in the coordinates of the lower right vertex in the attributes of the editing material can be calculated as the updated horizontal coordinate, and the sum of the vertical coordinate y3 and the above second component in the coordinates of the lower right vertex in the attributes of the editing material can be calculated as the updated vertical coordinate. Finally, the updated coordinates of the lower right vertex are obtained as v3' (x3+4 / 5×δ, y3+3 / 5×δ).
[0301] In another case, if the location information and size of the edited material adopt the center point coordinates and side length, then for each playback moment, the horizontal and vertical coordinates of the center point coordinates and the sum of the first component and the second component corresponding to the playback moment can be calculated respectively, and the updated center point coordinates of the edited material are obtained according to the calculation results. This method can be obtained on the basis of the method of calculating the updated corner point coordinates, which will not be described in detail here; then the length and width of the edited material and the sum of the first scaling amount and the second scaling amount are calculated respectively, and the updated length and width of the edited material are obtained according to the calculation results. In this way, the center point coordinates and side lengths in the attributes of the edited material at each playback moment are obtained, and the location and size information of the edited material at each playback moment is also obtained.
[0302] A third method is to continuously record at least one of the following information of the edited material at the current playback moment in response to an operation of manually rotating the edited material: rotation angle, position information.
[0303] As for the rotation angle and position information, the editing material can be detected from the video screen at each playback moment, and the position of the detected editing material can be located, and the rotation angle of the detected editing material can be measured to obtain the rotation angle and position information at each playback moment.
[0304] The fourth method is to respond to the manual editing of the editing material setting items and continuously record at least one of the following setting items of the editing material at the current playback moment: transparency, color, line width, line type, appearance mode, and disappearance mode.
[0305] In some cases, the user can set various properties of the material by editing the material setting items. The electronic device can detect the setting items of the generated edited material at each playback moment and record the properties corresponding to each playback moment according to the detection results.
[0306] It can be seen that during the video playback process, based on the various human operations on the editing materials, the various attribute information of the editing materials at each playback moment can be continuously recorded. When the edited video is subsequently generated based on the recorded information, the various attribute information of the editing materials on the playback screen of the edited materials can be continuously changed, thereby improving the flexibility of video editing.
[0307] In this embodiment, when the editing material is manually adjusted during video playback, the attribute information of the editing material at each playback moment can be continuously recorded based on the manual adjustment operation. When the edited video is subsequently generated based on the recorded information, the changes in the editing material during the playback of the edited video can be made the same as the manual adjustment operation process, so as to meet the user's personalized needs.
[0308] For automatic adjustment of editing materials:
[0309] In response to automatically identifying preset content in the original video, editing materials corresponding to the position and size of the preset content can be generated, the editing materials move with the preset content, and the attribute information of the editing materials at the current playback moment is continuously recorded.
[0310] The above-mentioned preset content may be a preset object, corresponding to the aforementioned object to be edited, such as a person, an animal, a license plate, etc.
[0311] Specifically, object tracking recognition can be performed on the video screen of the original video frame by frame, that is, the same object in each frame of the video screen can be recognized. In this way, in the process of object tracking recognition, the change of the position and size of the object can be determined according to the difference of the same object in each frame of the video screen, so that the properties of the editing 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 and other properties of the editing material can be changed according to the change of the position and size of the object, and the property information of the editing material at each playback time is continuously recorded.
[0312] In this embodiment, when the editing material is automatically adjusted during video playback, the editing material can be generated based on the automatically identified size and position of the preset content in the original video, and the editing material can be moved along with the preset content, and the attribute information of the editing material at each playback moment can be continuously recorded. In this way, when the edited video is subsequently generated based on the recorded information, the changes in the editing material during the playback of the edited video can be consistent with the changes in the preset content. The entire video editing process does not require the user to manually adjust the editing material, thereby improving the convenience of video editing.
[0313] In one embodiment of the present application, when the editing material is automatically adjusted during video playback, before executing the above step S204, the following step A may also be executed:
[0314] Step A: In response to the video replay operation, during the replay of the original video, based on the adjustment process of the attributes of the recorded editing material, the editing material is played on the upper layer, and in response to the manual adjustment operation of the editing material, the attribute information of the recorded editing material at the current playback moment is continuously updated.
[0315] After the video replay operation is triggered, the original video can be replayed, that is, the original video can be played again. During the last playback of the original video, the edited material has been automatically adjusted, and the property adjustment process of the edited material has been recorded. Therefore, during the replay of the original video, the edited material can be played on the upper layer according to the recorded adjustment process.
[0316] It can be seen that during the replay of the original video, the edited material will also change with the automatic adjustment of the edited material during the last playback of the original video.
[0317] On this basis, while watching the changes of the edited material in the video screen, the user can also manually adjust the edited material being played according to his or her actual needs, which can also be called "secondary adjustment". Thus, the electronic device can respond to the manual adjustment operation of the edited material and continuously update the attribute information of the recorded edited material at the current playback time.
[0318] The method of continuously updating the attribute information of the editing material can be obtained based on the method of continuously recording the attribute information of the editing material introduced above, which will not be described in detail here.
[0319] In this embodiment, during the video playback process, the edited material can first be automatically adjusted, and the attribute information of the edited material at each playback time can be continuously recorded; then, the video can also be replayed, and during the replay process, in response to the manual adjustment operation of the edited material, the attribute information of the recorded edited material at each playback time can be continuously updated, so that the edited video finally generated according to the recorded attribute information can reflect both the above-mentioned automatic adjustment operation and the user's manual adjustment operation. In addition, the user does not need to manually adjust the edited material throughout the video playback process, but can make secondary adjustments based on the automatic adjustment of the edited material according to his own needs, which not only ensures the convenience of video editing operations, but also meets the personalized needs of users.
[0320] The following is an intuitive introduction to the overall process of the video editing solution provided in the embodiment of the present application with reference to specific examples and drawings.
[0321] See also Figure 5 Taking adding mosaics to a video screen as an example, the video editing solution provided by the embodiment of the present application is introduced through the following steps P1 to P5. Figure 5 A time axis is shown, and the numbers above the time axis represent each moment in seconds.
[0322] Step P1: At time t1, the user starts to manually add mosaic 1 to the video screen and adjusts the shape of mosaic 1 to S1. In addition, within time interval A, the user moves the position of mosaic 1 along with the playback screen. Figure 5 The middle curve L1 reflects the position change of mosaic 1 in time interval A;
[0323] Step P2: At the start of time interval B, the user adjusts the shape of mosaic 1, and the adjusted shape is S2. In addition, within time interval B, the user moves the position of mosaic 1 along with the playback screen. Figure 5 The middle curve L2 reflects the position change of mosaic 1 in time interval B;
[0324] Step P3: At the start of time interval C, the user adjusts the shape of mosaic 1, and the adjusted shape is S3. In addition, within time interval C, the user moves the position of mosaic 1 along with the playback picture. Figure 5 The middle curve L3 reflects the position change of mosaic 1 in time interval C;
[0325] Step P4: At the start of time interval D, the user adjusts the shape of mosaic 1, and the adjusted shape is S4. In addition, within time interval D, the user moves the position of mosaic 1 along with the playback image, and ends the adjustment of mosaic at time t2. Figure 5 The middle curve L4 reflects the position change of mosaic 1 in the time interval D.
[0326] Step P5: The user triggers a video saving operation, and the electronic device synthesizes the mosaic into the video screen to obtain an edited video.
[0327] When the user adjusts the mosaic 1, the electronic device will record the shape S and position coordinates L of the mosaic 1 in real time, and record the frame number of the video frame corresponding to the above shape and position, forming a one-to-one correspondence, and each frame number corresponds to a shape and a position.
[0328] After the user triggers saving the video, the electronic device will obtain the mosaic position and shape corresponding to each frame saved in the memory, and then decode the video stream data to obtain a code stream including each video frame, and match the frame number of the video frame included in the code stream with the frame number recorded in the memory. If there is a matching frame number, the mosaic area in the decoded image of the video frame corresponding to the matching video frame number is determined based on the mosaic position and shape in the memory, and the pixel values of the pixels in the mosaic area are adjusted based on the pixel values of the pixels in the mosaic area, and the decoded image with adjusted pixel values is encoded to obtain an updated video frame, thereby obtaining a code stream including the updated video frame, and the code stream data is written to the disk for storage, thereby completing the video saving.
[0329] Next, combine Figure 6 , the overall process of the video editing solution provided in the embodiment of the present application is introduced in the form of a signaling diagram.
[0330] See also Figure 6 , which is a signaling interaction diagram of a video editing process provided in an embodiment of the present application.
[0331] It can be seen that the user can trigger the operation of adding editing materials on the operation interface, and the operation interface sends the editing material information to the data recording module, that is, synchronizes the relevant information of the editing material to the data recording module; the data recording module can record the playback time and editing material information; at the same time, the operation interface can also update the editing material information as the video is played, 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 a message prompting that the information has been successfully saved; after the user triggers the save operation, the operation interface can trigger video synthesis, that is, send 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 the algorithm to instruct 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 return the synthesis result 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 a message prompting that the video synthesis is successful.
[0332] In the technical solution of this application, the operations involved in obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.
[0333] It should be noted that the two-dimensional face images in this embodiment come from a public data set.
[0334] Corresponding to the above-mentioned video editing method, an embodiment of the present application provides a video editing device.
[0335] See also Figure 7 , is a schematic diagram of the structure of a video editing device provided in an embodiment of the present application, the device includes the following modules:
[0336] The editing material generating module 701 is used to generate the editing material in the upper layer of the original video playing layer in response to the adding editing material operation;
[0337] The editing material adjustment module 702 is used to adjust the properties of the editing material during the original video playback so that the editing material changes with the video playback, wherein the editing material is adjusted manually and / or automatically;
[0338] An adjustment process recording module 703, used to record the adjustment process of the attribute of the editing material during the time period of the original video playback;
[0339] The video generation module 704 is used to generate an edited video with the editing material in response to the video saving operation, based on the original video and the recorded adjustment process of the attributes of the editing material, wherein during the playback of the edited video, the changes of the editing material are the same as the adjustment process.
[0340] As can be seen from the above, when the solution provided in the embodiment of the present application is used for video editing, editing materials can be generated in the layer above the original video playback layer. Then, while the original video is being played, the properties of the editing materials can be adjusted so that the editing materials change as the video is played, and the adjustment process of the properties of the editing materials during the time period of the original video playback is recorded. In this way, in response to the video save operation, an edited video with the editing materials can be generated based on the adjustment process of the properties of the original video and the recorded editing materials, thereby realizing the addition of the editing materials to the video screen, that is, realizing the editing of the video.
[0341] In addition, the properties of the edited material can be continuously adjusted during the playback of the original video. In other words, during the playback of the original video, the properties of the generated edited material are not fixed, but can be flexibly changed at any time. At different video playback moments, the edited material can have different properties. In this way, after recording the adjustment process of the properties of the edited material during the time period of the original video playback, based on the original video and the adjustment process of the properties of the recorded edited material, an edited video with constantly changing properties of the edited material can be generated, and the changes of the edited material in the edited video are the same as the adjustment process, which can meet the diverse video editing needs of users and improve the flexibility of video editing.
[0342] In one embodiment of the present application, the adjustment of the editing material includes manual adjustment;
[0343] The adjustment process recording module 703 includes:
[0344] The adjustment operation response submodule is used to respond to the manual adjustment operation of the editing material and continuously record the attribute information of the editing material at the current playback moment.
[0345] In this embodiment, when the editing material is manually adjusted during video playback, the attribute information of the editing material at each playback moment can be continuously recorded based on the manual adjustment operation. When the edited video is subsequently generated based on the recorded information, the changes in the editing material during the playback of the edited video can be made the same as the manual adjustment operation process, so as to meet the user's personalized needs.
[0346] In one embodiment of the present application,
[0347] The adjustment operation response submodule is specifically used to respond to the operation of manually dragging the editing material, continuously record the position information and / or movement path information of the editing material at the current playback moment; and / or, in response to the operation of manually scaling the editing material, continuously record at least one of the following information of the editing material at the current playback moment: scaling amount, scaling ratio, position information, size; and / or, in response to the operation of manually rotating the editing material, continuously record the rotation angle and / or position information of the editing material at the current playback moment; and / or, in response to the operation of manually editing the editing material setting items, continuously record at least one of the following setting items of the editing material at the current playback moment: transparency, color, line width, line type, appearance mode, disappearance mode.
[0348] It can be seen that during the video playback process, based on the various human operations on the editing materials, the various attribute information of the editing materials at each playback moment can be continuously recorded. When the edited video is subsequently generated based on the recorded information, the various attribute information of the editing materials on the playback screen of the edited materials can be continuously changed, thereby improving the flexibility of video editing.
[0349] In one embodiment of the present application, the adjustment of the editing material includes automatic adjustment;
[0350] The adjustment process recording module 703 is specifically used to generate the editing material corresponding to the position and size of the preset content in response to automatically identifying the preset content in the original video. The editing material moves with the preset content and continuously records the attribute information of the editing material at the current playback moment.
[0351] In this embodiment, when the editing material is automatically adjusted during video playback, the editing material can be generated based on the automatically identified size and position of the preset content in the original video, and the editing material can be moved along with the preset content, and the attribute information of the editing material at each playback moment can be continuously recorded. In this way, when the edited video is subsequently generated based on the recorded information, the changes in the editing material during the playback of the edited video can be consistent with the changes in the preset content. The entire video editing process does not require the user to manually adjust the editing material, thereby improving the convenience of video editing.
[0352] In one embodiment of the present application, the adjustment of the editing material further includes manual adjustment;
[0353] The device also includes an attribute update module, which is used to respond to the video replay operation before the video generation module responds to the video saving operation. During the replay of the original video, based on the recorded adjustment process of the attributes of the edited material, the edited material is played on the upper layer, and in response to the manual adjustment operation of the edited material, the attribute information of the edited material at the current playback moment that has been recorded is continuously updated.
[0354] In this embodiment, during the video playback process, the edited material can first be automatically adjusted, and the attribute information of the edited material at each playback time can be continuously recorded; then, the video can also be replayed, and during the replay process, in response to the manual adjustment operation of the edited material, the attribute information of the recorded edited material at each playback time can be continuously updated, so that the edited video finally generated according to the recorded attribute information can reflect both the above-mentioned automatic adjustment operation and the user's manual adjustment operation. In addition, the user does not need to manually adjust the edited material throughout the video playback process, but can make secondary adjustments based on the automatic adjustment of the edited material according to his own needs, which not only ensures the convenience of video editing operations, but also meets the personalized needs of users.
[0355] In one embodiment of the present application, the editing material is at least one of text, letters, pictures, mosaics, and special effects.
[0356] In this way, a rich variety of editing materials can be added to the video, which is conducive to meeting the personalized needs of users and improving the flexibility of video editing.
[0357] In one embodiment of the present application, the attribute represents at least one of position, size, rotation angle, transparency, scaling, color, line width, line type, appearance mode, and disappearance mode.
[0358] In this way, when generating editing materials, various attributes of the editing materials can be considered, and the adjustment process of the various attributes of the editing materials can be recorded later, so that the edited video can be generated according to the recorded adjustment process, which improves the flexibility of video editing.
[0359] In one embodiment of the present application, the operation of adding editing materials is: an editing operation on the played video when the video is played at a preset speed, wherein the preset speed is less than or greater than 1 speed.
[0360] When the video is in slow playback, the position and size of the object to be edited in the video screen also change slowly. Since the position and size of the area to be edited can be determined based on the position and size of the object to be edited in the video screen, this is conducive to improving the accuracy of subsequent determination of the position and size of the area to be edited, and thus can improve the accuracy of adjusting the position and size of the generated editing material according to the position and size changes of the area to be edited; when the video is in fast playback, each frame of the video screen switches quickly, and the time required to play the entire video is short. In this case, editing materials can be quickly added to the video screen, thereby improving video editing efficiency.
[0361] And / or, there are multiple editing materials, and the multiple editing materials are distributed in at least two layers above the original video playback layer.
[0362] In this way, multiple editing materials can be distributed on different layers above the original video playback layer, so that by setting the layer where the editing materials are located, the display relationship of multiple editing materials when they are superimposed can be changed, thereby improving the flexibility of video editing.
[0363] In one embodiment of the present application, the editing material changes synchronously with the area to be edited in the video playback screen of the original video.
[0364] It can be seen that in the above embodiment, the editing material can change synchronously with the to-be-edited area in the video playback screen of the original video, thereby improving the flexibility of video editing.
[0365] In one embodiment of the present application, the operation of adding editing materials is: performing an operation of selecting an area to be edited in the upper layer of the video playback screen of the original video;
[0366] The editing material generation module is specifically used to respond to an operation of adding editing materials, determine the area to be edited in the video playback screen of the original video according to the area selected by the operation of adding editing materials, adjust the pixel values of the pixels in the area to be edited according to the pixel values of the pixels in the area to be edited, and obtain a picture with the same size as the selected area as the editing material, and display the editing material on the upper layer of the original video playback layer; and / or, based on a set picture, generate a picture with the same size as the selected area as the editing material, and display the editing material on the upper layer of the original video playback layer; and / or, generate a text box with the same size as the selected area, display the text box on the upper layer of the original video playback layer, obtain the text entered by the user in the text box, and obtain a text box containing the obtained text as the editing material.
[0367] It can be seen that in this embodiment, by adjusting the pixel values of the pixels in the to-be-edited area, a picture of the same size as the framed area can be obtained as the editing material. The editing material generated at this time can be called a mosaic. When the layer above the to-be-edited area is played with the video, it can cover the to-be-edited area in the video playback screen, so that the human eye cannot see the screen content in the to-be-edited area, which can protect the screen content in the to-be-edited area and improve the security of the screen content in the video; and, a picture of the same size as the framed area can be generated as the editing material. The editing material generated at this time can be called a texture. When the layer above the to-be-edited area is played with the video, it can cover the video playback screen. The area to be edited in the picture makes it impossible for the human eye to see the picture content in the area to be edited, which can protect the picture content in the area to be edited and improve the safety of the picture content in the video; and the above-mentioned picture can display personalized content, which not only protects the picture content in the area to be edited but also takes into account the personalized needs of users; and a text box with the same size as the selected area can be generated as the editing material, and the text entered by the user can be displayed in the text box. When the layer above the area to be edited is played with the video, 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 users and improves the flexibility of video editing.
[0368] In one embodiment of the present application, the video generation module is specifically used to respond to the video saving operation, determine the area to be edited in the decoded image of the video frame in the original video according to the recorded adjustment process of the attributes of the editing material; adjust the pixel values of the pixels in the area to be edited according to the pixel values of the pixels in the area to be edited in each decoded image; perform video encoding based on the decoded image after the pixel values are adjusted to obtain the edited video; and / or, for each video frame in the original video corresponding to the adjustment process, synthesize the picture to be synthesized into the video frame according to the position represented by the target attribute, to obtain the edited video including the synthesized video frame, wherein the target attribute is: the recorded attribute corresponding to the video frame, and the picture to be synthesized is: the picture after the set picture is adjusted to the size represented by the target attribute; and / or, for each video frame in the original video corresponding to the adjustment process, synthesize the text box to be synthesized into the video frame according to the position represented by the target attribute, to obtain the edited video including the synthesized video frame, wherein the text box to be synthesized is: a text box containing the recorded text of the editing material, and the size of the text box to be synthesized is the same as the size represented by the target attribute.
[0369] It can be seen that by adjusting the pixel values of the pixels in the to-be-edited area in each decoded image, the mosaic can be synthesized into the decoded image of the video frame. In this way, when the edited video is finally played, the mosaic can cover the to-be-edited area in the video playback screen, so that the human eye cannot see the picture content in the to-be-edited area, which can protect the picture content in the to-be-edited area and improve the security of the picture content in the video; and the sticker can be synthesized into the to-be-edited area of the video frame. When the edited video is finally played, the sticker can cover the to-be-edited area in the video playback screen, so that the human eye cannot see the picture content in the to-be-edited area, which can protect the picture content in the to-be-edited area and improve the security of the picture content in the video; and the sticker can display personalized content, which protects the picture content in the to-be-edited area while taking into account the personalized needs of the user; and the text box can also be synthesized into the to-be-edited area of the video frame. When the edited video is finally played, 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.
[0370] In one embodiment of the present application, the device further includes:
[0371] A playback time period determination module, used to determine the playback time period of the edited material;
[0372] The editing material adjustment module is specifically used to adjust the properties of the editing material during the process of playing the video images within the playing time period of the original video, so that the editing material changes with the playing of the video images within the playing time period.
[0373] It can be seen that in this embodiment, the playback time period can be determined for the editing material. In this way, only when the video screen within the above playback time period is played, the editing material will be played along with the video in the layer above the video playback screen. That is, the playback time period of the editing material can be adjusted purposefully, further improving the flexibility of video editing.
[0374] In one embodiment of the present application, the playback time period determination module is specifically used to display a playback progress bar for the editing material in a set area of the video playback interface in response to an operation of adding editing materials; in response to an adjustment operation of the playback progress bar, determine the playback time period of the editing material according to the start and end times corresponding to the adjusted playback progress bar.
[0375] In this way, by adjusting the playback progress bar of the edited material, the playback time period of the edited material can be determined intuitively and quickly.
[0376] Corresponding to the above-mentioned video editing method, an embodiment of the present application also provides an electronic device, a computer-readable storage medium and a computer program.
[0377] The present application embodiment provides an electronic device, such as Figure 8 As shown, including:
[0378] Memory 801, used for storing computer programs;
[0379] The processor 802 is used to implement the aforementioned video editing method when executing the program stored in the memory 801.
[0380] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 802, the communication interface, and the memory 801 communicate with each other via the communication bus.
[0381] The communication bus mentioned in the above 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 ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0382] The communication interface is used for communication between the above electronic device and other devices.
[0383] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0384] The above-mentioned 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 devices, discrete gate or transistor logic devices, discrete hardware components.
[0385] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned video editing methods are implemented.
[0386] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the video editing methods in the above embodiments.
[0387] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0388] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0389] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences 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 partial description of the method embodiments.
[0390] The above description is only a preferred embodiment of the present application and is 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 are included in the protection scope of the present application.
Claims
1. A video editing method, characterized in that: The method comprises: In response to the operation of adding editing material, generating editing material in a layer above the original video playback layer; During the playback of the original video, adjusting the properties of the editing material so that the editing material changes as the video is played, wherein the editing material is adjusted manually and / or automatically; Recording the adjustment process of the attributes of the editing material during the time period of the original video playback; 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 attributes of the editing material, wherein during the playback of the edited video, the change of the editing material is the same as the adjustment process; The adjustment of the editing material includes automatic adjustment; The process of recording the adjustment of the attribute of the editing material during the time period of the original video playback includes: In response to automatically identifying preset content in the original video, the editing material corresponding to the position and size of the preset content is generated, the editing material moves with the preset content, and continuously records the attribute information of the editing material at the current playback moment.
2. The method according to claim 1, characterized in that The adjustment of the editing material includes manual adjustment; The process of recording the adjustment of the attribute of the editing material during the time period of the original video playback includes: In response to the manual adjustment operation of the editing material, the attribute information of the editing material at the current playing moment is continuously recorded.
3. The method according to claim 2, characterized in that The step of continuously recording the attribute information of the editing material at the current playback moment in response to the manual adjustment operation of the editing material includes: In response to an operation of manually dragging the editing material, continuously recording the position information and / or moving path information of the editing material at the current playing moment; and / or, In response to an operation of manually scaling the edited material, continuously recording at least one of the following information of the edited material at the current playback time: scaling amount, scaling ratio, position information, size; and / or, In response to an operation of manually rotating the editing material, continuously recording the rotation angle and / or position information of the editing material at the current playback moment; and / or, In response to the manual editing of the editing material setting items, at least one of the following setting items of the editing material at the current playback moment is continuously recorded: transparency, color, line width, line type, appearance mode, and disappearance mode.
4. The method according to claim 1, characterized in that: The adjustment of the editing material also includes manual adjustment; Before responding to the video saving operation, the method further includes: In response to a video replay operation, during the replay of the original video, based on the recorded adjustment process of the attributes of the edited material, the edited material is played on the upper layer, and in response to the manual adjustment operation of the edited material, the recorded attribute information of the edited material at the current playback moment is continuously updated.
5. The method according to claim 1, characterized in that 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, color, line width, line type, appearance mode, and disappearance mode; and / or, The operation of adding editing materials is: an editing operation on the played video when the video is played at a preset speed, wherein the preset speed is less than or greater than 1 speed; and / or, There are multiple editing materials, and the multiple editing materials are distributed in at least two layers above the original video playback layer.
6. The method according to any one of claims 1 to 5, characterized in that The editing material changes synchronously with the area to be edited in the video playback screen of the original video.
7. The method according to claim 6, characterized in that The operation of adding editing materials is: performing an operation of selecting an area to be edited in the upper layer of the video playback screen of the original video; The step of generating editing materials on the layer above the original video playback layer includes: According to the area selected by the operation of adding editing materials, determine the area to be edited in the video playback screen of the original video, and adjust the pixel values of the pixels in the area to be edited according to the pixel values of the pixels in the area to be edited to obtain a picture with the same size as the selected area as the editing material, and display the editing material in the layer above the original video playback layer; and / or, According to the set picture, a picture with the same size as the framed area is generated as an editing material, and the editing material is displayed on the layer above the original video playback layer; and / or, Generate a text box of the same size as the selected area, display the text box on the layer above the original video playback layer, obtain the text entered by the user in the text box, and obtain a text box containing the obtained text as the editing material.
8. The method according to any one of claims 1 to 5, characterized in that The process of adjusting the properties of the original video and the recorded editing material to generate an edited video with the editing material comprises: According to the recorded adjustment process of the attributes of the editing material, determine the area to be edited in the decoded image of the video frame in the original video; adjust the pixel values of the pixels in the area to be edited according to the pixel values of the pixels in the area to be edited in each decoded image; and perform video encoding based on the decoded image after the pixel values are adjusted to obtain the edited video; and / or, For each video frame in the original video corresponding to the adjustment process, the picture to be synthesized is synthesized into the video frame according to the position represented by the target attribute, so as to obtain an edited video including the synthesized video frame, wherein the target attribute is: the recorded attribute corresponding to the video frame, and the picture to be synthesized is: the picture after the set picture is adjusted to the size represented by the target attribute; and / or, For each video frame in the original video corresponding to the adjustment process, the text box to be synthesized is synthesized into the video frame according to the position of the target attribute representation, so as to obtain an edited video including the synthesized video frame, wherein the text box to be synthesized is: a text box including the text of the recorded editing material, and the size of the text box to be synthesized is the same as the size of the target attribute representation.
9. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Determining a play time period of the edited material; The step of adjusting the properties of the editing material during the original video playback so that the editing material changes as the video is played includes: During the process of playing the video images in the playing time period of the original video, the attributes of the editing material are adjusted so that the editing material changes as the video images in the playing time period are played.
10. The method according to claim 9, characterized in that The determining the playing time period of the edited material includes: In response to the operation of adding editing materials, a playback progress bar for the editing materials is displayed in a setting area of the video playback interface; In response to the adjustment operation on the play progress bar, the play time period of the edited material is determined according to the start and end times corresponding to the adjusted play progress bar.
11. A video editing device, characterized in that: The device comprises: An editing material generating module, used for generating editing materials on a layer above the original video playing layer in response to an operation of adding editing materials; An editing material adjustment module, used for adjusting the properties of the editing material during the playback of the original video, so that the editing material changes with the video playback, wherein the adjustment of the editing material is manual adjustment and / or automatic adjustment; An adjustment process recording module, used to record the adjustment process of the attributes of the editing material during the time period of the original video playback; A video generation 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 attributes of the editing material, wherein during the playback of the edited video, the change of the editing material is the same as the adjustment process; The adjustment of the editing material includes automatic adjustment; the adjustment process recording module is specifically used to generate the editing material corresponding to the position and size of the preset content in response to automatically identifying the preset content in the original video, and the editing material moves with the preset content, and continuously records the attribute information of the editing material at the current playback moment.
12. The device according to claim 11, characterized in that The adjustment of the editing material includes manual adjustment; The adjustment process recording module includes: an adjustment operation response submodule, which is used to respond to the manual adjustment operation of the editing material and continuously record the attribute information of the editing material at the current playback moment; or The adjustment operation response submodule is specifically used for: in response to the operation of manually dragging the editing material, continuously recording the position information and / or movement path information of the editing material at the current playback moment; and / or, in response to the operation of manually scaling the editing material, continuously recording at least one of the following information of the editing material at the current playback moment: scaling amount, scaling ratio, position information, size; and / or, in response to the operation of manually rotating the editing material, continuously recording the rotation angle and / or position information of the editing material at the current playback moment; and / or, in response to the operation of manually editing the editing material setting items, continuously recording at least one of the following setting items of the editing material at the current playback moment: transparency, color, line width, line type, appearance mode, disappearance mode; or The adjustment of the editing material also includes manual adjustment; the device also includes an attribute updating module, which is used to respond to the video replay operation before the video generation module responds to the video saving operation, in the process of replaying the original video, based on the recorded adjustment process of the attributes of the editing material, play the editing material on the upper layer, and respond to the manual adjustment operation of the editing material, continuously update the recorded attribute information of the editing material at the current playback time; 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, color, line width, line type, appearance mode, and disappearance mode; and / or, the operation of adding editing materials is: an editing operation on the played video when the video is played at a preset speed, wherein the preset speed is less than or greater than 1 speed; and / or, there are multiple editing materials, and the multiple editing materials are distributed in at least two layers above the original video playback layer; or The editing material changes synchronously with the area to be edited in the video playback screen of the original video; or The operation of adding editing materials is: performing an operation of selecting an area in a layer above the video playback screen of the original video for the area to be edited; the editing material generation module is specifically used to respond to the operation of adding editing materials, determine the area to be edited in the video playback screen of the original video according to the area selected by the operation of adding editing materials, adjust the pixel values of the pixels in the area to be edited according to the pixel values of the pixels in the area to be edited, obtain a picture with the same size as the selected area as the editing material, and display the editing material in the layer above the original video playback layer; and / or, generate a picture with the same size as the selected area as the editing material according to a set picture, and display the editing material in the layer above the original video playback layer; and / or generate a text box with the same size as the selected area, display the text box in the layer above the original video playback layer, obtain the text entered by the user in the text box, and obtain the text box containing the obtained text as the editing material; or The video generation module is specifically used to respond to the video saving operation, determine the area to be edited in the decoded image of the video frame in the original video according to the recorded adjustment process of the attribute of the editing material; adjust the pixel values of the pixels in the area to be edited according to the pixel values of the pixels in the area to be edited in each decoded image; perform video encoding based on the decoded image after the pixel values are adjusted to obtain the edited video; and / or, for each video frame in the original video corresponding to the adjustment process, synthesize the picture to be synthesized into the video frame according to the position represented by the target attribute, to obtain the edited video including the synthesized video frame, wherein the target attribute is: the recorded attribute corresponding to the video frame, and the picture to be synthesized is: the picture after the set picture is adjusted to the size represented by the target attribute; and / or, for each video frame in the original video corresponding to the adjustment process, synthesize the text box to be synthesized into the video frame according to the position represented by the target attribute, to obtain the edited video including the synthesized video frame, wherein the text box to be synthesized is: a text box including the recorded text of the editing material, and the size of the text box to be synthesized is the same as the size represented by the target attribute; or The device further comprises: a playback time period determination module, configured to determine the playback time period of the edited material; the edited material adjustment module, configured to adjust the properties of the edited material during the process of playing the video images within the playback time period in the original video, so that the edited material changes as the video images within the playback time period are played; or The playback time period determination module is specifically used to respond to the operation of adding editing materials, and to display a playback progress bar for the editing materials in a set area of the video playback interface; in response to the adjustment operation of the playback progress bar, the playback time period of the editing materials is determined according to the start and end times corresponding to the adjusted playback progress bar.
13. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-10 when executing a program stored in a memory.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Nonlinear editing software dispatching method and device
CN104954850A
Video editing method and system
CN105812943A
