Video clip method, apparatus, electronic device, and storage medium
By selecting a tutorial video to obtain editing operation information, the fused video can be automatically edited, solving the tedious problem of manual editing in the existing technology and realizing the automation and efficiency improvement of video editing.
Patent Information
- Application Number
- CN202310114420.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-01-29
AI Technical Summary
Existing video editing technologies require cumbersome manual operations by users, resulting in low editing efficiency and difficulty in automation.
By selecting a tutorial video, you can obtain the editing operation information associated with it, automatically edit the fusion video, and automatically add video special effects.
Video effects similar to tutorial videos can be generated without multiple manual operations, which improves the efficiency and automation of video editing.
Smart Images

Figure CN116016817B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of multimedia technology, and in particular to a video editing method, device, electronic device, and storage medium. Background Art
[0002] With the development of multimedia technology, video editing functions are becoming more and more diverse, and users can edit videos according to certain special effects to obtain videos with the special effects. However, currently, users need to manually edit videos to obtain videos with certain special effects, which is cumbersome and inefficient. Summary of the Invention
[0003] The present disclosure provides a video editing method, device, electronic device, and storage medium that can improve video editing efficiency. The technical solutions of the present disclosure are as follows:
[0004] According to one aspect of an embodiment of the present disclosure, a video editing method is provided, including:
[0005] Displaying a first video to be edited in an editing interface, where the first video is obtained by fusing at least two sub-videos, and a same frame in the first video includes frames of the at least two sub-videos;
[0006] In response to an application instruction for a target tutorial video in the editing interface, obtaining editing operation information associated with the target tutorial video, wherein the target tutorial video is used to guide an editing process for adding video special effects to at least one sample sub-video in a sample video, the editing operation information including an editing operation performed during the editing process for adding video special effects to the at least one sample sub-video and an operation parameter corresponding to the editing operation;
[0007] A target sub-video in the first video is edited based on the editing operation information to obtain a second video, where the target sub-video corresponds to the sample sub-video.
[0008] According to another aspect of an embodiment of the present disclosure, there is provided a video editing device, comprising:
[0009] A display unit is configured to display a first video to be edited in an editing interface, where the first video is obtained by fusing at least two sub-videos, and a same frame in the first video includes frames of the at least two sub-videos;
[0010] an acquisition unit configured to, in response to an application instruction to a target tutorial video in the editing interface, acquire editing operation information associated with the target tutorial video, wherein the target tutorial video is used to guide an editing process for adding video special effects to at least one sample sub-video in a sample video, the editing operation information including an editing operation performed during the editing process for adding video special effects to the at least one sample sub-video and an operation parameter corresponding to the editing operation;
[0011] The editing unit is configured to perform editing on a target sub-video in the first video based on the editing operation information to obtain a second video, where the target sub-video corresponds to the sample sub-video.
[0012] In some embodiments, the editing operation information includes multiple editing operations and operation parameters corresponding to each editing operation; the editing unit is configured to execute the target sub-video in accordance with the timing of the multiple editing operations in the editing operation information, apply each editing operation and the corresponding operation parameters in sequence, and obtain the second video.
[0013] In some embodiments, the editing operation information also includes a first time point corresponding to the editing operation in the sample video; the editing unit is configured to determine a second time point corresponding to the first time point in the first video based on the duration of the sample video and the duration of the first video; at the second time point of the first video, apply the editing operation and corresponding operation parameters to edit the target sub-video to obtain the second video.
[0014] In some embodiments, the editing unit is configured to apply the editing operation and corresponding operation parameters to edit the target sub-video at the second time point of the first video when the interval duration between the second time point and the transition time point in the first video is greater than the first duration.
[0015] In some embodiments, the editing unit is further configured to apply the editing operation and corresponding operation parameters to edit the target sub-video at the transition time point of the first video when the interval between the second time point and the transition time point is not greater than the first time point.
[0016] In some embodiments, the editing unit is configured to determine the similarity between a first video frame and a second video frame in the first video, where the first video frame is a video frame corresponding to the second time point, and the second video frame is a video frame of the first video within a second duration after the second time point; when the similarity is less than a similarity threshold, at the second time point of the first video, the editing operation and the corresponding operation parameters are applied to edit the target sub-video.
[0017] In some embodiments, the editing unit is further configured to determine a third time point in the first video when the similarity is not less than the similarity threshold, the third time point being a time point corresponding to a video frame after the second video frame in the first video frame and having a similarity with the first video frame less than the similarity threshold; and at the third time point in the first video, apply the editing operation and corresponding operation parameters to edit the target sub-video.
[0018] In some embodiments, the clipping operation information includes the video serial number corresponding to the clipping operation; the clipping unit is configured to execute and apply the clipping operation and corresponding operation parameters to clip the target sub-video corresponding to the video serial number in the first video frame to obtain the second video.
[0019] In some embodiments, the acquisition unit is configured to execute in response to a tutorial video import instruction in the editing interface, acquire the imported target tutorial video; and identify the editing operation information from the target tutorial video.
[0020] In some embodiments, the acquisition unit is configured to perform voice recognition on the audio in the target tutorial video to obtain the clipping operation performed in the target tutorial video and the fourth time point when the clipping operation is performed; extract the video frame corresponding to the fourth time point from the target tutorial video; perform image recognition on the extracted video frame to obtain operation parameters corresponding to the clipping operation.
[0021] According to another aspect of an embodiment of the present disclosure, there is provided an electronic device, the electronic device including:
[0022] one or more processors;
[0023] a memory for storing program codes executable by the processor;
[0024] The processor is configured to execute the program code to implement the above-mentioned video editing method.
[0025] According to another aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which, when program codes in the computer readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the video clipping method described above.
[0026] According to another aspect of the embodiments of the present disclosure, a computer program product is provided, which comprises computer programs / instructions, which, when executed by a processor, implement the video clipping method described above.
[0027] In the scheme provided by the embodiments of the present disclosure, for a first video fused from at least two sub-videos, only a certain tutorial video needs to be selected, and then the first video can be automatically clipped by using the clipping operation information associated with the tutorial video, so that the second video obtained has the same video special effect as the sample video after clipping in the target tutorial video, without the need for manual execution of excessive operations, realizing the automation of video clipping and improving the video clipping efficiency.
[0028] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0029] The accompanying drawings incorporated in the specification and forming a part of it, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure without imposing undue limitation on the disclosure.
[0030] Figure 1 is a schematic diagram of an implementation environment according to an exemplary embodiment.
[0031] Figure 2 is a flowchart of a video clipping method according to an exemplary embodiment.
[0032] Figure 3 is a flowchart of another video clipping method according to an exemplary embodiment.
[0033] Figure 4 is a schematic diagram of a clipping interface according to an exemplary embodiment.
[0034] Figure 5 is a schematic diagram of a tutorial interface according to an exemplary embodiment.
[0035] Figure 6 is a flowchart of a method for obtaining clipping operation information according to an exemplary embodiment.
[0036] Figure 7 is a block diagram of a video clipping device according to an exemplary embodiment.
[0037] Figure 8 It is a block diagram of a terminal according to an exemplary embodiment.
[0038] Figure 9 The figure is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION
[0039] In order to enable ordinary people in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0040] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0041] As used herein, the terms "at least one," "plurality," "each," and "any" include one, two, or more than two, "plurality" includes two or more than two, "each" refers to each of the corresponding plurality, and "any" refers to any one of the plurality. For example, the plurality of clipping operations includes three clipping operations, and "each" refers to each of the three clipping operations, and "any" refers to any one of the three clipping operations, which can be the first clipping operation, the second clipping operation, or the third clipping operation.
[0042] It should be noted that the target tutorial video, editing operation information, and first video involved in this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the first video involved in this disclosure was obtained with full authorization.
[0043] The video clip method provided by the embodiments of the present disclosure is executed by an electronic device. In some embodiments, the electronic device is provided as a terminal, and the terminal implements the operations performed by the video clip method. In some embodiments, the terminal is at least one of a smartphone, a smart watch, a desktop computer, a laptop computer, an MP3 player, an MP4 player, and a laptop computer. In some embodiments, the terminal interacts with a server to implement the operations performed by the video clip method. Figure 1 is a schematic diagram of an implementation environment of a video clip method according to an exemplary embodiment. As shown in Figure 1 , the implementation environment specifically includes a terminal 101 and a server 102, and the terminal 101 and the server 102 are directly or indirectly connected through wired or wireless communication. The server 102 is at least one of a server, multiple servers, a cloud computing platform, and a virtualization center.
[0044] The terminal 101 is configured to display a first video to be clipped in a clipping interface, and is capable of receiving an application instruction for a target tutorial video in the clipping interface, and sending a video clip request to the server 102, where the video clip request carries the first video and the target tutorial video, or the video clip request carries video identifiers of the first video and the target tutorial video. Based on the video clip request, the server 102 acquires clip operation information associated with the target tutorial video, and clips a target sub-video in the first video based on the acquired clip operation information to obtain a second video after clipping.
[0045] In some embodiments, after obtaining the second video, the server 102 is further capable of sending the second video to the terminal 101, and the terminal 101 receives the second video and displays the second video in the clipping interface.
[0046] In some embodiments, the terminal 101 is installed with a target application provided by the server 102, and the target application has a video clip function, and the clipping interface is an interface provided by the target application. The terminal 101 interacts with the server 102 through the target application to implement the video clip method.
[0047] It should be noted that the embodiments of the present disclosure are only described by taking the terminal and the server as an example to implement the operations performed by the video clip method, and in another embodiment, the terminal can also implement the operations performed by the video clip method.
[0048] Figure 2 FIG. 1 is a flow chart of a video editing method according to an exemplary embodiment. Figure 2 As shown, the method is executed by an electronic device and includes the following steps:
[0049] In step S201, the electronic device displays a first video to be edited in an editing interface. The first video is obtained by merging at least two sub-videos, and a same frame in the first video includes frames of the at least two sub-videos.
[0050] In an embodiment of the present disclosure, a first video to be edited and obtained by merging at least two sub-videos is displayed in an editing interface so that the first video can be subsequently edited to add video effects to the first video to obtain a second video, thereby improving the playback effect of the second video.
[0051] The editing interface is used to display the video to be edited. The first video is any type of video, for example, the first video contains content related to scenery, or contains content related to people. In the at least two sub-videos obtained by fusing the first video, each sub-video is any type of video, for example, each sub-video contains content related to scenery; or, in the at least two sub-videos, one sub-video contains content related to scenery, and the other sub-video contains content related to people, etc.
[0052] In the disclosed embodiment, the same frame in the first video includes frames of the at least two sub-videos, that is, the frame in the first video is obtained by merging the frames of the at least two sub-videos. For example, if the first video is a picture-in-picture video, which is obtained by merging two sub-videos, then the frame in the picture-in-picture video includes frames of the two sub-videos, and the display sizes of the two sub-videos may be different. For another example, the frame of the first video is a frame composed of frames of the at least two sub-videos, for example, the frame of the first video is a four-grid frame or a nine-grid frame, with each grid displaying a frame of a sub-video.
[0053] In step S202, the electronic device obtains editing operation information associated with the target tutorial video in response to an application instruction for the target tutorial video in the editing interface, where the target tutorial video is used to guide the editing process of adding video special effects to at least one sample sub-video in the sample video, and the editing operation information includes the editing operation performed in the editing process of adding video special effects to the at least one sample sub-video and the operation parameters corresponding to the editing operation.
[0054] In an embodiment of the present disclosure, the target tutorial video can illustrate how to add video effects to at least one sample sub-video in a sample video, and the application instructions to the target tutorial video are used to indicate that the first video is edited using the editing process shown in the target tutorial video. Therefore, editing operation information associated with the target tutorial video is obtained so that the first video can be subsequently edited according to the editing operation information, so that the edited first video has the same video effects as the edited sample video in the target tutorial video.
[0055] In an embodiment of the present disclosure, the sample video is derived from the fusion of at least two sample sub-videos, and the same frame within the sample video includes frames from the at least two sub-videos. The target tutorial video includes frames showing the editing process of adding video effects to at least one sample sub-video within the sample video. Specifically, when the target tutorial video is played, the editing process of adding video effects to at least one sample sub-video within the sample video is displayed, including the editing operations performed on the at least one sample sub-video during the editing process and the parameters used for each editing operation. The editing operation can be any type of operation, including, for example, chroma keying, animation addition, and blending mode operations. The operation parameters corresponding to the editing operation represent the operating parameters used when executing the editing operation. For example, if the editing operation is a chroma keying operation, the operation parameters corresponding to the chroma keying operation include the position, intensity, and shadow of the chroma keying. For another example, if the editing operation is an animation addition operation, the operation parameters corresponding to the animation addition operation include the added entrance animation, exit animation, or combined animation, as well as the time point at which the animation was added to the sample sub-video.
[0056] In step S203, the electronic device edits the target sub-video in the first video based on the editing operation information to obtain a second video, where the target sub-video corresponds to the sample sub-video in the sample video.
[0057] In the embodiment of the present disclosure, the editing operation and corresponding operation parameters included in the editing operation information associated with the target tutorial video can reflect the editing process of adding video special effects to the sample sub-video in the sample video in the target tutorial video. Therefore, based on the editing operation information associated with the target tutorial video, video special effects are added to the sub-video corresponding to the sample sub-video in the first video to obtain the second video, so as to ensure that the obtained second video has the same video special effects as the sample video in the target tutorial video, thereby ensuring the effect of the editing video, realizing the automation of video editing, and improving the efficiency of video editing.
[0058] In the scheme provided by the embodiments of the present disclosure, for a first video fused from at least two sub-videos, only a certain tutorial video needs to be selected, and then the second video can be automatically clipped by using the clip operation information associated with the tutorial video, so that the second video has the same video special effect as the sample video in the target tutorial video, without performing too many manual operations, thereby realizing the automation of video clipping and improving the video clipping efficiency.
[0059] In some embodiments, the clip operation information includes a plurality of clip operations and operation parameters corresponding to each clip operation; and the clip operation information is used to clip a target sub-video in the first video to obtain a second video, including:
[0060] According to the time sequence of the plurality of clip operations in the clip operation information, each clip operation and the corresponding operation parameter are applied in sequence to clip the target sub-video to obtain the second video.
[0061] In the embodiments of the present disclosure, according to the time sequence of the plurality of clip operations in the clip operation information, each clip operation and the corresponding operation parameter are applied in sequence to clip the target sub-video corresponding to the sample sub-video in the first video, so that the second video after clipping has the same video special effect as the sample video in the target tutorial video, thereby ensuring the clipping effect.
[0062] In some embodiments, the clip operation information further includes a first time point corresponding to the clip operation in the sample video; and the clip operation information is used to clip the target sub-video in the first video to obtain the second video, including:
[0063] Based on the time length of the sample video and the time length of the first video, a second time point corresponding to the first time point in the first video is determined;
[0064] At the second time point of the first video, the clip operation and the corresponding operation parameter are applied to clip the target sub-video to obtain the second video.
[0065] In the embodiments of the present disclosure, the second time point corresponding to the first time point in the first video is determined, that is, which time point in the first video is determined to perform the clip operation on the target sub-video in the first video, and therefore, at the second time point of the first video, the clip operation and the corresponding operation parameter are applied to clip the target sub-video in the first video, so that the second video obtained after clipping has the same video effect as the sample video, thereby ensuring the clipping effect.
[0066] In some embodiments, at the second time point of the first video, the clip operation and the corresponding operation parameter are applied to clip the target sub-video, including:
[0067] When the interval between the second time point and the transition time point in the first video is longer than the first time point, the target sub-video is edited by applying the editing operation and corresponding operation parameters at the second time point of the first video.
[0068] In an embodiment of the present disclosure, by determining the interval duration between the second time point and the transition time point in the first video, only when the interval duration is greater than the first duration, the editing operation and corresponding operation parameters are applied at the second time point of the first video to edit the target sub-video in the first video, so as to avoid the added video special effects from affecting the transition effect in the first video, thereby ensuring the display effect of the video.
[0069] In some embodiments, the method further comprises:
[0070] When the interval between the second time point and the transition time point is not greater than the first time point, the target sub-video is edited by applying the editing operation and corresponding operation parameters at the transition time point of the first video.
[0071] In the embodiment of the present disclosure, the interval between the second time point and the transition time point in the first video is no longer than the first time length, indicating that the second time point is close enough to the transition time point in the first video, and a video special effect is added at the transition time point, thereby avoiding the added video special effect from affecting the transition effect in the first video, and the transition effect and the added video special effect occurring at the same time point will produce a superimposed effect, further improving the display effect of the video.
[0072] In some embodiments, at the second time point of the first video, applying a clipping operation and corresponding operation parameters to clip the target sub-video includes:
[0073] Determine a similarity between a first video frame and a second video frame in the first video, where the first video frame is a video frame corresponding to the second time point, and the second video frame is a video frame of the first video within a second time period after the second time point;
[0074] When the similarity is less than the similarity threshold, at the second time point of the first video, a clipping operation and corresponding operation parameters are applied to clip the target sub-video.
[0075] In an embodiment of the present disclosure, when the similarity between the first video frame and the second video frame in the first video is less than the similarity threshold, it indicates that the first video frame corresponding to the second time point is not similar to the second video frame within the second time length after the second time point, which can reflect that the scene of the first video at the second time point has changed. Then, the editing operation and the corresponding operation parameters can be applied at the second time point of the first video to edit the target sub-video so that the video special effects are displayed at the scene switching point in the video, so that the added video special effects have a different effect from the scene switching superposition point, so as to ensure the display effect of the edited second video.
[0076] In some embodiments, after determining the similarity between the first video frame and the second video frame in the first video, the method further includes:
[0077] If the similarity is not less than the similarity threshold, determining a third time point in the first video, where the third time point is a time point corresponding to a video frame after the second video frame in the first video frame and having a similarity with the first video frame less than the similarity threshold;
[0078] At a third time point of the first video, a clipping operation and corresponding operation parameters are applied to clip the target sub-video.
[0079] In an embodiment of the present disclosure, a third time point corresponding to a video frame that follows the second video frame in the first video frame and whose similarity to the first video frame is less than a similarity threshold is determined, that is, a time point of the scene switch after the second time point is determined. At the third time point, the editing operation and corresponding operation parameters are applied to edit the target sub-video so that the video special effects are displayed at the scene switch in the video, so that the added video special effects have a different effect from the scene switch superposition, so as to ensure the display effect of the edited second video.
[0080] In some embodiments, the clipping operation information includes a video sequence number corresponding to the clipping operation; and clipping a target sub-video in the first video based on the clipping operation information to obtain a second video includes:
[0081] Applying a clipping operation and corresponding operation parameters, clipping the target sub-video corresponding to the video sequence number in the first video frame to obtain a second video.
[0082] In the embodiment of the present disclosure, when editing a first video, the editing operation and corresponding operation parameters are applied to edit the target sub-video corresponding to the video sequence number in the first video frame to obtain a second video, thereby ensuring that the edited second video has the same video special effects as the edited sample video, thereby ensuring the editing effect of the edited second video.
[0083] In some embodiments, in response to an application instruction to a target tutorial video in the editing interface, obtaining editing operation information associated with the target tutorial video includes:
[0084] In response to a tutorial video import instruction in the editing interface, obtaining an imported target tutorial video;
[0085] Identify editing operation information from the target tutorial video.
[0086] The disclosed embodiment provides a method for obtaining editing operation information. By importing any tutorial video, the editing operation information associated with the target tutorial video can be obtained. The imported tutorial video can be of any type, rather than just providing multiple template tutorial videos to edit the first video, thereby meeting the various needs of users and ensuring the scope of application of the video editing method.
[0087] In some embodiments, identifying editing operation information from the target tutorial video includes:
[0088] Performing speech recognition on the audio in the target tutorial video to obtain a clipping operation performed in the target tutorial video and a fourth time point at which the clipping operation was performed;
[0089] Extracting the video frame corresponding to the fourth time point from the target tutorial video;
[0090] Perform image recognition on the extracted video frames to obtain operation parameters corresponding to the editing operation.
[0091] In the disclosed embodiment, voice recognition and image recognition are combined to analyze the audio and video frames in the tutorial video respectively, so that the determined editing operation is associated with the corresponding operation parameters, thereby determining the accuracy of the editing operation information.
[0092] In the above Figure 2 On the basis of the embodiment shown, the embodiment of the present disclosure can also import any tutorial video and use the imported tutorial video to edit the first video to realize the process of automatic video editing. The specific process is detailed in the following embodiment.
[0093] Figure 3 is a flow chart of another video editing method according to an exemplary embodiment, the method is executed by an electronic device, such as Figure 3 As shown, the method includes:
[0094] In step S301, the electronic device displays a first video to be edited in an editing interface. The first video is obtained by merging at least two sub-videos, and a same frame in the first video includes frames of the at least two sub-videos.
[0095] In some embodiments, the editing interface includes a first display area and a second display area, the first display area displays the first video, and the second display area displays each sub-video of at least two sub-videos fused to obtain the first video.
[0096] In the embodiment of the present disclosure, the fused first video and each sub-video are displayed in different display areas in the editing interface, and the sub-videos fused to obtain the first video can be displayed through the editing interface, thereby improving the display effect of the editing interface.
[0097] In some embodiments, a play option is displayed in the first display area, and in response to a triggering operation on the play option, the first video is played in the first display area. In the disclosed embodiment, the first video currently being fused can be previewed in the first display area, and the video effect of the first video can be known in advance, enriching the functionality of the editing interface so that the first video can be edited on this basis later.
[0098] In some embodiments, the editing interface displays editing function options, each of which is used to edit the first video displayed in the editing interface. For example, the editing function options displayed in the editing interface include volume options, effect options, speed change options, etc. The volume option is used to adjust the volume of the audio in the first video displayed in the editing interface, the effect option is used to select an applied tutorial video, and the speed change option is used to adjust the frame rate of the first video.
[0099] For example, the editing interface displayed by the electronic device is as follows Figure 4 As shown, a first video is displayed in the first display area 401. The first video is obtained by merging two sub-videos. The screen of the first video includes screen 1 of one sub-video and screen 2 of another sub-video. Two sub-videos, namely sub-video 1 and sub-video 2, are displayed in the second display area 402. In addition, a sound off option is also displayed in the second display area 402 to control whether the generated first video retains the original sound of sub-video 1 and sub-video 2. When the sound off option is clicked, the original sound of sub-video 1 and sub-video 2 is not retained in the generated first video. In addition, a third display area 403 is also displayed in the editing interface. The third display area 403 displays function options for operating the video displayed in the first display area 401 and the time information of the first video, such as Figure 4As shown, the third display area 403 displays the time point at which the first video is currently paused, the duration of the first video, a play option, a fast-forward option, a fast-rewind option, and a full-screen display option. The play option is used to play the first video, the fast-forward option is used to fast-forward the first video being played, the fast-rewind option is used to fast-rewind the first video being played, and the full-screen display option is used to display the first video in full screen. In addition, multiple editing function options are also displayed at the bottom of the editing interface, such as a volume option, an effect option, a speed change option, etc.
[0100] In some embodiments, step S301 includes: in response to an import instruction in the editing interface, obtaining at least two imported sub-videos, fusing the at least two sub-videos according to the relationship between the starting time points of the at least two sub-videos to obtain the first video, and displaying the first video in the editing interface.
[0101] In an embodiment of the present disclosure, the editing interface has the function of importing videos. The relationship between the starting time points of the at least two sub-videos can reflect the time point at which each sub-video starts playing, and further can reflect the time period in which the images of the at least two sub-videos will appear together. According to the relationship between the starting time points of the at least two sub-videos, the at least two sub-videos are merged into one video, and the merged video contains the same image containing the images of the at least two sub-videos. The embodiment of the present disclosure provides a function of automatically merging videos. By simply importing at least two videos in the editing interface, they can be automatically merged into one video, without the need for manual video synthesis, thereby improving the convenience of merging videos.
[0102] In some embodiments, in at least two sub-videos, each sub-video has a starting time point and an ending time point, and the process of fusing to obtain a first video includes: determining the time period between the earliest starting time point and the latest ending time point of the at least two sub-videos as a third duration, and fusing the at least two sub-videos into a first video having the third duration according to the starting time point of each sub-video within the third duration.
[0103] In some embodiments, each sub-video is imported in sequence in the editing interface, and the process of importing any sub-video includes: responding to the import instruction in the editing interface, displaying multiple multimedia resources, responding to the confirmation operation of at least one multimedia resource, and generating a sub-video based on the at least one multimedia resource.
[0104] The multimedia resource includes an image or video. In the disclosed embodiment, a sub-video is generated by selecting a multimedia resource, thereby realizing a solution for automatically generating a video and ensuring the convenience of generating a video. It should be noted that the above description is based on the example of importing a sub-video in the editing interface. In another embodiment, the above steps can be repeated to import multiple sub-videos in the editing interface.
[0105] In some implementations, the process of generating a sub-video based on imported multimedia resources includes: in the case of generating a sub-video based on multiple multimedia resources, if the multiple multimedia resources are all videos, the multiple videos are spliced into a sub-video; if the multiple multimedia resources include images and videos, a video with a fourth duration is generated according to the images, and the video corresponding to the image and the video in the multimedia resources are spliced into a sub-video; if the multiple multimedia resources only include images, a video with a fourth duration is generated according to the images, and the generated multiple videos are spliced into a sub-video.
[0106] The fourth duration is any duration, for example, 2 seconds. In a video generated based on an image, only the image is displayed within the fourth duration. In the disclosed embodiment, regardless of whether the selected multiple multimedia resources include images or videos, a video can be generated based on the multiple multimedia resources, thereby improving the convenience of video generation.
[0107] In some embodiments, if the first video is a picture-in-picture video, the process of importing two sub-videos in sequence to generate the first video includes: displaying multiple multimedia resources in response to an import instruction in the editing interface, and generating a first sub-video based on the at least one multimedia resource in response to a confirmation operation on at least one multimedia resource; displaying the multiple multimedia resources in response to a picture-in-picture add instruction in the editing interface, and generating a second sub-video based on the at least one multimedia resource in response to a confirmation operation on at least one multimedia resource; generating the first video based on the first sub-video and the second sub-video, and displaying the first video in the editing interface.
[0108] The disclosed embodiment provides a method for importing a picture-in-picture video, which can automatically generate a picture-in-picture video by importing multiple sub-videos, thereby improving the convenience of generating the picture-in-picture video.
[0109] In step S302, the electronic device obtains an imported target tutorial video in response to a tutorial video import instruction in the editing interface, where the target tutorial video is used to guide the editing process of adding video special effects to at least one sample sub-video in the sample video.
[0110] In the embodiment of the present disclosure, the editing interface has the function of importing tutorial videos. When the first video to be edited is displayed in the editing interface, the target tutorial video to be applied can be imported into the editing interface so that video special effects can be added to the first video according to the target tutorial video.
[0111] In some embodiments, step S302 includes: displaying a tutorial interface in response to a tutorial video import instruction in the editing interface, and obtaining a target tutorial video entered in the tutorial import interface in response to a confirmation operation on the tutorial import interface; or, obtaining a target tutorial video associated with a video link entered in the tutorial import interface in response to a confirmation operation on the tutorial import interface.
[0112] In the disclosed embodiment, the tutorial import interface has the function of inputting a video or link. If a video is input in the tutorial import interface, in response to a confirmation operation on the tutorial import interface, the video input in the tutorial import interface is used as the target tutorial video. If a video link associated with a video is input in the tutorial import interface, in response to a confirmation operation on the tutorial import interface, the video associated with the video link is used as the target tutorial video. The disclosed embodiment provides multiple ways to import tutorial videos, allowing direct import of tutorial videos or automatic import of tutorial videos obtained by inputting links, enriching the ways to import tutorial videos, meeting the various needs of users, and improving the user experience.
[0113] In some embodiments, a tutorial import option is displayed in the editing interface, and responding to the triggering operation of the tutorial import option is equivalent to receiving a tutorial import instruction.
[0114] For example, in response to the triggering operation of the tutorial import option, the tutorial interface is displayed as follows: Figure 5 As shown, the tutorial interface includes a link input area 501, descriptive information for downloading a video link, and other functional options. The video link of the tutorial video can be entered in the link input area 501 so as to import the tutorial video. The functional options displayed in the tutorial interface include a forwarding option, a save option, a copy option, and a favorite option. The forwarding option is used to forward the tutorial video associated with the video link, the save option is used to save the tutorial video associated with the input video link to the album, the copy option is used to copy the input video link, and the favorite option is used to favorite the tutorial video associated with the video link. In addition, the tutorial interface also includes a search area, through which song names or singers can be searched. The tutorial interface also displays a detailed guidance option for downloading the tutorial video through the link. When the user clicks the detailed guidance option, the electronic device can display the detailed information of the tutorial video downloaded through the link for the user to view.
[0115] In step S303, the electronic device identifies editing operation information associated with the target tutorial video from the target tutorial video, and the editing operation information includes the editing operation performed in the editing process of adding video special effects to at least one sample sub-video in the sample video and the operation parameters corresponding to the editing operation.
[0116] In the disclosed embodiment, when a target tutorial video is imported, editing operation information associated with the target tutorial video is obtained by identifying the target tutorial video, so that the first video can be edited using the editing operation information. The disclosed embodiment provides a method for obtaining editing operation information. By performing editing on any imported tutorial video, the editing operation information associated with the target tutorial video can be obtained. The imported tutorial video can be any type, rather than being limited to the multiple template tutorial videos provided to edit the first video. This meets the various needs of users and ensures the scope of application of the video editing method.
[0117] In some embodiments, step S303 includes the following steps 1-3:
[0118] Step 1: Perform speech recognition on the audio in the target tutorial video to obtain the editing operation performed in the target tutorial video and the fourth time point when the editing operation is performed.
[0119] In the disclosed embodiment, the audio in the target tutorial video is used to provide voice guidance for the editing process of adding video effects to at least one sample sub-video in the sample video. The audio includes the function names corresponding to the editing operations performed during the editing process. Therefore, by performing voice recognition on the audio, the function names included in the audio in the target tutorial video can be obtained, that is, the editing operations performed during the editing process can be obtained. The time point in the audio that describes the recognized editing operation can be used as the fourth time point when the editing operation was performed.
[0120] For example, if the audio indicates "click on chroma cutout, adjust the intensity to 80, and adjust the shadow to 10" at 10 seconds, then by performing voice recognition on the audio, the "chroma cutout operation" performed in the target tutorial video can be obtained, and the fourth time point for performing the "chroma cutout operation" can be determined to be 10 seconds.
[0121] Step 2: Extract the video frame corresponding to the fourth time point from the target tutorial video.
[0122] In an embodiment of the present disclosure, the target tutorial video includes audio and video frames. When the audio indicates that a certain editing operation is to be performed, the situation of performing the editing operation can be displayed in the video frame corresponding to the time point when the editing operation is performed. Therefore, when the fourth time point for performing the editing operation is determined, the video frame corresponding to the fourth time point is extracted so that the situation of performing the editing operation is determined based on the extracted video frame.
[0123] In some embodiments, the video frames corresponding to the fourth time point are video frames within a fifth duration starting from the fourth time point, or video frames within a sixth duration before the fourth time point and within a seventh duration after the fourth time point. The fifth, sixth, and seventh durations are all arbitrary durations.
[0124] In the embodiment of the present disclosure, considering that the process of executing the editing operation may take a period of time, for the fourth time point when the editing operation is executed, video frames within a period of time related to the fourth time point are extracted from the target tutorial video as the video frames corresponding to the fourth time point, so as to ensure the completeness of the situation in which the editing operation is executed, and further ensure the accuracy of the editing parameters obtained subsequently.
[0125] Step 3: Perform image recognition on the extracted video frames to obtain operation parameters corresponding to the editing operation.
[0126] In an embodiment of the present disclosure, the identified editing operation and the operation parameters corresponding to the editing operation constitute the editing operation information associated with the target tutorial video.
[0127] In the disclosed embodiment, the extracted video frames can display the execution of the editing operation, that is, the extracted video frames will display the operation parameters used when executing the editing operation. Therefore, by performing image recognition on the video frame corresponding to the time point when the editing operation was executed, the operation parameters corresponding to the editing operation are obtained. In the disclosed embodiment, combined with speech recognition and image recognition, the audio and video frames in the tutorial video are analyzed separately, so that the determined editing operation is associated with the corresponding operation parameters, thereby determining the accuracy of the editing operation information.
[0128] In some embodiments, the identified editing operation corresponds to a function name. For example, the function name corresponding to the editing operation is chroma cutout, animation, blending mode, etc., and a function option containing the function name is displayed in the video frame. The process of obtaining the operation parameters includes: performing image recognition on the video frame corresponding to the editing operation, determining the target video frame, the function option corresponding to the editing operation displayed in the target video frame is selected, performing image recognition on the target video frame, and obtaining the operation parameters corresponding to the editing operation.
[0129] In an embodiment of the present disclosure, when the function option corresponding to the editing operation in the target video frame is selected, it means that the editing operation is being performed in the target video frame, and the operation parameters corresponding to the editing operation are displayed in the target video frame. Therefore, the operation parameters are identified from the target video frame, thereby ensuring the accuracy of the identified operation parameters.
[0130] For example, taking the target tutorial video as a picture-in-picture tutorial video, the process of obtaining the editing operation information associated with the picture-in-picture video is as follows: Figure 6 As shown, by performing voice recognition on the audio in the picture-in-picture tutorial video, the editing operation performed in the picture-in-picture tutorial video and the fourth time point when the editing operation is performed are obtained, the video frame corresponding to the fourth time point is extracted from the target tutorial video, and image recognition is performed on the extracted video frame to obtain the operation parameters and video serial number corresponding to the editing operation. The obtained editing operation and the corresponding operation parameters and video serial number constitute the editing operation information associated with the picture-in-picture tutorial video.
[0131] In some embodiments, step S303 includes: calling a recognition model to identify and obtain editing operation information associated with the target tutorial video from the target tutorial video.
[0132] In an embodiment of the present disclosure, the recognition model is used to identify the editing operation information associated with the tutorial video from the tutorial video. The recognition model is an arbitrary network model. In some embodiments, the recognition model is called to identify the editing operation information associated with the target tutorial video according to steps 1-3 above.
[0133] In some embodiments, the training process of the recognition model includes: obtaining a sample tutorial video and corresponding sample editing operation information, calling the recognition model, identifying predicted editing operation information from the sample tutorial video, and training the recognition model based on the difference between the sample editing operation information and the predicted editing operation information.
[0134] The sample tutorial video is any tutorial video, for example, a picture-in-picture tutorial video. In the disclosed embodiment, the sample tutorial video is subjected to video and dubbing analysis to identify sample editing operation information associated with the sample tutorial video. The sample tutorial video and the sample editing operation information are used to train a recognition model to improve the accuracy of the recognition model, thereby ensuring the accuracy of the editing operation information subsequently recognized by the recognition model.
[0135] In step S304, the electronic device edits the target sub-video in the first video based on the editing operation information to obtain a second video, where the target sub-video corresponds to the sample sub-video.
[0136] In some embodiments, when the electronic device is editing the target sub-video in the first video based on the editing operation information, the screen of editing the first video is displayed in the editing interface.
[0137] In the embodiment of the present disclosure, by displaying the screen of editing the first video in the editing interface to simulate the process of manually editing the video according to the tutorial video, the display effect of the editing interface is improved, thereby increasing the attractiveness to users.
[0138] In some embodiments, based on the different contents included in the editing operation information, different methods can be used for editing, and the process of editing the first video includes the following three methods.
[0139] The first method is that when the editing operation information includes multiple editing operations and operation parameters corresponding to each editing operation, the process of editing the first video includes: according to the timing of the multiple editing operations in the editing operation information, each editing operation and the corresponding operation parameters are applied in sequence to edit the target sub-video in the first video to obtain the second video.
[0140] In some embodiments, in the clipping operation information, the multiple clipping operations constitute an operation sequence in time sequence.
[0141] In an embodiment of the present disclosure, multiple editing operations are performed on the sample sub-video in the sample video in the target tutorial video, and different execution orders of the multiple editing operations may result in different added video effects. Therefore, by applying each editing operation and corresponding operation parameters in sequence according to the timing of the multiple editing operations in the editing operation information, the target sub-video corresponding to the sample sub-video in the first video is edited, so that the edited second video has the same video effects as the edited sample video in the target tutorial video, thereby ensuring the editing effect.
[0142] In the second manner, when the editing operation information further includes a first time point corresponding to the editing operation in the sample video, the process of editing the first video includes the following steps 1-2.
[0143] Step 1: Based on the duration of the sample video in the target tutorial video and the duration of the first video, determine the second time point corresponding to the first time point in the first video.
[0144] Among them, the first time point corresponding to the editing operation performed in the target tutorial video in the sample video is used to indicate that when the editing operation is performed on the sample sub-video in the sample video, the editing operation is performed on the sample sub-video in the sample video at the time point targeted in the sample video, that is, at the first time point in the sample video.
[0145] In the embodiment of the present disclosure, since the duration of the sample video may be different from that of the first video, the second time point corresponding to the first time point in the first video is determined based on the duration of the sample video and the duration of the first video, that is, it is determined at which time point in the first video the editing operation is performed on the target sub-video in the first video.
[0146] In some embodiments, a method for determining the duration of a sample video includes: performing image recognition on video frames in a target tutorial video to obtain the duration of the sample video, or performing speech recognition on audio in a target tutorial video to obtain the duration of the sample video.
[0147] In the disclosed embodiment, the duration of the sample video is displayed in a certain video frame of the target tutorial video. For example, a progress bar corresponding to the sample video is displayed in the target tutorial video, and one end of the progress bar indicates the total duration of the sample video. Therefore, the duration of the sample video can be obtained by performing image recognition on the video frames in the target tutorial video. In the disclosed embodiment, the audio in the target tutorial video indicates the duration of the sample video. Therefore, the duration of the sample video can be obtained by performing speech recognition on the audio.
[0148] Step 2: At a second time point in the first video, apply a clipping operation and corresponding operation parameters to clip the target sub-video in the first video to obtain a second video.
[0149] In the embodiment of the present disclosure, the second time point corresponding to the first time point in the first video is determined, that is, it is determined at which time point in the first video the editing operation is performed on the target sub-video in the first video. Therefore, at the second time point of the first video, the editing operation and the corresponding operation parameters are applied to edit the target sub-video in the first video, so that the edited second video has the same video effect as the sample video, thereby ensuring the editing effect.
[0150] In some embodiments, step 2 includes: when the interval between the second time point and the transition time point in the first video is greater than the first duration, applying the editing operation and corresponding operation parameters at the second time point of the first video to edit the target sub-video in the first video.
[0151] In the disclosed embodiment, the transition time point refers to the scene of the first video that has changed before and after the transition time point. The determined second time point is the time point corresponding to the time point when the editing operation is performed on the sample sub-video in the sample video. By determining the interval between the second time point and the transition time point in the first video, only when the interval is longer than the first time length, the editing operation and the corresponding operation parameters will be applied at the second time point of the first video to edit the target sub-video in the first video, so as to avoid the added video effects from affecting the transition effect in the first video, thereby ensuring the display effect of the video.
[0152] In some embodiments, if there are multiple transition time points in the first video, only when the interval between the second time point and each transition time point is greater than the first duration, at the second time point of the first video, the editing operation and corresponding operation parameters are applied to edit the target sub-video in the first video.
[0153] In some embodiments, the method further includes: applying a clipping operation and corresponding operation parameters to clip the target sub-video at the transition time point of the first video when the interval between the second time point and the transition time point in the first video is not greater than the first time point.
[0154] In the embodiment of the present disclosure, the interval between the second time point and the transition time point in the first video is no longer than the first time length, indicating that the second time point is close enough to the transition time point in the first video, and a video special effect is added at the transition time point, thereby avoiding the added video special effect from affecting the transition effect in the first video, and the transition effect and the added video special effect occurring at the same time point will produce a superimposed effect, further improving the display effect of the video.
[0155] In some embodiments, if there are multiple transition time points in the first video, the editing operation and corresponding operation parameters are applied to the target sub-video at the transition time point of the first video only when the interval between the second time point and any transition time point is not greater than the first interval.
[0156] In some embodiments, step 2 includes: determining the similarity between a first video frame and a second video frame in a first video, where the first video frame is a video frame corresponding to a second time point, and the second video frame is a video frame within a second duration of the first video after the second time point; when the similarity is less than a similarity threshold, at the second time point of the first video, applying the editing operation and corresponding operation parameters to edit the target sub-video.
[0157] The similarity threshold is an arbitrary value, for example, 0.8 or 0.9. The similarity between the first video frame and the second video frame indicates whether the content of the first video frame and the second video frame is similar, thereby reflecting whether the content of the first video frame and the second video frame belongs to the same scene. The greater the similarity between the first video frame and the second video frame, the more similar the content of the first video frame and the second video frame is, thereby reflecting that the content of the first video frame and the second video frame is more likely to belong to the same scene.
[0158] In an embodiment of the present disclosure, when the similarity between the first video frame and the second video frame in the first video is less than the similarity threshold, it indicates that the first video frame corresponding to the second time point is not similar to the second video frame within the second time length after the second time point, which can reflect that the scene of the first video at the second time point has changed. Then, the editing operation and the corresponding operation parameters can be applied at the second time point of the first video to edit the target sub-video so that the video special effects are displayed at the scene switching point in the video, so that the added video special effects have a different effect from the scene switching superposition point, so as to ensure the display effect of the edited second video.
[0159] In some embodiments, the method further includes: when the similarity between the first video frame and the second video frame in the first video is not less than a similarity threshold, determining a third time point in the first video, the third time point being a time point corresponding to a video frame after the second video frame in the first video frame and having a similarity with the first video frame less than the similarity threshold; at the third time point in the first video, applying a clipping operation and corresponding operation parameters to clip the target sub-video.
[0160] In an embodiment of the present disclosure, when the similarity between the first video frame and the second video frame in the first video is not less than the similarity threshold, it means that the first video frame corresponding to the second time point is similar to the second video frame within the second time length after the second time point. If a video special effect is added at the second time point, the first video will display a video special effect in a video frame in the middle of a plurality of consecutive video frames and then return to its previous state, resulting in poor display effect of the video special effect. Therefore, a third time point corresponding to a video frame after the second video frame in the first video frame and whose similarity with the first video frame is less than the similarity threshold is determined, that is, the time point of the scene switch after the second time point is determined. At the third time point, the editing operation and the corresponding operation parameters are applied to edit the target sub-video so that the video special effect is displayed at the scene switch in the video, so that the added video special effect has a different effect from the scene switch superposition, so as to ensure the display effect of the edited second video.
[0161] In a third method, the editing operation information includes a video serial number corresponding to the editing operation: applying the editing operation and corresponding operation parameters, editing the target sub-video corresponding to the video serial number in the first video frame to obtain a second video.
[0162] The video sequence number corresponding to the editing operation refers to the video sequence number of the sample sub-video in the target tutorial video to which the editing operation is applied. The target sub-video corresponding to the video sequence number in the first video frame is the sub-video in the first video that corresponds to the sample sub-video in the sample video.
[0163] In the embodiment of the present disclosure, the sample video is obtained by fusion of at least two sample sub-videos, and the editing operation performed on the sample video in the target tutorial video is for at least one sample sub-video in the sample video. Therefore, when obtaining the editing operation information, the video serial number corresponding to the editing operation can be obtained. Then, when editing the first video, the editing operation and the corresponding operation parameters are applied to edit the target sub-video corresponding to the video serial number in the first video frame to obtain the second video, thereby ensuring that the edited second video has the same video special effects as the edited sample video, thereby ensuring the editing effect of the edited second video.
[0164] It should be noted that the above three methods of editing the first video can be combined arbitrarily. Taking the combination of the above three methods as an example, the process of editing the first video includes: according to the timing of multiple editing operations in the editing operation information, based on the length of the sample video in the target tutorial video and the length of the first video, determine the first time point corresponding to the current editing operation to be executed in the sample video and the second time point corresponding to the first video; at the second time point of the first video, apply the editing operation and the corresponding operation parameters to edit the target sub-video corresponding to the video serial number corresponding to the editing operation in the first video until the second video is obtained.
[0165] In the disclosed embodiment, the editing operation information includes multiple editing operations, the first time point corresponding to each editing operation in the sample video, the operation parameters corresponding to each editing operation, and the video sequence number corresponding to each editing operation. Thus, according to the above method, each editing operation and its corresponding editing parameters can be sequentially applied according to the time sequence of the multiple editing operations in the editing operation information to edit the target sub-video in the first video to obtain the second video.
[0166] In the scheme provided by the embodiments of the present disclosure, for a first video fused from at least two sub-videos, only a certain tutorial video needs to be selected, and then the first video can be automatically clipped by using the clip operation information associated with the tutorial video, so that the second video obtained has the same video special effect as the sample video after being clipped in the target tutorial video, without the need for manual execution of excessive operations, thereby realizing the automation of video clipping and improving the video clipping efficiency.
[0167] In the embodiments of the present disclosure, the user only needs to import multimedia resources for forming a picture-in-picture video and select a target tutorial video to be applied, and then a final picture-in-picture video can be generated, without the need for the user to manually clip the picture-in-picture video according to the tutorial video, thereby reducing the time spent by the user in video clipping, improving the user experience, and increasing the user stickiness and the praise rate.
[0168] The embodiments of the present disclosure provide a way of obtaining clip operation information, by which the clip operation information associated with a target tutorial video can be obtained from any imported tutorial video, and the imported tutorial video can be any type, instead of only being able to provide a plurality of template tutorial videos for editing a first video, thereby meeting the various needs of users and ensuring the application range of the video clipping method.
[0169] In the embodiments of the present disclosure, the audio and the video frames in the tutorial video are analyzed by combining voice recognition and image recognition, so that the determined clip operation is associated with the corresponding operation parameter, and the accuracy of the determined clip operation information is improved.
[0170] It should be noted that the above Figure 3 The embodiments shown in FIG. 3 are described by taking the imported target tutorial video as an example to obtain the clip operation information, and in another embodiment, the steps S302-S303 are not performed, but other ways are adopted to obtain the clip operation information associated with the target tutorial video in response to the application instruction of the target tutorial video in the clip interface.
[0171] In some embodiments, in response to the display instruction in the clip interface, the plurality of tutorial videos are displayed, and in response to the application instruction of the target tutorial video, the clip operation information associated with the target tutorial video is obtained.
[0172] In the embodiments of the present disclosure, the electronic device is provided with a plurality of tutorial videos and clip operation information associated with each tutorial video for the user to select, and when the user selects any tutorial video, the first video can be clipped based on the clip operation information associated with the selected tutorial video. In the embodiments of the present disclosure, the clip operation information associated with each tutorial video is identified from the tutorial video, and the process of identifying the clip operation information is the same as the step S303 described above, and will not be described here again.
[0173] In some implementations, the editing interface displays an effect option, and in response to the triggering operation of the effect option, it is equivalent to receiving a display instruction. Figure 4 The effect options shown display multiple tutorial videos in the editing interface, and in response to an application instruction for a target video tutorial, obtain editing operation information associated with the target tutorial video.
[0174] It should be noted that the above Figure 3 The embodiment is only described by taking the example of editing the first video according to the target tutorial video. In another embodiment, after step S304, the user can also edit the second video in the editing interface to obtain a third video.
[0175] It should be noted that all the above optional technical solutions can be combined in any way to form optional embodiments of the present disclosure, and will not be described in detail here.
[0176] Figure 7 is a block diagram of a video editing device according to an exemplary embodiment. Figure 7 As shown, the device includes:
[0177] The display unit 701 is configured to display a first video to be edited in an editing interface, where the first video is obtained by fusing at least two sub-videos, and a same frame in the first video contains frames of at least two sub-videos;
[0178] An acquisition unit 702 is configured to execute, in response to an application instruction to a target tutorial video in the editing interface, acquisition of editing operation information associated with the target tutorial video, wherein the target tutorial video is used to guide an editing process for adding video effects to at least one sample sub-video in the sample video, and the editing operation information includes an editing operation performed during the editing process for adding video effects to the at least one sample sub-video and operation parameters corresponding to the editing operation;
[0179] The editing unit 703 is configured to perform editing on the target sub-video in the first video based on the editing operation information to obtain a second video, where the target sub-video corresponds to the sample sub-video.
[0180] In the solution provided by the implementation of the present disclosure, for the first video obtained by the fusion of at least two sub-videos, it is only necessary to select a tutorial video, and then the first video can be automatically edited using the editing operation information associated with the tutorial video, so that the obtained second video has the same video special effects as the edited sample video in the target tutorial video, without the need for manual execution of excessive operations, thereby realizing the automation of video editing and improving video editing efficiency.
[0181] In some embodiments, the editing operation information includes multiple editing operations and operation parameters corresponding to each editing operation; the editing unit 703 is configured to execute the timing of the multiple editing operations in the editing operation information, apply each editing operation and the corresponding operation parameters in sequence, and edit the target sub-video to obtain a second video.
[0182] In some embodiments, the editing operation information also includes a first time point corresponding to the editing operation in the sample video; the editing unit 703 is configured to determine the second time point corresponding to the first time point in the first video based on the duration of the sample video and the duration of the first video; at the second time point of the first video, the editing operation and the corresponding operation parameters are applied to edit the target sub-video to obtain a second video.
[0183] In some embodiments, the editing unit 703 is configured to apply an editing operation and corresponding operation parameters to edit the target sub-video at the second time point of the first video when the interval duration between the second time point and the transition time point in the first video is greater than the first duration.
[0184] In some embodiments, the editing unit 703 is further configured to apply the editing operation and corresponding operation parameters to edit the target sub-video at the transition time point of the first video when the interval between the second time point and the transition time point is not greater than the first time point.
[0185] In some embodiments, the editing unit 703 is configured to determine the similarity between a first video frame and a second video frame in a first video, where the first video frame is a video frame corresponding to a second time point, and the second video frame is a video frame within a second duration of the first video after the second time point; when the similarity is less than a similarity threshold, at the second time point of the first video, a editing operation and corresponding operation parameters are applied to edit the target sub-video.
[0186] In some embodiments, the editing unit 703 is further configured to determine a third time point in the first video when the similarity is not less than a similarity threshold, the third time point being a time point corresponding to a video frame after the second video frame in the first video frame and having a similarity with the first video frame less than a similarity threshold; at the third time point in the first video, apply an editing operation and corresponding operation parameters to edit the target sub-video.
[0187] In some embodiments, the clipping operation information includes a video serial number corresponding to the clipping operation; the clipping unit 703 is configured to execute the application clipping operation and corresponding operation parameters to clip the target sub-video corresponding to the video serial number in the first video frame to obtain a second video.
[0188] In some embodiments, the acquisition unit 702 is configured to perform, in response to a tutorial video import instruction in the editing interface, acquiring the imported target tutorial video; identifying the editing operation information from the target tutorial video.
[0189] In some embodiments, the acquisition unit 702 is configured to perform speech recognition on the audio in the target tutorial video to obtain the editing operation performed in the target tutorial video and a fourth time point of performing the editing operation; extracting a video frame corresponding to the fourth time point from the target tutorial video; and performing image recognition on the extracted video frame to obtain the operation parameter corresponding to the editing operation.
[0190] It should be noted that the apparatus provided in the above embodiments is only exemplified by the division of the above functional units. In actual applications, the above functions can be completed by different functional units according to needs, that is, the internal structure of the electronic device is divided into different functional units to complete all or part of the above-described functions. In addition, the video editing apparatus and the video editing method provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.
[0191] The present disclosure also provides an electronic device, which comprises:
[0192] one or more processors;
[0193] a memory for storing the processor-executable program code;
[0194] wherein the processor is configured to execute the program code to implement the video editing method provided by each of the method embodiments.
[0195] In some embodiments, the electronic device is provided as a terminal. Figure 8 is a block diagram of a terminal 800 according to an exemplary embodiment. The terminal Figure 8 The structural block diagram of the terminal 800 provided by one exemplary embodiment of the present disclosure is shown.
[0196] Generally, the terminal 800 includes a processor 801 and a memory 802.
[0197] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0198] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 is used to store at least one program code, which is used to be executed by the processor 801 to implement the video editing method provided in the method embodiment of the present disclosure.
[0199] In some embodiments, terminal 800 may optionally include a peripheral device interface 803 and at least one peripheral device. The processor 801, memory 802, and peripheral device interface 803 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 803 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807, and a power supply 808.
[0200] The peripheral device interface 803 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 801 and the memory 802. In some embodiments, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral device interface 803 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0201] The RF circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 804 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 804 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The RF circuit 804 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 804 may also include circuits related to Near Field Communication (NFC), which is not limited in this disclosure.
[0202] Display screen 805 is used to display a user interface (UI). This UI can include graphics, text, icons, videos, or any combination thereof. When display screen 805 is a touch screen display, it can also capture touch signals on or above the surface of display screen 805. These touch signals can be input as control signals to processor 801 for processing. Display screen 805 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be a single display screen 805, located on the front panel of terminal 800. In other embodiments, there can be at least two display screens 805, located on different surfaces of terminal 800 or in a foldable design. In still other embodiments, display screen 805 can be a flexible display, located on a curved or foldable surface of terminal 800. Display screen 805 can also be configured as a non-rectangular, irregular shape, i.e., a special-shaped screen. Display screen 805 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0203] The camera assembly 806 is used to capture images or videos. Optionally, the camera assembly 806 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 806 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0204] The audio circuit 807 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 801 for processing, or input into the radio frequency circuit 804 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 800. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 807 may also include a headphone jack.
[0205] Power supply 808 is used to power various components in terminal 800. Power supply 808 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 808 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0206] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the terminal 800, and the terminal 800 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0207] In some embodiments, when the electronic device is provided as a server, Figure 9 This is a block diagram of a server 900 according to an exemplary embodiment. The server 900 may vary significantly due to different configurations or performance, and may include one or more processors (Central Processing Units, CPUs) 901 and one or more memories 902. The memories 902 store at least one program code, which is loaded and executed by the processor 901 to implement the video editing methods provided by the various method embodiments described above. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and input / output interfaces for input and output. The server 900 may also include other components for implementing device functions, which will not be described in detail here.
[0208] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions. The instructions can be executed by a processor of a terminal or a processor of a server to implement the video editing methods provided in the above-mentioned various method embodiments. In some embodiments, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0209] In an exemplary embodiment, a computer program product is further provided, including a computer program / instruction, which implements the video editing method provided by the above-mentioned various method embodiments when executed by a processor.
[0210] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0211] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A video editing method, characterized in that: The method comprises: Displaying a first video to be edited in an editing interface, where the first video is obtained by fusing at least two sub-videos, and a same frame in the first video includes frames of the at least two sub-videos; In response to an application instruction for a target tutorial video in the editing interface, obtaining editing operation information associated with the target tutorial video, wherein the target tutorial video is used to guide an editing process for adding a video special effect to at least one sample sub-video in a sample video, the editing operation information including an editing operation performed during the editing process for adding the video special effect to the at least one sample sub-video, a first time point corresponding to the editing operation in the sample video, and an operation parameter corresponding to the editing operation; Determining, based on the duration of the sample video and the duration of the first video, a second time point corresponding to the first time point in the first video; When the interval between the second time point and the transition time point in the first video is greater than the first time length, at the second time point of the first video, the editing operation and corresponding operation parameters are applied to edit the target sub-video in the first video to obtain a second video, and the target sub-video corresponds to the sample sub-video.
2. The method according to claim 1, characterized in that The clipping operation information includes multiple clipping operations and operation parameters corresponding to each clipping operation; the method further includes: According to the timing of the multiple editing operations in the editing operation information, each editing operation and the corresponding operation parameters are applied in sequence to edit the target sub-video to obtain the second video.
3. The method according to claim 1, characterized in that The method further comprises: When the interval between the second time point and the transition time point is not greater than the first time point, the editing operation and corresponding operation parameters are applied at the transition time point of the first video to edit the target sub-video.
4. The method according to claim 1, wherein Applying the editing operation and corresponding operation parameters to edit the target sub-video in the first video at the second time point of the first video includes: Determine a similarity between a first video frame and a second video frame in the first video, where the first video frame is a video frame corresponding to the second time point, and the second video frame is a video frame of the first video within a second time length after the second time point; When the similarity is less than a similarity threshold, the target sub-video is edited by applying the editing operation and corresponding operation parameters at the second time point of the first video.
5. The method according to claim 4, characterized in that After determining the similarity between the first video frame and the second video frame in the first video, the method further includes: If the similarity is not less than the similarity threshold, determining a third time point in the first video, where the third time point is a time point corresponding to a video frame in the first video frame that is subsequent to the second video frame and has a similarity with the first video frame that is less than the similarity threshold; At the third time point of the first video, the editing operation and corresponding operation parameters are applied to edit the target sub-video.
6. The method according to claim 1, characterized in that The clipping operation information includes a video sequence number corresponding to the clipping operation; and the method further includes: Apply the editing operation and corresponding operation parameters to edit the target sub-video corresponding to the video sequence number in the first video frame to obtain the second video.
7. The method according to any one of claims 1 to 6, characterized in that The step of obtaining editing operation information associated with the target tutorial video in response to an application instruction for the target tutorial video in the editing interface includes: In response to a tutorial video import instruction in the editing interface, obtaining the imported target tutorial video; The editing operation information is identified from the target tutorial video.
8. The method according to claim 7, characterized in that The identifying the clipping operation information from the target tutorial video includes: Performing speech recognition on the audio in the target tutorial video to obtain the clipping operation performed in the target tutorial video and a fourth time point at which the clipping operation is performed; Extracting the video frame corresponding to the fourth time point from the target tutorial video; Image recognition is performed on the extracted video frames to obtain operation parameters corresponding to the editing operation.
9. A video editing device, characterized in that: The device comprises: A display unit is configured to display a first video to be edited in an editing interface, where the first video is obtained by fusing at least two sub-videos, and a same frame in the first video includes frames of the at least two sub-videos; an acquisition unit configured to, in response to an application instruction to a target tutorial video in the editing interface, acquire editing operation information associated with the target tutorial video, wherein the target tutorial video is used to guide an editing process of adding a video special effect to at least one sample sub-video in a sample video, the editing operation information including an editing operation performed during the editing process of adding the video special effect to the at least one sample sub-video, a first time point corresponding to the editing operation in the sample video, and an operation parameter corresponding to the editing operation; The editing unit is configured to determine the second time point corresponding to the first time point in the first video based on the duration of the sample video and the duration of the first video; when the interval between the second time point and the transition time point in the first video is greater than the first duration, at the second time point of the first video, apply the editing operation and corresponding operation parameters to edit the target sub-video in the first video to obtain a second video, wherein the target sub-video corresponds to the sample sub-video.
10. An electronic device, characterized in that: The electronic device comprises: one or more processors; a memory for storing program code executable by the processor; The processor is configured to execute the program code to implement the video editing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the video editing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Video editing method and device
CN114268748A