Video editing method, device, equipment and medium
By obtaining the speech semantics and shot segmentation of the source video to generate a collection of video clips with complete plots, the problem of inconsistent plots of video clips in the existing technology is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202210499925.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-09
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-05-09
AI Technical Summary
Existing video editing methods are difficult to ensure the plot consistency of video clips, affecting the user's viewing experience.
By obtaining the speech semantics of the source video for segmentation and lens segmentation, a collection of video clips with complete plots is generated, and the collection is used to generate the target video, ensuring that the duration of the target video is shorter than the duration of the source video.
It ensures the integrity of the plot of video clips in automatic video editing and improves user experience.
Smart Images

Figure CN115052188B
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a video editing method, device, equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Video editing refers to the process of cutting and merging certain clips from a longer video to generate a new shorter video. Video editing can be used to obtain the highlight clips in the long video. During the user's browsing process, the highlight clips of the video can be played to the user to attract the user and make the user watch the full video clip.
[0003] However, it is difficult to automatically generate the editing results of a video. For example, in order to determine the highlight segment of a video by editing, the electronic device generates multiple candidate intervals by random enumeration, and then uses an evaluation model to predict the probability value of the video segment in the candidate interval being a highlight segment, and generates the highlight segment of the video according to the probability value of the video segment in the candidate interval being a highlight segment.
[0004] However, this method of determining the interval by random enumeration is difficult to ensure the consistency of the plot of the video clips, which affects the user's viewing experience. Summary of the invention
[0005] The purpose of the present disclosure is to provide a video editing method, apparatus, device, computer-readable storage medium and computer program product to ensure the integrity of video plots in automatic video editing.
[0006] In a first aspect, the present disclosure provides a video editing method, the method comprising:
[0007] Get the source video;
[0008] Segmenting the source video according to the semantics corresponding to the speech in the source video to obtain a first set of video segments, and segmenting the source video by shots to obtain a second set of video segments;
[0009] Obtaining a third video segment set according to the first video segment set and the second video segment set, wherein the video segments in the third video segment set have complete plots;
[0010] A target video is generated using the third video segment set, wherein the duration of the target video is shorter than the duration of the source video.
[0011] In a second aspect, the present disclosure provides a video editing device, characterized in that the device comprises:
[0012] An acquisition module, used to acquire source video;
[0013] A segmentation module, configured to segment the source video according to the semantics corresponding to the speech in the source video to obtain a first set of video segments, and to segment the source video into shots to obtain a second set of video segments;
[0014] a determination module, configured to obtain a third video segment set according to the first video segment set and the second video segment set, wherein the video segments in the third video segment set have complete plots;
[0015] A generating module is used to generate a target video using the third video segment set, wherein the duration of the target video is shorter than the duration of the source video.
[0016] In a third aspect, the present disclosure provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
[0017] In a fourth aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect of the present disclosure.
[0018] In a fifth aspect, the present disclosure provides a computer program product comprising instructions, which, when executed on a device, enables the device to execute the steps of the method described in the first aspect.
[0019] It can be seen from the above technical solutions that the present disclosure has at least the following advantages:
[0020] The electronic device obtains a source video to be edited, segments the source video according to the semantics corresponding to the voice in the source video to obtain a first video clip set, and performs lens segmentation on the source video to obtain a second video clip set. The first video clip set is obtained by segmenting the source video according to the semantics corresponding to the voice, so the video clips in the first video clip set have semantic integrity. The second video clip set is obtained by lens segmentation of the source video, so the video clips in the second video clip set have lens integrity. Then the electronic device obtains a third video clip set according to the first video clip set and the second video clip set, that is, the semantically complete first video clip set and the lens complete second video clip set are combined to obtain a third video clip set in which each video clip has a complete plot. Then the third video clip set is used to generate a target video, wherein the duration of the target video is shorter than the duration of the source video. Since the video clips in the third video clip set have complete plots, the target video generated by using the third video clip set includes one or more complete plots, so that the plot integrity of the video clips in the automatic editing can be guaranteed, thereby improving the user experience.
[0021] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.
[0023] Figure 1 A flowchart of a video editing method provided by an embodiment of the present disclosure;
[0024] Figure 2 A schematic diagram of semantic prediction provided by an embodiment of the present disclosure;
[0025] Figure 3 A schematic diagram of the architecture of a semantic prediction model provided by an embodiment of the present disclosure;
[0026] Figure 4 A schematic diagram of a framework of a highlight evaluation model provided in an embodiment of the present disclosure;
[0027] Figure 5 A schematic diagram of determining a highlight segment provided by an embodiment of the present disclosure;
[0028] Figure 6 A schematic diagram of the structure of a video editing device provided by an embodiment of the present disclosure;
[0029] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0031] First, some technical terms involved in the embodiments of the present application are introduced.
[0032] Video is a media resource that carries rich information. Video can be played by a video player to present dynamic images to users. Dynamic images include continuous images and voice. For videos such as TV series, movies, and news, the images presented when the video is played may include text. The text may be, for example, subtitles, sponsor names, video producer names, background text, etc. The audio presented when the above video is played may include voice and background sound (such as theme songs, interludes, etc.).
[0033] In order to meet user needs, it is usually necessary to edit the video. Video editing refers to the process of generating a new video by cutting and merging source videos. Usually, video editing is highly dependent on manual editing. For example, the highlight segment in the video is determined by automated editing, which usually generates multiple candidate intervals by random enumeration. The probability value of the video segment in the candidate interval being a highlight segment is predicted by the evaluation model, and the corresponding highlight segment is determined according to the probability value. However, this method of randomly determining the video segment interval by random enumeration is difficult to ensure the consistency of the video segment in the plot, which affects the user's viewing experience.
[0034] In view of this, the present application provides a video editing method, which is applied to electronic devices. An electronic device refers to a device with data processing capabilities, such as a server or a terminal. Among them, the terminal includes but is not limited to a smart phone, a tablet computer, a laptop computer, a personal digital assistant (PDA) or a smart wearable device. The server can be a cloud server, such as a central server in a central computing cluster, or an edge server in an edge computing cluster. Of course, the server can also be a server in a local data center. A local data center refers to a data center directly controlled by a user.
[0035] Specifically, the electronic device obtains a source video to be edited, segments the source video according to the semantics corresponding to the voice in the source video to obtain a first video clip set, and performs lens segmentation on the source video to obtain a second video clip set. The first video clip set is obtained by segmenting the source video according to the semantics corresponding to the voice, so the video clips in the first video clip set have semantic integrity. The second video clip set is obtained by lens segmentation of the source video, so the video clips in the second video clip set have lens integrity. Then the electronic device obtains a third video clip set according to the first video clip set and the second video clip set, that is, the semantically complete first video clip set and the lens complete second video clip set are combined to obtain a third video clip set in which each video clip has a complete plot. Then the third video clip set is used to generate a target video, wherein the duration of the target video is shorter than the duration of the source video. Since the video clips in the third video clip set have complete plots, the target video generated by using the third video clip set includes one or more complete plots, so that the plot integrity of the video clips in the automatic editing can be guaranteed, thereby improving the user experience.
[0036] In order to make the technical solution of the present disclosure clearer and easier to understand, the method for aligning text to speech provided by an embodiment of the present disclosure is introduced below by taking an electronic device as an example of a terminal.
[0037] S102: The terminal obtains the source video.
[0038] The source video refers to the video that needs to be edited. In the video editing scenario, the source video is usually a long video, and video editing is required to obtain a shorter portion of the long video. For example, in some scenarios, it is necessary to obtain the highlight segment of the source video through video editing, and the highlight segment can be used to attract users during the user's browsing process, so that the user is interested in watching the full video segment.
[0039] S104: The terminal segments the source video according to the semantics corresponding to the speech in the source video to obtain a first video segment set.
[0040] The semantics corresponding to the speech in the source video is obtained by performing speech recognition on the speech of the source video to obtain speech text, and then obtaining it through a semantic prediction model based on the speech text. The source video is segmented according to the semantics corresponding to the speech in the source video to obtain a first video clip set with a complete plot in terms of speech.
[0041] Specifically, the terminal can perform automatic speech recognition (ASR) on the speech in the source video to obtain speech text. The speech text obtained through ASR recognition only includes text and spaces, where spaces represent pauses in sentences. Therefore, punctuation can be added to the speech text obtained through the semantic prediction model to obtain semantic text.
[0042] The terminal inputs the speech text into the semantic prediction model. The semantic prediction model predicts the type of punctuation to be inserted at each space in the input speech text sequence, that is, for two adjacent speech text sequences, the semantic prediction model determines whether to truncate the two adjacent speech text sequences. When the predicted punctuation is "comma (,)", it means no truncation; when the predicted punctuation is "period (.)", it means truncation.
[0043] like Figure 2 As shown, taking the period as 1 as an example, the semantic prediction model predicts that the probability of a period between "sunshine symbolizes the arrival of all good things" and "in the whistle that belongs to him" is 0.67, the probability of a period between "in the whistle that belongs to him" and "he started his new day" is 0.44, the probability of a period between "he started his new day" and "he likes writing" is 0.58, the probability of a period between "he likes writing" and "although still very immature" is 0.31... The probability of a period between "maybe a little tired" and "but in his dictionary it's all glory" is 0.59, and the probability of a period after the last sequence "but in his dictionary it's all glory" is 1.
[0044] The model architecture of the semantic prediction model can be as follows Figure 3 As shown, two text sequences are input, such as "Sunshine symbolizes the arrival of all good things" and "In his whistle", and the two text sequences are respectively subjected to feature extraction by the language model to obtain feature S1 and feature S2, and then the features are concatenated and input into the classification model, and the classification model is used to predict the punctuation that should be inserted between the two sequences. Among them, the classification model can be composed of two fully connected layers, which are 2n*256 and 256*2 structures respectively, and the loss function of the classification model can be a cross entropy loss function. The language model can be a pre-trained Albert model, and the feature dimension can be 312.
[0045] In the process of training the semantic prediction model, Wikipedia Chinese and People's Daily Chinese corpus can be used as data sets. Specifically, the terminal can split the data set into a training set and a test set, and store the processed data as text pairs by row. Exemplarily, the training set can include 23 million data pairs, and the test set can include 1.5 million data pairs.
[0046] Through the acquired speech text including punctuation, the terminal can determine the semantics corresponding to the speech in the source video, and then segment the source video according to the semantics corresponding to the speech text to obtain a first video segment set. The first video segment set refers to the video segment obtained by segmenting the source video according to the semantics corresponding to the speech, and the sum of the durations of all video segments in the first video segment set is the same as the duration of the source video. The first video segment set can ensure the semantic integrity of the segmentation of the source video.
[0047] Specifically, the terminal performs text recognition on the speech text of the source video and obtains the result {[start i , end i , sent i ]}, where start and end represent the start and end time of the speech text, and sent represents the specific text content. Then the terminal inputs the speech text into the semantic prediction model, and segments the source video according to the semantics output by the semantic prediction model to obtain the first video segment set.
[0048] S106: The terminal performs shot segmentation on the source video to obtain a second video segment set.
[0049] For example, the number of frames of the source video is T, and the video frame sequence corresponding to the source video can be expressed as The terminal then inputs the source video into the shot segmentation model, which divides the source video into N visual shots. Each visual shot may include a start frame subscript begin and an end frame subscript end, and frames with subscripts in the interval [begin, end] all belong to the shot.
[0050] The shot segmentation model refers to a machine learning model that can segment the source video according to the shot transition. When the plot changes, the shot switching is usually performed, so the second video segment set obtained by segmenting the source video through the shot switching can ensure the integrity of the shot. Among them, the second video segment set refers to the video segmented according to the shot switching, and the total duration of all the video segments in the second video segment set is the same as the duration of the source video.
[0051] It should be noted that the execution order of S104 and S106 is not limited in this scheme. The terminal may first segment the source video according to the semantics corresponding to the voice in the source video to obtain a first set of video segments, and then segment the source video into shots to obtain a second set of video segments; the terminal may first segment the source video into shots to obtain a second set of video segments, and then segment the source video according to the semantics corresponding to the voice in the source video to obtain a first set of video segments; or, the terminal may segment the source video according to the semantics corresponding to the voice in the source video to obtain a first set of video segments, and at the same time segment the source video into shots to obtain a second set of video segments.
[0052] S108: The terminal obtains a third video segment set according to the first video segment set and the second video segment set.
[0053] Among them, the video clips in the third video clip set have a complete plot. Specifically, since the first video clip set is obtained by segmenting the source video according to the semantics corresponding to the voice, the video clips in the first video clip set have complete semantics. The second video clip set is obtained by segmenting the source video, so the video clips in the second video clip set have complete shots. However, in some cases, for example, the segmentation of the source video may be inaccurate due to the lack of semantics in the conversation, or in some cases, the shot switching to the scene may cause inaccurate shot segmentation, so it is necessary to combine the first video clip set and the second video clip set to obtain a third video clip set with a complete plot. Therefore, the terminal can correct the boundary of the first video clip according to the video clips in the second video clip set to obtain a corrected third video clip set, and the video clips in the third video clip set have a complete plot.
[0054] For example, the terminal uses the first video segment set as a basis, and adjusts the boundary of the first video segment set through the second video segment set to obtain a third lens set with a more complete plot.
[0055] S110: The terminal generates a target video using the third video segment set.
[0056] Since the video segments in the third video segment set have complete plots, the target video synthesized by the terminal using the video segments in the third video segment set is a target video with one or more complete plots. The duration of the target video is shorter than the duration of the source video, and the target video is one or more segments in the third video segment set.
[0057] In some possible implementations, the target video can be obtained by the scores of the video segments in the third video segment set. Exemplarily, the terminal can input each video segment in the third video segment set into a scoring model, determine the scores of each video segment in the third video segment set by the scoring model, and then determine the first or multiple video segments according to the scores of each video segment, and generate the target video according to the determined one or more video segments.
[0058] For example, when the video editing method in the present solution is used to determine the highlight segment of the source video, the scoring model may be a highlight evaluation model, which is used to score each video segment in the third video segment set to obtain a result that the segment may be a highlight segment. The framework of the highlight evaluation module may be as follows: Figure 4 As shown, the terminal extracts the visual features and audio features of the video clip through a convolutional neural network (CNN). For example, the visual features and audio features can be extracted through vgg and vggish, and then the visual features and audio features are modeled in time series through two independent bidirectional long short-term memory (LSTM) models respectively. The two features are then fused and spliced, and finally the classification is completed through fully connected layers (FC).
[0059] The training data of the scoring model can be an internal dataset that is manually annotated. The dataset can be divided into four parts: games, movies, TV series, and variety shows. First, the video to be annotated is segmented into a set of training video clips with complete plots according to the method of this solution. The annotators perform highlight or non-highlight segmentation at the lens level to obtain the annotated dataset. The dataset can be divided into a training dataset and a test dataset in a ratio of 8:2.
[0060] In some possible implementations, since different shots usually correspond to different durations, each shot with a complete plot needs to be segmented into 5-second segments. During the retraining process, the video frames and audio sequences of the sub-segments in the 5-second video segment are first downsampled, and then the corresponding feature extraction model is used to obtain visual features with dimensions of [5, 7, 7, 512] and audio features with dimensions of [5, 128]. The hidden layer dimensions of the LSTM model can all be 64, and they are all bidirectional LSTMs, so the final fused feature dimensions are [5, 64*4]. The discriminator consists of two fully connected layers, which are reduced from 256 to 64 and then to 2. During the training process, the loss function can be a cross entropy loss function.
[0061] In the process of judging by the scoring model, the terminal divides the video clip with a complete plot into multiple segments according to a compensation of 5 seconds, and then scores each sub-segment through the scoring model. The score of the video clip is the average score of all sub-segments.
[0062] In this way, the terminal can obtain the score of each video segment in the third video segment set through the scoring model. Exemplarily, when the scoring model is a highlight evaluation model, the score of a video clip represents the probability that the video clip is a highlight clip, where 0≤p i ≤ 1. Then, multiple target video segments can be determined according to the score of each video segment, and a target video can be generated according to the multiple target video segments.
[0063] Specifically, the terminal can determine multiple target video segments through dynamic programming according to the scores of each video segment, the duration of each video segment, and the duration of the target video. The terminal can also determine multiple target video segments through a sliding window according to the scores of each video segment, the duration of each video segment, and the duration of the target video.
[0064] Specifically, when the third video clip set includes 5 video clips, in chronological order, the corresponding durations and scores are: video clip 1, 5 minutes, 0.54 points; video clip 2, 3 minutes, 0.3 points; video clip 3, 7 minutes, 0.82 points; video clip 4, 2 minutes, 0.27 points and video clip 5, 3 minutes, 0.32 points. The duration of the target video is 10 minutes.
[0065] Dynamic planning means obtaining the segment with the highest total score within the preset duration according to the duration and score of each video segment. For example, in this example, within the preset duration of 10 minutes, the video segment combinations that meet the preset duration include: video segment 1 + video segment 2, video segment 1 + video segment 4, video segment 1 + video segment 5, video segment 1 + video segment 2 + video segment 4, video segment 1 + video segment 4 + video segment 5, video segment 2 + video segment 3, video segment 2 + video segment 4, video segment 2 + video segment 5, video segment 2 + video segment 4 + video segment 5, video segment 3 + video segment 4, video segment 3 + video segment 5, and video segment 4 + video segment 5. The scores corresponding to the above combinations are: 0.84, 0.81, 0.86, 1.11, 1.13, 1.12, 0.57, 0.62, 0.89, 1.09, 1.14, and 0.59. Therefore, the total score of video segment 3 + video segment 5 is 1.14 (the highest), so video segment 3 and video segment 5 are determined as target video segments, and then the target video is generated based on video segment 3 and video segment 5.
[0066] Sliding window refers to a method of segmenting video clips through continuous video windows, where the video clips are continuous. For example, in this example, the combinations of video clips that meet the preset duration include: video clip 1 + video clip 2, video clip 2 + video clip 3, video clip 3 + video clip 4, and video clip 4 + video clip 5. The scores corresponding to the above combinations are: 0.84, 1.12, 1.09, and 0.59, respectively. Therefore, the total score of video clip 2 + video clip 3 is 1.12 (the highest), so video clip 2 and video clip 3 are determined to be the target video clips, and then the target video is generated based on video clip 2 and video clip 3.
[0067] The terminal may determine the target video segment with the highest total score through dynamic programming according to actual needs, or determine the target video segments with high and continuous comprehensive scores through a sliding window, thereby generating a target video.
[0068] In the scenario where the highlight clips of the source video are determined by video clipping, such as Figure 5As shown, the terminal performs speech recognition on the speech of the source video, and then performs semantic segmentation to obtain a first video segment set, which includes a first video segment 1, a first video segment 2, a first video segment 3, ..., and a first video segment n. The terminal performs shot segmentation on the source video to obtain a second video segment set, which includes a second video segment 1, a second video segment 2, a second video segment 3, ..., and a second video segment m. The terminal determines a third video segment set based on the first video segment set and the second video segment set, which includes a third video segment 1, a third video segment 2, a third video segment 3, ..., and a third video segment x. The third video segment 1 corresponds to plot 1, the third video segment 2 corresponds to plot 2, the third video segment 3 corresponds to plot 3, and the third video segment x corresponds to plot x. The highlight evaluation model is used to evaluate the highlights of the video clips in the third video clip set, and the probability of the video clip being a highlight clip is obtained. For example, the probability that the third video clip 1 is a highlight clip is 0.1, the probability that the third video clip 2 is a highlight clip is 0.3, the probability that the third video clip 3 is a highlight clip is 0.9, and the probability that the third video clip x is a highlight clip is 0.2. Then, the third video clip 3 is determined to be the target video clip, and a target video is generated according to the third video clip 3. The target video can be the highlight clip corresponding to the source video.
[0069] Based on the above description, the present disclosure provides a video editing method. Specifically, a terminal obtains a source video to be edited, segments the source video according to the semantics corresponding to the voice in the source video, obtains a first video clip set, and performs lens segmentation on the source video to obtain a second video clip set. The first video clip set is obtained by segmenting the source video according to the semantics corresponding to the voice, so the video clips in the first video clip set have semantic integrity. The second video clip set is obtained by lens segmentation of the source video, so the video clips in the second video clip set have lens integrity. Then the terminal obtains a third video clip set according to the first video clip set and the second video clip set, that is, the semantically complete first video clip set and the lens complete second video clip set are combined to obtain a third video clip set in which each video clip has a complete plot. Then the third video clip set is used to generate a target video, wherein the duration of the target video is shorter than the duration of the source video. Since the video clips in the third video clip set have complete plots, the target video generated by using the third video clip set includes one or more complete plots, so that the plot integrity of the video clips in the automatic editing can be guaranteed, thereby improving the user experience.
[0070] Figure 6 is a schematic diagram of a video editing device according to an exemplary disclosed embodiment. Figure 6As shown, the video editing device 600 includes:
[0071] An acquisition module 602 is used to acquire a source video;
[0072] The segmentation module 604 is used to segment the source video according to the semantics corresponding to the speech in the source video to obtain a first set of video segments, and to segment the source video into shots to obtain a second set of video segments;
[0073] A determination module 606, configured to obtain a third video segment set according to the first video segment set and the second video segment set, wherein the video segments in the third video segment set have complete plots;
[0074] The generating module 608 is configured to generate a target video using the third video segment set, wherein the duration of the target video is shorter than the duration of the source video.
[0075] Optionally, the determining module 606 may be used to:
[0076] Boundaries of video segments in the first video segment set are corrected according to the video segments in the second video segment set to obtain a third video segment set, wherein the video segments in the third video segment set are corrected video segments.
[0077] Optionally, the generating module 608 may be used to:
[0078] Determining a score for each video segment in the third video segment set;
[0079] Determine a plurality of target video segments according to the scores of the respective video segments;
[0080] A target video is generated according to the multiple target video segments.
[0081] Optionally, the generating module 608 may be used to:
[0082] Determine multiple target video segments through dynamic programming according to the scores of the respective video segments; or
[0083] According to the scores of the respective video segments, a plurality of target video segments are determined through a sliding window.
[0084] Optionally, the device further comprises an identification module, configured to:
[0085] Performing speech recognition on the speech in the source video to obtain a speech text of the source video;
[0086] The speech text is input into a semantic prediction model, and the semantics corresponding to the speech in the source video is obtained through the semantic prediction model.
[0087] Optionally, the identification module may be used to:
[0088] Inputting the speech text into a semantic prediction model, and adding punctuation to the speech text through the semantic prediction model;
[0089] The semantics corresponding to the speech in the source video is determined according to the speech text including punctuation marks.
[0090] Optionally, the generating module 608 may be used to:
[0091] Each video segment in the third video segment set is input into a scoring model, and a score of each video segment in the third video segment set is determined by the scoring model.
[0092] The functions of the above modules have been described in detail in the method steps in the previous embodiment and will not be repeated here.
[0093] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device 700 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0094] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0095] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0096] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0097] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0098] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0099] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0100] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a source video; divides the source video according to the semantics corresponding to the speech in the source video to obtain a first video segment set, and divides the source video into shots to obtain a second video segment set; obtains a third video segment set according to the first video segment set and the second video segment set, wherein the video segments in the third video segment set have a complete plot; generates a target video using the third video segment set, wherein the duration of the target video is shorter than the duration of the source video. The computer program code for performing the operations of the present disclosure can be written in one or more programming languages or a combination thereof, and the programming languages include but are not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0101] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0102] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.
[0103] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0104] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0105] According to one or more embodiments of the present disclosure, Example 1 provides a video editing method, which includes: obtaining a source video; segmenting the source video according to the semantics corresponding to the speech in the source video to obtain a first set of video clips, and segmenting the source video into shots to obtain a second set of video clips; obtaining a third set of video clips according to the first set of video clips and the second set of video clips, the video clips in the third set of video clips having a complete plot; and generating a target video using the third set of video clips, the duration of the target video being shorter than the duration of the source video.
[0106] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, which obtains a third video clip set based on the first video clip set and the second video clip set, including: correcting boundaries of video clips in the first video clip set based on video clips in the second video clip set to obtain a third video clip set, wherein the video clips in the third video clip set are corrected video clips.
[0107] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein generating a target video using the third video clip set includes: determining a score of each video clip in the third video clip set; determining a plurality of target video clips based on the scores of the respective video clips; and generating a target video based on the plurality of target video clips.
[0108] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein determining multiple target video clips based on the scores of the individual video clips includes: determining multiple target video clips through dynamic programming based on the scores of the individual video clips; or determining multiple target video clips through a sliding window based on the scores of the individual video clips.
[0109] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1, which further includes: performing speech recognition on the speech in the source video to obtain a speech text of the source video; inputting the speech text into a semantic prediction model, and obtaining the semantics corresponding to the speech in the source video through the semantic prediction model.
[0110] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the speech text is input into a semantic prediction model, and the semantics corresponding to the speech in the source video is obtained through the semantic prediction model, including: inputting the speech text into the semantic prediction model, adding punctuation to the speech text through the semantic prediction model; and determining the semantics corresponding to the speech in the source video based on the speech text including punctuation.
[0111] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 3, wherein determining the score of each video clip in the third video clip set includes: inputting each video clip in the third video clip set into a scoring model, and determining the score of each video clip in the third video clip set by using the scoring model.
[0112] According to one or more embodiments of the present disclosure, Example 8 provides a video editing device, which includes: an acquisition module for acquiring a source video; a segmentation module for segmenting the source video according to the semantics corresponding to the speech in the source video to obtain a first set of video clips, and performing shot segmentation on the source video to obtain a second set of video clips; a determination module for obtaining a third set of video clips according to the first set of video clips and the second set of video clips, wherein the video clips in the third set of video clips have a complete plot; and a generation module for generating a target video using the third set of video clips, wherein the duration of the target video is shorter than the duration of the source video.
[0113] According to one or more embodiments of the present disclosure, Example 9 provides the device of Example 8, and the determination module can be used to: correct the boundaries of the video clips in the first video clip set according to the video clips in the second video clip set to obtain a third video clip set, and the video clips in the third video clip set are the corrected video clips.
[0114] According to one or more embodiments of the present disclosure, Example 10 provides the device of Example 8, and the generation module can be used to: determine the scores of each video clip in the third video clip set; determine multiple target video clips based on the scores of the individual video clips; and generate a target video based on the multiple target video clips.
[0115] According to one or more embodiments of the present disclosure, Example 11 provides the device of Example 8, and the determination module can be used to: determine multiple target video segments through dynamic programming based on the scores of the individual video segments; or determine multiple target video segments through a sliding window based on the scores of the individual video segments.
[0116] According to one or more embodiments of the present disclosure, Example 12 provides the device of Example 8, wherein the device also includes a recognition module, which is used to: perform speech recognition on the speech in the source video to obtain the speech text of the source video; input the speech text into a semantic prediction model, and obtain the semantics corresponding to the speech in the source video through the semantic prediction model.
[0117] According to one or more embodiments of the present disclosure, Example 13 provides the device of Example 12, and the recognition module can be used to: input the speech text into a semantic prediction model, and add punctuation to the speech text through the semantic prediction model; determine the semantics corresponding to the speech in the source video based on the speech text including punctuation.
[0118] According to one or more embodiments of the present disclosure, Example 14 provides the device of Example 11, and the determination module can be used to: input each video clip in the third video clip set into a scoring model, and determine the score of each video clip in the third video clip set through the scoring model.
[0119] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0120] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0121] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A video editing method, characterized in that: The method comprises: Get the source video; Segmenting the source video according to the semantics corresponding to the speech in the source video to obtain a first set of video segments, and segmenting the source video by shots to obtain a second set of video segments; Obtaining a third video segment set according to the first video segment set and the second video segment set, wherein the video segments in the third video segment set have complete plots; Generate a target video using the third video segment set, wherein the duration of the target video is shorter than the duration of the source video; The step of generating a target video by using the third video segment set includes: Determining a score for each video segment in the third video segment set; According to the scores of the respective video segments, the duration of the respective video segments and the duration of the target video, video segments with the highest total scores are combined within the duration of the target video through dynamic programming to determine multiple target video segments; A target video is generated according to the multiple target video segments.
2. The method according to claim 1, characterized in that: The step of obtaining a third video segment set according to the first video segment set and the second video segment set includes: Boundaries of video segments in the first video segment set are corrected according to the video segments in the second video segment set to obtain a third video segment set, wherein the video segments in the third video segment set are corrected video segments.
3. The method according to claim 1, characterized in that The method further comprises: Performing speech recognition on the speech in the source video to obtain a speech text of the source video; The speech text is input into a semantic prediction model, and the semantics corresponding to the speech in the source video is obtained through the semantic prediction model.
4. The method according to claim 3, characterized in that: The step of inputting the speech text into a semantic prediction model and obtaining the semantics corresponding to the speech in the source video through the semantic prediction model includes: Inputting the speech text into a semantic prediction model, and adding punctuation to the speech text through the semantic prediction model; The semantics corresponding to the speech in the source video is determined according to the speech text including punctuation marks.
5. The method according to claim 1, characterized in that The step of determining a score of each video segment in the third video segment set comprises: Each video segment in the third video segment set is input into a scoring model, and a score of each video segment in the third video segment set is determined by the scoring model.
6. A video editing device, characterized in that: The device comprises: An acquisition module, used to acquire source video; A segmentation module, configured to segment the source video according to the semantics corresponding to the speech in the source video to obtain a first set of video segments, and to segment the source video into shots to obtain a second set of video segments; a determination module, configured to obtain a third video segment set according to the first video segment set and the second video segment set, wherein the video segments in the third video segment set have complete plots; A generating module, configured to generate a target video using the third video segment set, wherein the duration of the target video is shorter than the duration of the source video; The generation module is specifically used for: Determining a score for each video segment in the third video segment set; According to the scores of the respective video segments, the duration of the respective video segments and the duration of the target video, video segments with the highest total scores are combined within the duration of the target video through dynamic programming to determine multiple target video segments; A target video is generated according to the multiple target video segments.
7. A device, characterized in that: The device comprises a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the device performs the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The method comprises instructions for instructing a device to execute the method according to any one of claims 1 to 5.
9. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 5.
