Video editing method, device, computing equipment and storage medium
By identifying and utilizing key positions and transition positions in the video, segmenting and splicing video clips, the problem of incoherence of the visual and visual sense of editing videos in the prior art is solved, and a higher visual and visual coherence and user experience are achieved.
Patent Information
- Application Number
- CN202111679091.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The existing edited videos generated by artificial intelligence-based video editing methods have problems of incoherence in the viewing experience, which affects the user's viewing experience.
By identifying the key positions and transition positions in the original video, split into multiple video clips and splicing them according to them to generate the target video. This method determines the transition position by calculating the similarity between frame images and adjusts the start and end segmentation points to ensure the integrity of the clip.
It improves the visual coherence of automatically generated edited videos, allowing users to experience higher integrity and coherence when watching edited videos, thereby improving users' viewing experience.
Smart Images

Figure CN114302174B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a video editing method, apparatus, computing device and storage medium. Background Art
[0002] In actual application scenarios, for videos with long playback time, the video can usually be edited to generate a relatively short video clip containing the core video content. For example, under the main film of talk show variety shows on Internet video websites, some video clips of laugh points edited from the main film are usually released for viewers to quickly watch the full laugh point clips.
[0003] The manual editing method is used to generate the edited video, which not only results in high labor costs, but also generally low efficiency. Therefore, artificial intelligence (AI) editing can be used to automatically generate edited videos. However, the edited videos generated based on AI usually have the problem of incoherent perception, such as a character being cut off before finishing a sentence in the edited video, which affects the user's viewing experience of the edited video. Summary of the invention
[0004] The embodiments of the present application provide a video editing method, apparatus, computing device and storage medium, which are intended to improve the visual consistency of automatically generated edited videos, thereby improving the user's viewing experience of the edited videos.
[0005] In a first aspect, an embodiment of the present application provides a video editing method, the method comprising:
[0006] Get the original video to be processed;
[0007] Identifying a plurality of key positions and transition positions in the original video, wherein the key positions are used to indicate video segments in the original video;
[0008] According to the multiple key positions and the transition positions, a plurality of video clips are obtained from the original video;
[0009] Based on the multiple video clips, a target video is spliced together, and the playback time of the target video is shorter than the playback time of the original video.
[0010] In a possible implementation, the identifying the transition position in the original video includes:
[0011] Calculating the similarity between a first frame image and a second frame image adjacent to each other in the original video;
[0012] When the similarity between the first frame image and the second frame image is less than a preset threshold, the position of the first frame image or the second frame image in the original video is determined as the transition position.
[0013] In a possible implementation manner, the step of obtaining a plurality of video segments from the original video according to the plurality of key positions and the transition positions includes:
[0014] Determine, according to a plurality of key positions in the original video, a starting segmentation point and an ending segmentation point corresponding to a plurality of candidate video segments in the original video;
[0015] Determine whether a plurality of first video image frames in the original video whose distance from a starting segmentation point of a target candidate video segment does not exceed a first preset distance include a transition position, and whether a plurality of second video image frames in the original video whose distance from an ending segmentation point of the target candidate video segment does not exceed a second preset distance include a transition position, wherein the target candidate video segment is any candidate video segment among the plurality of candidate video segments;
[0016] When the multiple frames of the first video images include transition positions, and / or the multiple frames of the second video images include transition positions, the target candidate video segments are cut from the original video according to the transition positions in the multiple frames of the first video images and / or the transition positions in the multiple frames of the second video images.
[0017] In a possible implementation, the original video is a video of the first type, and the key position in the original video is identified by audio features in the original video.
[0018] In a possible implementation manner, the audio content corresponding to the key position in the original video is laughter and / or applause, and the identifying multiple key positions in the original video includes:
[0019] Inputting the original video into an artificial intelligence (AI) model to obtain a plurality of key positions in the original video output by the AI model, wherein the AI model is pre-trained using sample videos with laughter marks and / or applause marks;
[0020] Alternatively, the audio data in the original video is matched with the audio data corresponding to the laughter and / or applause by voiceprint features to obtain the multiple key positions of voiceprint feature matching.
[0021] In a possible implementation, the original video is a video of the second type, and the key position in the original video is identified by image features in the original video.
[0022] In a possible implementation manner, the identifying a plurality of key positions in the original video includes:
[0023] Determining a plurality of initial key positions from the original video;
[0024] The multiple initial key positions are adjusted by using optical character recognition technology to obtain the multiple key positions, so that each of the key positions is a position where subtitles start to be displayed or where subtitles end to be displayed.
[0025] In a second aspect, an embodiment of the present application further provides a video editing device, the device comprising:
[0026] An acquisition module, used to acquire the original video to be processed;
[0027] A position identification module, used to identify a plurality of key positions and transition positions in the original video, wherein the key positions are used to indicate video segments in the original video;
[0028] A segmentation module, used for segmenting the original video to obtain a plurality of video segments according to the plurality of key positions and the transition positions;
[0029] The splicing module is used to splice the multiple video clips to obtain a target video, wherein the playing time of the target video is shorter than the playing time of the original video.
[0030] In a possible implementation, the location identification module includes:
[0031] A calculation unit, used for calculating the similarity between a first frame image and a second frame image adjacent to each other in the original video;
[0032] The first determining unit is used to determine the position of the first frame image or the second frame image in the original video as the transition position when the similarity between the first frame image and the second frame image is less than a preset threshold.
[0033] In a possible implementation, the segmentation module includes:
[0034] A second determining unit, configured to determine, according to a plurality of key positions in the original video, a starting segmentation point and an ending segmentation point corresponding to a plurality of candidate video segments in the original video;
[0035] a third determining unit, configured to determine whether a plurality of first video image frames in the original video whose distance from a starting segmentation point of a target candidate video segment does not exceed a first preset distance include a transition position, and whether a plurality of second video image frames in the original video whose distance from an ending segmentation point of the target candidate video segment does not exceed a second preset distance include a transition position, wherein the target candidate video segment is any candidate video segment among the plurality of candidate video segments;
[0036] A segmentation unit is used to segment the target candidate video segment from the original video according to the transition positions in the multiple frames of the first video images and / or the transition positions in the multiple frames of the second video images when the multiple frames of the first video images include transition positions and / or the multiple frames of the second video images include transition positions.
[0037] In a possible implementation, the original video is a video of the first type, and the key position in the original video is identified by audio features in the original video.
[0038] In a possible implementation manner, the audio content corresponding to the key position in the original video is laughter and / or applause, and the position identification module includes:
[0039] A first recognition unit, configured to input the original video into an artificial intelligence (AI) model to obtain a plurality of key positions in the original video output by the AI model, wherein the AI model is pre-trained using sample videos with laughter marks and / or applause marks;
[0040] or,
[0041] The second recognition unit is used to match the audio data in the original video with the audio data corresponding to the laughter and / or applause based on the voiceprint features to obtain the multiple key positions of the voiceprint feature matching.
[0042] In a possible implementation, the original video is a video of the second type, and the key position in the original video is identified by image features in the original video.
[0043] In a possible implementation, the location identification module includes:
[0044] A fourth determining unit, configured to determine a plurality of initial key positions from the original video;
[0045] The adjusting unit is used to adjust the multiple initial key positions by using optical character recognition technology to obtain the multiple key positions, so that each of the key positions is a position where the subtitles start to be displayed or where the subtitles end to be displayed.
[0046] In a third aspect, an embodiment of the present application further provides a computing device, which may include a processor and a memory:
[0047] The memory is used to store computer programs;
[0048] The processor is used to execute the method described in the first aspect and any one of the embodiments of the first aspect according to the computer program.
[0049] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above-mentioned first aspect and any one of the implementation methods of the first aspect.
[0050] In the above-mentioned implementation method of the embodiment of the present application, the original video to be processed is obtained, and multiple key positions and transition positions in the original video are identified, and the key positions are used to indicate the video segments in the original video, so that multiple video segments can be cut from the original video according to the multiple key positions and transition positions, and the target video can be obtained by splicing the multiple video segments, wherein the playback time of the generated target video is less than the playback time of the original video.
[0051] Since the transition position in the original video usually indicates that a continuous video content ends at the transition position, when generating the target video according to the transition position, the video content of each clip in the target video at the starting position and / or the ending position can usually be relatively complete. In this way, when the user watches the target video, he usually thinks that the viewing experience is high because of the completeness of the video content, thereby improving the user's experience of watching the edited target video. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0053] Figure 1 This is a schematic diagram of an exemplary application scenario in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of a video editing method in an embodiment of the present application;
[0055] Figure 3 This is a schematic diagram of the structure of a video editing device in an embodiment of the present application;
[0056] Figure 4A schematic diagram of the hardware structure of a computing device in an embodiment of the present application. DETAILED DESCRIPTION
[0057] See also Figure 1 , is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 In the application scenario shown, the client 101 may be in communication connection with the computing device 102. Furthermore, the client 101 may receive a video provided by a user (such as a video editor) and send it to the computing device 102; the computing device 102 is used to perform AI editing on one or more received videos, generate an edited video, and present the edited video to the user through the client 101.
[0058] The computing device 102 refers to a device with data processing capabilities, such as a terminal, a server, etc. The client 101 can be applied to a physical device independent of the computing device 102. For example, when the computing device 102 is implemented by a server, the client 101 can be run on a user terminal or other device on the user side. Alternatively, the client 101 can also be run on the computing device 102.
[0059] In actual application, the video clips generated by the computing device 102 based on the preset AI algorithm usually have the problem of incoherent perception, which will affect the user's perception of the video clips. For example, assuming that the original video includes a dialogue, in which character A asks: "Have you not been to the gym recently?" Character B answers: "No", and the computing device 102 may start to cut off at the position where character A finishes speaking based on the AI algorithm, then the video clips obtained by the editing only include the answer content of character B ("No"), which makes the user feel confused when watching the content of character B's speech "No" in the video clips, that is, they do not know what character B answered "No" to. For another example, character A said many sentences in succession, and the computing device 102 only intercepted the video clips of some sentences said by character A based on the AI algorithm, resulting in obvious omissions in the content of character A's speech.
[0060] Based on this, an embodiment of the present application provides a video editing method, which aims to improve the visual coherence of the generated edited video, thereby improving the user's viewing experience of the edited video. In specific implementation, the computing device 102 obtains the original video to be processed, and identifies multiple key positions and transition positions in the original video, the key positions are used to indicate the video segments in the original video, so that the computing device 102 can cut the original video according to the multiple key positions and transition positions to obtain multiple video segments, and splice the multiple video segments to obtain a target video, wherein the playback time of the generated target video is less than the playback time of the original video.
[0061] Since the transition position in the original video usually indicates that a continuous video content ends at the transition position, when generating the target video according to the transition position (i.e. generating the aforementioned clipped video), the video content at the starting position and / or the ending position of each clipped segment in the target video can usually be relatively complete. In this way, when the user watches the target video, he or she will usually think that the viewing experience is high because of the completeness of the video content, thereby improving the user's experience of watching the clipped target video.
[0062] It should be noted that the video in this embodiment refers to a video having both image and audio content, that is, a video file includes not only a plurality of continuous frames of video images, but also audio data synchronized with the video images.
[0063] Understandably, Figure 1 The architecture of the application scenario shown is only an example provided by the embodiment of the present application. In actual application, the embodiment of the present application can also be applied to other applicable scenarios, such as the computing device 102 can automatically obtain one or more videos from the Internet, and automatically generate a clip video corresponding to each video through the above implementation method. In short, the embodiment of the present application can be applied to any applicable scenario, and is not limited to the above scenario example.
[0064] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, various non-limiting implementation methods in the embodiments of the present application are exemplarily described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0065] See also Figure 2 , Figure 2 A schematic diagram of a video editing method in an embodiment of the present application is shown. The method can be applied to Figure 1 The application scenarios shown in the figure may also be applied to other applicable application scenarios. Figure 1 The application scenario shown is used as an example for explanation. The method may specifically include:
[0066] S201: Obtain the original video to be processed.
[0067] For the convenience of distinction and description, in this embodiment, the video to be edited is referred to as the original video, and the video generated by editing is referred to as the target video.
[0068] In a possible implementation, the original video may be provided by the user to the computing device 102. Specifically, the client 101 may present a video import interface to the user, so that the user may import the original video into the client 101 by performing corresponding operations on the video import interface. Then, the client 101 may transmit the original video provided by the user to the computing device 102 through the network connection between the client 101 and the computing device 102.
[0069] In another possible implementation, the original video may also be obtained from the Internet by the computing device 102. For example, the user may send an instruction to generate a clipped video to the computing device 102 through the client 101, so that the computing device 102 may download a specific type of video from the Internet based on the instruction, such as downloading a talk show type video or a crosstalk type video, downloading an observation type variety show video, etc., and use these videos as original videos so as to perform clipping processing on these original videos later.
[0070] It is worth noting that the original video acquired by the computing device 102 may be one video or multiple videos. For example, the computing device 102 may generate a target video by editing multiple original videos, etc., and this embodiment does not limit this. For ease of understanding and explanation, this embodiment takes the original video as one video as an example for explanation. When the original video includes multiple videos, its implementation is similar to this embodiment, the difference being that the multiple video clips subsequently spliced are derived from multiple different original videos.
[0071] S202: Identify multiple key positions and transition positions in the original video, where the key positions are used to indicate video segments in the original video.
[0072] The key position refers to the position of the video segment in the original video. When editing the original video, the starting segmentation point and the ending segmentation point of the edited video segment can be determined based on the key position. In addition, for different types of original videos, different types of positions can be used as key positions.
[0073] In one example, the computing device 102 may identify the key position through the audio features in the original video. For example, when the original video is a first type of video, such as a talk show, crosstalk or other funny type of video, in actual application scenarios, video content with laughter and / or applause is usually more attractive to users, so the computing device 102 may determine the position in the original video where the audio content is laughter and / or applause as the key position.
[0074] In one implementation of identifying key positions, the computing device 102 may use an AI model to identify multiple key positions in the original video. In a specific implementation, the computing device 102 may be pre-configured with an AI model, and the AI model may be pre-trained with video samples marked with "laughter" and / or "applause", so that the trained AI model may identify "laughter" and / or "applause" in the video. Therefore, for the first type of original video, the computing device 102 may input the original video into the trained AI model to obtain multiple key positions in the original video output by the AI model.
[0075] In another embodiment of identifying key positions, the computing device 102 may determine multiple key positions in the original video by comparing voiceprint features. Specifically, the computing device 102 may obtain audio data with "laughter" and / or "applause" content, and extract the voiceprint features of the "laughter" and / or "applause". Then, the computing device 102 may compare the voiceprint features with the voiceprint features corresponding to the audio data in the original video section by section, and determine the audio data positions with consistent voiceprint features as key positions, thereby determining multiple key positions in the original video.
[0076] It should be noted that the above-mentioned implementation methods of determining the key positions are only some exemplary explanations. In actual application, the computing device 102 may also determine the key positions in the original video in other ways, and this embodiment does not limit this.
[0077] In another example, the computing device 102 may identify the key position through image features in the original video. For example, when the original video is a second type of video, such as an observation variety show video, the position where the subtitle of one of the subtitles of the original video starts to be displayed and / or the subtitle display ends may be determined as the key position. Of course, in other embodiments, the key position may also be other possible implementation methods, which are not limited in this embodiment.
[0078] In a possible implementation, the computing device 102 can determine multiple initial key positions from the original video, and adjust the multiple initial key positions through optical character recognition (OCR) technology to obtain multiple key positions, so that each key position is the position where the subtitles start to be displayed or the subtitles end to be displayed. For example, the computing device 102 can randomly select two positions as the starting position and the ending position of a video according to the playback time (such as 30 seconds, etc.), and obtain two initial key positions corresponding to the video. Then, the computing device 102 can use the OCR technology to identify the subtitles in the video image at the starting position, and use the starting display position of the subtitles in the original video as the key position. In addition, the computing device 102 can also use the OCR technology to identify the subtitles in the video image at the ending position, and use the ending display position of the subtitles in the original video as the key position, etc. In this way, the computing device 102 can determine the key positions corresponding to multiple video clips respectively in the above manner.
[0079] The transition position refers to the position where the character type in the original video switches, such as the position where the performer switches to the audience or guest seats, or the position where the performer switches to the scene that does not include the character, which may be due to the switching of the shooting lens and the switching of the character type. In actual application, when the character type in the original video switches, it usually means that a section of video content related to the character ends temporarily, such as when an argument / point of the speech by the character ends, the shooting lens can usually be switched to the auditorium to shoot the reaction (such as laughing, nodding, shaking the head, etc.) made by the audience to the content of the character's speech. Therefore, when the computing device 102 edits the original video, the boundary point of the video clip edited can be determined by the transition position. Of course, in other possible embodiments, the transition position can also be the position where other information in the original video switches, such as the switching of scenes, etc., and this embodiment does not limit this.
[0080] In a possible implementation, the computing device 102 can determine the transition position by comparing the difference between two adjacent frames of images. When specifically implemented, the computing device 102 can calculate the similarity between the adjacent first frame image and the second frame image in the original video, and when the display degree between the first frame image and the second frame image is less than a preset threshold, the computing device 102 can determine the position of the first frame image or the second frame image in the original video as the transition position. For example, the first frame image is an image obtained by shooting the performer, and the second frame image is an image obtained by shooting the audience. Among them, the computing device 102 can determine all the transition positions in the original video by traversing the calculation method, such as the computing device 102 can determine the transition point by comparing the image similarity between two consecutive adjacent video images in sequence. Or, the computing device 102 can perform similarity calculation on multiple frames near the key position to determine whether the transition position is included near the key position.
[0081] Exemplarily, when calculating the similarity between two frames of images, the computing device 102 can first reduce the two frames of images to a size of 8 pixels * 8 pixels, that is, each frame of image after reduction has 64 pixels. The purpose of this step is to remove the details of the image, retain only the basic information such as structure / brightness in the image, and reduce the subsequent calculation amount. Then, the computing device 102 can grayscale the two frames of images after reduction, and calculate the average grayscale value of each frame of image (i.e., the average value of 64 grayscale values in each frame of image). Next, the computing device 102 compares the grayscale value of each pixel in each frame of image with the average grayscale value corresponding to the frame of image, and when the grayscale value of the pixel is greater than or equal to the average grayscale value, the pixel is marked as 1, and when the grayscale value of the pixel is less than the average grayscale value, the pixel is marked as 0, so that the 64 pixels in each frame of image are combined according to a unified rule, and a 64-bit hash value (composed of 1 and 0) can be generated, which can be used as the fingerprint of the frame of image. In this way, the computing device 102 can compare the 64-bit hash values corresponding to the two frames of images. When the number of bits that differ between the two hash values exceeds a preset value (such as 5), the computing device 102 determines that the two frames of images are less similar, and when the number of bits that differ between the two hash values does not exceed the preset value, the computing device 102 determines that the two frames of images are more similar. In actual applications, the computing device 102 can also determine the similarity between the two frames of images in other ways, which is not limited in this embodiment.
[0082] S203: According to the identified multiple key positions and transition positions, a plurality of video segments are obtained from the original video.
[0083] In this embodiment, the computing device 102 may segment the original video according to multiple key positions and transition positions to obtain multiple video segments.
[0084] In a possible implementation, the computing device 102 may first determine the starting segmentation points and the ending segmentation points corresponding to the multiple candidate video segments in the original video based on the multiple key positions in the original video. The starting segmentation point refers to the starting point of the candidate video segment, and the video image at the starting segmentation point is the first frame image of the candidate video segment. Correspondingly, the ending segmentation point refers to the ending point of the candidate video segment, and the video image at the ending segmentation point is the last frame image of the candidate video segment. For example, when the original video is a video of the first type, the computing device 102 may determine the playback position at the first 15 (or other numerical value) seconds of the key position as the starting segmentation point of the candidate video segment, and determine the playback position at the last 1 (or other numerical value) second of the key position as the ending segmentation point of the candidate video segment.
[0085] Then, the computing device 102 can determine whether the multiple frames of the first video image whose distance from the starting segmentation point of the target candidate video segment in the original video does not exceed the first preset distance include the transition position, and whether the multiple frames of the second video image whose distance from the ending segmentation point of the target candidate video segment in the original video does not exceed the second preset distance include the transition position, and the target candidate video segment is any candidate video segment among the above-mentioned multiple candidate video segments. Wherein, the distance from the starting segmentation point can be characterized as the number of video frames included between the position of the video image in the original video and the starting and ending segmentation points (or the playback duration corresponding to the number of video frames, etc.), and the larger the number of video frames, the farther the representation distance is, and the smaller the number of video frames, the closer the representation distance is. Correspondingly, the first preset distance, for example, can be a preset number of video frames (or the playback duration corresponding to the number of video frames, etc.), such as 450 consecutive frames of images, etc. Similarly, the distance from the ending segmentation point can be characterized as the number of video frames included between the position of the video image in the original video and the starting and ending segmentation points, or characterized as the playback duration corresponding to the number of video frames, etc. Correspondingly, the second preset distance may be a preset number of video frames, or a playback duration corresponding to these video frames, etc. The first preset distance may be the same as or different from the second preset distance.
[0086] When the transition position is included in the multi-frame first video image, and / or the transition position is included in the multi-frame second video image, the computing device 102 can cut the target candidate video segment from the original video according to the transition position in the multi-frame first video image and / or the transition position in the multi-frame second video image. Specifically, when the transition position is included in the multi-frame first video image, the computing device 102 can update the starting segmentation point of the target candidate video segment to the transition position in the multi-frame first video image, and cut the target candidate video segment from the original video according to the transition position and the termination segmentation point of the target candidate video segment. When the transition position is included in the multi-frame second video image, the computing device 102 can update the termination segmentation point of the target candidate video segment to the transition position in the multi-frame second video image, and cut the target candidate video segment from the original video according to the transition position and the starting segmentation point of the target candidate video segment. When the multiple frames of the first video image and the multiple frames of the second video image both include transition positions, the computing device 102 may update the starting segmentation point of the target candidate video segment to the transition position in the multiple frames of the first video image, and update the ending segmentation point of the target candidate video segment to the transition position in the multiple frames of the second video image, and cut the target candidate video segment from the original video according to the two transition positions. In this way, the computing device 102 may cut and obtain multiple video segments according to multiple key positions and transition positions.
[0087] Since the computing device 102 can adjust the starting segmentation point and / or the ending segmentation point of the target candidate video segment according to the transition position, the video segment obtained by editing based on the transition position can usually include relatively complete video content. In this way, when the user watches the video segment, the problem of low visual coherence can be avoided. For example, assuming that the original video includes a conversation about character A and character B, character A asks: "Have you not been to the gym recently?" Character B replies: "No", and after character B finishes speaking, a camera transition occurs. The computing device 102 can determine the ending segmentation point of the video segment as after character B says "no" according to the identified transition position. In this way, when the user subsequently watches the video segment, since the video segment includes the conversation content of character A and character B, the visual coherence of the video segment is relatively high.
[0088] S204: Based on the multiple video clips, a target video is obtained by splicing, and the playing time of the target video is shorter than the playing time of the original video.
[0089] After the original video is edited to include multiple video clips, the computing device 102 may splice the multiple video clips to generate a target video. The computing device 102 may splice the video clips in the order in which the video clips are played in the original video, or may splice the video clips in other orders, which is not limited in this embodiment.
[0090] In actual application, the playback time of the target video generated by editing has certain restrictions. For example, for an original video with a playback time of 2 hours, the playback time of the target video generated by editing it can be no more than 10 minutes. Therefore, the playback time of the target video generated by video editing is usually less than the playback time of the original video.
[0091] Furthermore, if the total playing time corresponding to the multiple video segments obtained by segmentation is greater than the maximum playing time of the target video to be generated, the computing device 102 selects some video segments from the multiple video segments to generate the target video. For example, the computing device 102 may select some video segments with relatively longer playing time from the multiple video segments to generate the target video, or may randomly select some video segments to generate the target video, etc., which is not limited in this embodiment.
[0092] In this embodiment, since the transition position in the original video usually indicates that a continuous video content ends at the transition position, when generating the target video according to the transition position, the video content at the starting position and / or the ending position of each clip in the target video can usually be relatively complete. In this way, when the user watches the target video, he or she usually thinks that the viewing experience is high because of the completeness of the video content, thereby improving the user's experience of watching the edited target video.
[0093] To facilitate understanding and explanation, the following examples are taken as follows: the original videos are talk show variety videos and observation variety videos.
[0094] After acquiring the talk show variety video, the computing device 102 can identify the location of laughter and / or applause in the talk show video through the AI model, or determine the key location of laughter and / or applause in the talk show video through voiceprint feature comparison. Then, for each key location, the computing device 102 can further determine the playback location 15 seconds before the key location (i.e., the starting segmentation point) and the playback location 3 seconds after the key location (the ending segmentation point), and identify whether the multiple frames of the first video image between the key location and the playback location 15 seconds before include the transition location, and identify whether the multiple frames of the second video image between the key location and the playback location 3 seconds after include the transition location. If the multiple frames of the first video image include a transition position, the computing device 102 can adjust the starting segmentation point of the video clip to the transition position, and / or, if the multiple frames of the second video image include a transition position, adjust the ending segmentation point of the video clip transition position to the transition position, thereby cutting out the video clip from the original video based on the adjusted starting segmentation point and / or ending segmentation point. In this way, for multiple key positions, the computing device 102 can cut out multiple video clips including laughter and / or applause. Finally, the computing device 102 can splice the multiple video clips cut out to generate a talk show video collection, that is, the edited video desired by the user.
[0095] After acquiring the observational variety show video, the computing device 102 can extract a candidate video segment of a preset duration (such as 30 seconds of playback duration) from the observational variety show video. The starting segmentation point and the ending segmentation point of the candidate video segment can be preliminarily determined through OCR technology. Specifically, through OCR technology, the position where a subtitle starts to be displayed is used as the starting segmentation point of the candidate video segment, and the position where another subtitle ends to be displayed is used as the ending segmentation point of the candidate video segment, and the playback duration corresponding to the multiple frames of video images between the starting segmentation point and the ending segmentation point is close to the preset duration. Then, the computing device 102 can identify whether the transition position is included in the multi-frame first video image whose distance from the starting segmentation point in the observation class variety video does not exceed the first preset distance (such as 90 frames of video images, etc.), and whether the transition position is included in the multi-frame first video image whose distance from the termination segmentation point in the observation class variety video does not exceed the second preset distance (such as 60 frames of video images, etc.), and, if the transition position is included in the multi-frame first video image, the computing device 102 can adjust the starting segmentation point of the video clip to the transition position, and / or, if the transition position is included in the multi-frame second video image, the termination segmentation point of the video clip transition position is adjusted to the transition position, thereby cutting out the video clip from the original video based on the adjusted starting segmentation point and / or termination segmentation point. In this way, multiple video clips can be cut out from the observation class variety video. Finally, the computing device 102 can splice the multiple video clips cut out to generate a clip video of the observation class variety video.
[0096] In addition, the embodiment of the present application also provides a video editing device. Figure 3 , Figure 3 The schematic diagram of the structure of a video editing device in an embodiment of the present application is shown. The video editing device 300 includes:
[0097] An acquisition module 301 is used to acquire the original video to be processed;
[0098] A position identification module 302, used to identify a plurality of key positions and transition positions in the original video, wherein the key positions are used to indicate video segments in the original video;
[0099] A segmentation module 303, configured to segment the original video into a plurality of video segments according to the plurality of key positions and the transition positions;
[0100] The splicing module 304 is used to splice the multiple video clips to obtain a target video, wherein the playing time of the target video is shorter than the playing time of the original video.
[0101] In a possible implementation, the location identification module 302 includes:
[0102] A calculation unit, used for calculating the similarity between a first frame image and a second frame image adjacent to each other in the original video;
[0103] The first determining unit is used to determine the position of the first frame image or the second frame image in the original video as the transition position when the similarity between the first frame image and the second frame image is less than a preset threshold.
[0104] In a possible implementation, the segmentation module 303 includes:
[0105] A second determining unit, configured to determine, according to a plurality of key positions in the original video, a starting segmentation point and an ending segmentation point corresponding to a plurality of candidate video segments in the original video;
[0106] a third determining unit, configured to determine whether a plurality of first video image frames in the original video whose distance from a starting segmentation point of a target candidate video segment does not exceed a first preset distance include a transition position, and whether a plurality of second video image frames in the original video whose distance from an ending segmentation point of the target candidate video segment does not exceed a second preset distance include a transition position, wherein the target candidate video segment is any candidate video segment among the plurality of candidate video segments;
[0107] A segmentation unit is used to segment the target candidate video segment from the original video according to the transition positions in the multiple frames of the first video images and / or the transition positions in the multiple frames of the second video images when the multiple frames of the first video images include transition positions and / or the multiple frames of the second video images include transition positions.
[0108] In a possible implementation, the original video is a video of the first type, and the key position in the original video is identified by audio features in the original video.
[0109] In a possible implementation manner, the audio content corresponding to the key position in the original video is laughter and / or applause, and the position identification module 302 includes:
[0110] A first recognition unit, configured to input the original video into an artificial intelligence (AI) model to obtain a plurality of key positions in the original video output by the AI model, wherein the AI model is pre-trained using sample videos with laughter marks and / or applause marks;
[0111] or,
[0112] The second recognition unit is used to match the audio data in the original video with the audio data corresponding to the laughter and / or applause based on the voiceprint features to obtain the multiple key positions of the voiceprint feature matching.
[0113] In a possible implementation, the original video is a video of the second type, and the key position in the original video is identified by image features in the original video.
[0114] In a possible implementation, the location identification module 302 includes:
[0115] A fourth determining unit, configured to determine a plurality of initial key positions from the original video;
[0116] The adjusting unit is used to adjust the multiple initial key positions by using optical character recognition technology to obtain the multiple key positions, so that each of the key positions is a position where the subtitles start to be displayed or where the subtitles end to be displayed.
[0117] It should be noted that the information interaction, execution process, etc. between the modules and units of the above-mentioned device are based on the same concept as the method embodiment in the embodiments of the present application, and the technical effects they bring are the same as those of the method embodiment in the embodiments of the present application. For specific contents, please refer to the description in the method embodiment shown in the aforementioned embodiments of the present application, and will not be repeated here.
[0118] In addition, the present application embodiment also provides a computing device. Figure 4 , Figure 4 A schematic diagram of the hardware structure of a computing device in an embodiment of the present application is shown. The computing device 400 may include a processor 401 and a memory 402.
[0119] Wherein, the memory 402 is used to store computer programs;
[0120] The processor 401 is configured to execute the following steps according to the computer program:
[0121] Get the original video to be processed;
[0122] Identifying a plurality of key positions and transition positions in the original video, wherein the key positions are used to indicate video segments in the original video;
[0123] According to the multiple key positions and the transition positions, a plurality of video clips are obtained from the original video;
[0124] Based on the multiple video clips, a target video is spliced together, and the playback time of the target video is shorter than the playback time of the original video.
[0125] In a possible implementation manner, the processor 401 is specifically configured to perform the following steps according to the computer program:
[0126] Calculating the similarity between a first frame image and a second frame image adjacent to each other in the original video;
[0127] When the similarity between the first frame image and the second frame image is less than a preset threshold, the position of the first frame image or the second frame image in the original video is determined as the transition position.
[0128] In a possible implementation manner, the processor 401 is specifically configured to perform the following steps according to the computer program:
[0129] Determine, according to a plurality of key positions in the original video, a starting segmentation point and an ending segmentation point corresponding to a plurality of candidate video segments in the original video;
[0130] Determine whether a plurality of first video image frames in the original video whose distance from a starting segmentation point of a target candidate video segment does not exceed a first preset distance include a transition position, and whether a plurality of second video image frames in the original video whose distance from an ending segmentation point of the target candidate video segment does not exceed a second preset distance include a transition position, wherein the target candidate video segment is any candidate video segment among the plurality of candidate video segments;
[0131] When the multiple frames of the first video images include transition positions, and / or the multiple frames of the second video images include transition positions, the target candidate video segments are cut from the original video according to the transition positions in the multiple frames of the first video images and / or the transition positions in the multiple frames of the second video images.
[0132] In a possible implementation, the original video is a video of the first type, and the key position in the original video is identified by audio features in the original video.
[0133] In a possible implementation manner, the audio content corresponding to the key position in the original video is laughter and / or applause, and the processor 401 is specifically configured to perform the following steps according to the computer program:
[0134] Inputting the original video into an artificial intelligence (AI) model to obtain a plurality of key positions in the original video output by the AI model, wherein the AI model is pre-trained using sample videos with laughter marks and / or applause marks;
[0135] Alternatively, the audio data in the original video is matched with the audio data corresponding to the laughter and / or applause by voiceprint features to obtain the multiple key positions of voiceprint feature matching.
[0136] In a possible implementation, the original video is a video of the second type, and the key position in the original video is identified by image features in the original video.
[0137] In a possible implementation manner, the processor 401 is specifically configured to perform the following steps according to the computer program:
[0138] Determining a plurality of initial key positions from the original video;
[0139] The multiple initial key positions are adjusted by using optical character recognition technology to obtain the multiple key positions, so that each of the key positions is a position where subtitles start to be displayed or where subtitles end to be displayed.
[0140] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above method embodiment.
[0141] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0142] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, in which the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0143] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A video editing method, characterized in that: The method comprises: Get the original video to be processed; Identify multiple key positions and transition positions in the original video, wherein the key positions are used to indicate the starting segmentation points and the ending segmentation points of the video segments in the original video, and the transition positions are positions where the character types in the original video are switched; According to the multiple key positions and the transition positions, a plurality of video clips are obtained from the original video; Based on the multiple video clips, splicing to obtain a target video, wherein the playing time of the target video is shorter than the playing time of the original video; The step of obtaining a plurality of video clips from the original video according to the plurality of key positions and the transition positions includes: Determine, according to a plurality of key positions in the original video, a starting segmentation point and an ending segmentation point corresponding to a plurality of candidate video segments in the original video; Determine whether a plurality of first video image frames in the original video whose distance from a starting segmentation point of a target candidate video segment does not exceed a first preset distance include a transition position, and whether a plurality of second video image frames in the original video whose distance from an ending segmentation point of the target candidate video segment does not exceed a second preset distance include a transition position, wherein the target candidate video segment is any candidate video segment among the plurality of candidate video segments; When the multiple frames of the first video images include transition positions, and / or the multiple frames of the second video images include transition positions, the target candidate video segments are cut from the original video according to the transition positions in the multiple frames of the first video images and / or the transition positions in the multiple frames of the second video images.
2. The method according to claim 1, characterized in that: The identifying the transition position in the original video includes: Calculating the similarity between a first frame image and a second frame image adjacent to each other in the original video; When the similarity between the first frame image and the second frame image is less than a preset threshold, the position of the first frame image or the second frame image in the original video is determined as the transition position.
3. The method according to claim 1, characterized in that The original video is a video of the first type, and the key position in the original video is identified by audio features in the original video.
4. The method according to claim 3, characterized in that: The audio content corresponding to the key position in the original video is laughter and / or applause, and the identifying of the multiple key positions in the original video includes: Inputting the original video into an artificial intelligence (AI) model to obtain a plurality of key positions in the original video output by the AI model, wherein the AI model is pre-trained using sample videos with laughter marks and / or applause marks; Alternatively, the audio data in the original video is matched with the audio data corresponding to the laughter and / or applause by voiceprint features to obtain the multiple key positions of voiceprint feature matching.
5. The method according to claim 1, characterized in that The original video is a video of the second type, and the key position in the original video is identified by image features in the original video.
6. The method according to claim 5, characterized in that The identifying of multiple key positions in the original video includes: Determining a plurality of initial key positions from the original video; The multiple initial key positions are adjusted by using optical character recognition technology to obtain the multiple key positions, so that each of the key positions is a position where subtitles start to be displayed or where subtitles end to be displayed.
7. A video editing device, characterized in that: The device comprises: An acquisition module, used to acquire the original video to be processed; A position recognition module, used to recognize a plurality of key positions and transition positions in the original video, wherein the key positions are used to indicate the starting segmentation point and the ending segmentation point of the video clip in the original video, and the transition positions are positions where the character types in the original video are switched; A segmentation module, used for segmenting the original video to obtain a plurality of video segments according to the plurality of key positions and the transition positions; A splicing module, configured to splice the multiple video clips to obtain a target video, wherein the playing time of the target video is shorter than the playing time of the original video; The segmentation module is specifically used for: Determine, according to a plurality of key positions in the original video, a starting segmentation point and an ending segmentation point corresponding to a plurality of candidate video segments in the original video; Determine whether a plurality of first video image frames in the original video whose distance from a starting segmentation point of a target candidate video segment does not exceed a first preset distance include a transition position, and whether a plurality of second video image frames in the original video whose distance from an ending segmentation point of the target candidate video segment does not exceed a second preset distance include a transition position, wherein the target candidate video segment is any candidate video segment among the plurality of candidate video segments; When the multiple frames of the first video images include transition positions, and / or the multiple frames of the second video images include transition positions, the target candidate video segments are cut from the original video according to the transition positions in the multiple frames of the first video images and / or the transition positions in the multiple frames of the second video images.
8. A computing device, characterized in that The device comprises a processor and a memory: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 6 according to the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Video editing method and device
CN110519655A
Video editing method, device and equipment and storage medium
CN113709561A