Video processing method and related device
By dividing the video into segments and calculating video vectors, matching text vectors for automatic editing, it solves the problem of low production efficiency of existing short videos and achieves efficient generation of high-quality short videos.
Patent Information
- Application Number
- CN202410821581.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Existing short video production methods rely on user experience and are inefficient, making it difficult to quickly and efficiently generate high-quality short videos.
By dividing the target video into multiple video clips, the video vector of the video frame is calculated, and the text vector is obtained according to the pre-established text information processing, and the video vector is matched to automatically edit the video to realize the splicing of video clips and the addition of audio and subtitles.
It realizes automatic matching and editing based on video vectors and video requirements, quickly produces high-quality short videos, improves production efficiency, and reduces manual participation.
Smart Images

Figure CN118400575B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of multimedia, and in particular to a video processing method and related devices. Background Art
[0002] Most existing short video production methods require users to select materials and edit them using existing editing software. This method relies on the user's experience and proficiency, and the efficiency of producing short videos is low. Summary of the invention
[0003] In view of the above problems, the present invention provides a video processing method and related devices that overcome the above problems or at least partially solve the above problems.
[0004] In a first aspect, a video processing method includes:
[0005] Divide the target video into multiple video segments;
[0006] For any of the video clips, a video vector corresponding to the video clip is calculated based on a group of video frames in the video clip, wherein one video clip corresponds to one video vector;
[0007] According to the video requirements, the pre-established text information is processed to obtain a corresponding text set;
[0008] Calculating a text vector corresponding to each text information in the text set, and determining a video vector matching the text vector, wherein the text set includes a plurality of text information, one text information corresponds to one text vector, and one text vector matches one video vector;
[0009] According to the video clips corresponding to the determined video vectors, the corresponding videos are edited.
[0010] Optionally, in some optional implementations, for any of the video clips, calculating a video vector corresponding to the video clip according to a group of video frames in the video clip includes:
[0011] For any of the video clips, extract a group of video frames from the video clip, wherein the group of video frames includes a plurality of video frames;
[0012] For any group of video frames, calculate the image vectors corresponding to each video frame;
[0013] For any group of video frames, the corresponding video vector is calculated based on the corresponding image vectors.
[0014] Optionally, in some optional implementations, the step of calculating the image vectors corresponding to the corresponding video frames for any group of video frames includes:
[0015] For any group of video frames, a pre-established image neural network model is used to calculate each video frame respectively to obtain an image vector corresponding to each video frame, wherein one video frame corresponds to one image vector.
[0016] Optionally, in some optional implementations, for any group of video frames, calculating a corresponding video vector according to corresponding image vectors includes:
[0017] For any group of video frames, the average value of the corresponding image vectors is calculated to obtain the corresponding video vector.
[0018] Optionally, in some optional implementations, the pre-established text information is processed according to the video requirements to obtain a corresponding text set, including:
[0019] According to the video requirements, at least one of a splitting process and a copy process is performed on the pre-established text information to obtain a text set corresponding to the text information.
[0020] Optionally, in some optional implementations, calculating the text vector corresponding to each text information in the text set and determining the video vector matching the text vector includes:
[0021] For each piece of text information in the text set, a pre-established text neural network model is used to calculate the text vector corresponding to each piece of text information;
[0022] For any of the text vectors, the similarity between each video vector and the text vector is calculated, and the video vector with the highest similarity is determined as the video vector matching the text vector.
[0023] Optionally, in some optional implementations, the step of editing the video clips corresponding to the determined video vectors to obtain corresponding videos includes:
[0024] The video clips corresponding to the determined video vectors are spliced in order and matched with corresponding audio and subtitles to obtain a corresponding video, wherein the audio and subtitles of any video clip correspond to the corresponding text information.
[0025] Optionally, in some optional implementations, dividing the target video into a plurality of video segments includes:
[0026] According to the storyboard information, the target video is divided into multiple video segments, wherein the storyboard information is identified in advance, and one piece of storyboard information corresponds to one video segment.
[0027] In a second aspect, a video processing device includes: a video splitting unit, a video vector calculating unit, a text processing unit, a vector matching unit, and a video editing unit;
[0028] The video splitting unit is used to split the target video into multiple video segments;
[0029] The video vector calculation unit is used to calculate, for any of the video segments, a video vector corresponding to the video segment according to a group of video frames in the video segment, wherein one video segment corresponds to one video vector;
[0030] The text processing unit is used to process the pre-established text information according to the video requirements to obtain a corresponding text set;
[0031] The vector matching unit is used to calculate the text vector corresponding to each text information in the text set, and determine the video vector matching the text vector, wherein the text set includes a plurality of text information, one text information corresponds to one text vector, and one text vector matches one video vector;
[0032] The video clipping unit is used to clip the video clips corresponding to the determined video vectors to obtain corresponding videos.
[0033] In a third aspect, a computer-readable storage medium stores a program, wherein the program, when executed by a processor, implements any of the above-mentioned video processing methods.
[0034] In a fourth aspect, an electronic device comprises at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is used to call program instructions in the memory to execute any of the video processing methods described above.
[0035] By means of the above technical scheme, a video processing method and related devices provided by the present invention can divide a target video into multiple video clips; for any of the video clips, a video vector corresponding to the video clip is calculated according to a group of video frames in the video clip, wherein one video clip corresponds to one video vector; according to the video requirements, the pre-established text information is processed to obtain a corresponding text set; the text vector corresponding to each text information in the text set is calculated, and a video vector matching the text vector is determined, wherein the text set includes multiple text information, one text information corresponds to one text vector, and one text vector matches one video vector; according to the video clip corresponding to the determined video vector, the corresponding video is clipped. It can be seen from this that the present invention can match and select appropriate video clips based on video vectors and video requirements, and then automatically clip and generate corresponding short videos, with a high degree of matching and no need for manual participation, and can quickly produce a large number of high-quality short videos with high efficiency.
[0036] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0038] Figure 1 A flow chart of a first video processing method provided by the present invention is shown;
[0039] Figure 2 A flow chart of a second video processing method provided by the present invention is shown;
[0040] Figure 3 A flowchart of a third video processing method provided by the present invention is shown;
[0041] Figure 4 A schematic structural diagram of a video processing device provided by the present invention is shown;
[0042] Figure 5 A structural schematic diagram of an electronic device provided by the present invention is shown. DETAILED DESCRIPTION
[0043] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0044] like Figure 1 As shown, the present invention provides a video processing method, including: S100, S200, S300, S400 and S500;
[0045] S100, dividing the target video into multiple video segments;
[0046] Optionally, the target video in the present invention may be any long video. That is, the present invention may divide a long video into multiple video clips, and the video clips are arranged in sequence according to the order in which they are played in the original long video, and the present invention does not limit this.
[0047] Optionally, dividing the video into multiple segments is beneficial for selecting required video segments for editing according to video requirements to obtain short videos, and the present invention does not impose any limitation on this.
[0048] Optionally, the present invention does not impose any specific restrictions on the length of each video segment, and can be set according to actual needs. Figure 2 As shown, in some optional embodiments, the S100 includes: S110;
[0049] S110, dividing the target video into multiple video segments according to the storyboard information;
[0050] The storyboard information is identified in advance, and one piece of storyboard information corresponds to one video clip.
[0051] Optionally, a long video may be edited from multiple split-shot videos, with switching time points between the split-shots serving as cutting points between two split-shots. For example, the camera was facing actor A in the previous second, and switched to actor B in the next second, which are two split-shots. The present invention can use the continuity of video frames to pre-identify split-shot information. If the previous frame and the current frame are not continuous (similar), it is considered that the split-shot has been switched. The present invention can specifically use an existing video segmenter (such as PysceneDetect) to pre-acquire the split-shot information of a long video, and the present invention is not limited to this.
[0052] Optionally, after identifying the storyboard information, the present invention can divide the target video into multiple video segments according to the video frame information (recording the video frame that distinguishes two adjacent storyboards) or the moment information (recording the moment that distinguishes two adjacent storyboards) in the storyboard information, and the present invention is not limited to this.
[0053] S200, for any of the video clips, calculating a video vector corresponding to the video clip according to a group of video frames in the video clip;
[0054] Among them, one video clip corresponds to one video vector;
[0055] Optionally, for any video clip, the present invention can extract a group of video frames from it and then calculate the video vector. Figure 3 As shown, in some optional embodiments, the S200 includes: S210, S220 and S230;
[0056] S210: for any of the video clips, extract a group of video frames from the video clip;
[0057] Wherein, a set of video frames includes a plurality of video frames;
[0058] Optionally, the present invention can set the method of extracting video frames according to actual needs. For example, the present invention can extract a video frame every N seconds, and N can be set according to actual needs, and the present invention does not limit this.
[0059] S220, for any group of video frames, calculating the image vectors corresponding to each video frame;
[0060] For example, in some optional implementations, the S220 includes:
[0061] For any group of video frames, a pre-established image neural network model is used to calculate each video frame respectively to obtain an image vector corresponding to each video frame, wherein one video frame corresponds to one image vector.
[0062] Optionally, as mentioned above, a video clip corresponds to a group of video frames. In order to calculate the video vector of the video clip, the present invention can calculate the image vector of the corresponding video frame, and then calculate the corresponding video vector based on the image vector. The present invention is not limited to this.
[0063] Optionally, the image neural network model of the present invention can calculate multiple video frames at the same time, and then obtain image vectors of the multiple video frames. Of course, the image neural network model can also calculate one video frame at a time to obtain an image vector of one video frame, and calculate each video frame in turn to obtain the corresponding image vector, and the present invention does not limit this.
[0064] Optionally, the present invention may use a deep convolutional network model (Visual Geometry Group, VGG) to calculate the image vector of the video frame, and the present invention is not limited to this.
[0065] S230 . For any group of video frames, a corresponding video vector is calculated based on the corresponding image vectors.
[0066] Optionally, as mentioned above, each extracted video frame is calculated to obtain a corresponding image vector, and one video clip corresponds to multiple video frames of a group of video frames. Therefore, for any group of video frames, the present invention can use the image vectors of each video frame of the group of video frames to calculate the corresponding video vector, and one video clip corresponds to one video vector, and the present invention is not limited to this.
[0067] For example, in some optional embodiments, the S230 includes:
[0068] For any group of video frames, the average value of the corresponding image vectors is calculated to obtain the corresponding video vector.
[0069] Optionally, as mentioned above, a group of video frames includes multiple video frames, and one video frame corresponds to one image vector. That is, a group of video frames corresponds to multiple image vectors. The present invention can calculate the average value of multiple image vectors as the video vector of the corresponding video segment, and the present invention is not limited to this.
[0070] S300, processing the pre-established text information according to the video requirements to obtain a corresponding text set;
[0071] For example, in some optional implementations, the S300 includes:
[0072] According to the video requirements, at least one of a splitting process and a copy process is performed on the pre-established text information to obtain a text set corresponding to the text information.
[0073] Optionally, the video requirements of the present invention can be characterized by parameters. For example, sweet videos and commentary videos can be represented by 0 and 1 respectively, and other types of videos, such as empty shot videos and fighting videos, can be represented by 2 and 3 respectively, and so on. The present invention does not limit this. Different video requirements have different requirements for the content and format of text information. The present invention can provide corresponding text information in advance as needed, so that the text information can be correctly processed according to the video requirements later (such as split processing and copy processing, etc.).
[0074] For example, if the video clips that make up the short video have the same attributes, such as sweet scenes of the male and female protagonists, then some words related to sweetness need to be used to match these scenes, so the copy process can be performed. For another example, if the video clips that make up the short video do not have similarities, such as commentary videos, there is a logical relationship between the video clips, then the required text information is also a commentary text with a logical relationship, rather than some similar words, so the text information can be segmented, and then the segmented text can be used to match the shot, and the present invention does not limit this.
[0075] S400, calculating a text vector corresponding to each text information in the text set, and determining a video vector matching the text vector;
[0076] The text set includes a plurality of text information, one text information corresponds to a text vector, and one text vector matches one video vector;
[0077] For example, in some optional embodiments, the S400 includes: step 1.1 and step 1.2;
[0078] Step 1.1, for each piece of text information in the text set, use a pre-established text neural network model to calculate the text vector corresponding to each piece of text information;
[0079] Step 1.2: For any of the text vectors, calculate the similarity between each video vector and the text vector, and determine the video vector with the highest similarity as the video vector that matches the text vector.
[0080] Optionally, a text message may correspond to a text vector. For each text vector, the present invention may match and find the most similar video vector, and then store the video clip corresponding to the video vector. When matching and finding the most similar video clip, the present invention may specify a search range (short videos produced for different video requirements have different search ranges), and then use matrix multiplication to quickly calculate the similarity between each text vector and all video vectors, and then select the video vector with the highest similarity, which is not limited by the present invention.
[0081] Optionally, when calculating text vectors, the present invention can use models such as Long Short-Term Memory (LSTM), Transformer, Bidirectional Encoder Representations from Transformers (BERT), Generative Pre-Trained (GPT), and Constrastive Language-Image Pre-training (CLIP) for calculation. The specific selection can be made based on comprehensive performance and efficiency, and the present invention is not limited to this.
[0082] S500: Edit the video clips corresponding to the determined video vector to obtain corresponding videos.
[0083] For example, in some optional implementations, the S500 includes:
[0084] The video clips corresponding to the determined video vectors are spliced in order and matched with corresponding audio and subtitles to obtain a corresponding video, wherein the audio and subtitles of any video clip correspond to the corresponding text information.
[0085] Optionally, as mentioned above, multiple video clips have been determined through similarity matching. The present invention can splice and edit these video clips in a certain order to obtain corresponding short videos, and the present invention does not impose any limitation on this.
[0086] It should be noted that when adding subtitles, the present invention can extract subtitle content from the corresponding text information or directly use the corresponding text information as subtitles, and the present invention does not limit this. For audio, the present invention can convert the corresponding text information into audio, or match appropriate audio according to the text information.
[0087] Optionally, the present invention can configure parameters to edit and process all stored video clips and finally integrate them into a short video. The parameters here can be used to configure some editing methods in the short video, such as whether to remove the original sound, whether to add background music, the type of background music, whether to add subtitles, the position and font size of the subtitles, and whether to add video filters, etc. The parameters depend on the type of short video to be produced and are not limited here.
[0088] Optionally, in order to more clearly illustrate the solution of the present invention, the production of sweet-type short videos and plot explanation-type short videos is taken as examples for explanation below.
[0089] 1. Produce sweet short videos:
[0090] (1) Video vector calculation. For each video, it is divided into multiple video clips according to the storyboard information. Each video clip is extracted one frame every 1 second to obtain multiple groups of video frames. The CLIP image model is used to extract a 512-dimensional image vector from each frame of the image. The mean of the image vector of each group of video frames is used as the video vector of the video clip corresponding to the reorganized video frame and stored in the vector library. For subsequent video clip matching, the characters appearing in the video clip can also be detected here, and the detection results are stored in the database. The face detection here is an operation added to optimize the effect of producing short videos in the current instance.
[0091] (2) Text vector calculation. Duplicate the text information surrounding the sweetness setting to obtain a text set. Use the CLIP text model to extract each text in the text set into a 512-dimensional text vector to obtain a text vector set. The text information surrounding the sweetness setting here can be text related to sweetness or explanatory texts such as "kiss", "hug", "lean against", and "cuddle".
[0092] (3) Video clip matching. Video clips of the male and female protagonists appear in the repository at the same time as the pre-selected range for video matching. Construct the N text vectors into an (N, 512) matrix, and construct the M pre-selected video vectors into a (512, M) matrix. Perform matrix multiplication to obtain an (N, M) matrix, where the value of the i-th row and j-th column represents the similarity between the i-th text vector and the j-th video vector. Record the column number with the highest similarity in each row starting from the first row. If a column has been recorded, select the column with the highest similarity after removing the column. Finally, obtain N column numbers corresponding to N video vectors. Find the video clips corresponding to these N video vectors from the database and store them.
[0093] (4) Short video production. Obtain all matched video clips, remove the original sound of all clips, randomly select transition effects from GL-Transition to splice all clips, add filters to the video using a color lookup table (LUT), and then add background music and corresponding lyrics and subtitles to generate the final short video.
[0094] This example mainly introduces a situation. The sweet type can also be changed to an empty shot type, a smile type, a fighting type, a funny type, etc. The present invention does not limit this.
[0095] 2. Short videos of plot explanation type.
[0096] (1) Video vector calculation. For each video, it is divided into multiple video clips according to the storyboard information. Each video clip is extracted one frame per second to obtain multiple groups of video frames. The EfficientNet model is used to extract a 256-dimensional image vector from each frame image. The mean of the image vectors of each group of video frames is used as the video vector of the video clip corresponding to the reorganized video frame and stored in the vector library.
[0097] (2) Text vector calculation. The obtained text information, i.e., the video commentary, is divided into sentences according to the sentence symbols to obtain a text set. Each text in the text set is a commentary sentence. The Transformer model is used to extract each sentence in the text set into a 256-dimensional text vector to obtain a text vector set.
[0098] (3) Video clip matching. All video clips in the repository are used as the pre-selected range for video matching. Construct the N text vectors into an (N, 256) matrix, and construct the M pre-selected video vectors into a (256, M) matrix. Perform matrix multiplication to obtain an (N, M) matrix, where the value of the i-th row and j-th column represents the similarity between the i-th text vector and the j-th video vector. Record the column number with the highest similarity in each row starting from the first row. If a column has been recorded, select the column with the highest similarity after removing the column. Finally, obtain N column numbers corresponding to N video vectors. Find the video clips corresponding to these N video vectors from the database and store them.
[0099] (4) Short video production. Obtain all matched video clips, which correspond one-to-one to the commentary sentences in the text set. Convert the sentences in the text set into audio using speech synthesis technology (Text To Speech, TTS), then use the converted audio to replace the original sound in the corresponding video clip, and add subtitles to form a video commentary clip. Splice all the video commentary clips in sequence to obtain the final plot commentary video. During the production process, you can also choose to retain part of the original sound, use filters and other settings, depending on the specific needs of the commentary video, without mandatory restrictions, to ensure that the content produced is richer in form.
[0100] like Figure 4 As shown, the present invention provides a video processing device, comprising: a video splitting unit 100, a video vector calculating unit 200, a text processing unit 300, a vector matching unit 400 and a video clipping unit 500;
[0101] The video splitting unit 100 is used to split the target video into multiple video segments;
[0102] The video vector calculation unit 200 is used to calculate, for any of the video segments, a video vector corresponding to the video segment according to a group of video frames in the video segment, wherein one video segment corresponds to one video vector;
[0103] The text processing unit 300 is used to process the pre-established text information according to the video requirements to obtain a corresponding text set;
[0104] The vector matching unit 400 is used to calculate the text vector corresponding to each text information in the text set, and determine the video vector matching the text vector, wherein the text set includes a plurality of text information, one text information corresponds to one text vector, and one text vector matches one video vector;
[0105] The video clipping unit 500 is used to clip the video clips corresponding to the determined video vectors to obtain corresponding videos.
[0106] Optionally, in some optional implementations, the video vector calculation unit 200 includes: a video frame extraction subunit, an image vector calculation subunit and a video vector calculation subunit;
[0107] The video frame extraction subunit is used to extract a group of video frames from any of the video segments, wherein the group of video frames includes a plurality of video frames;
[0108] The image vector calculation subunit is used to calculate the image vectors corresponding to each video frame for any group of video frames;
[0109] The video vector calculation subunit is used to calculate the corresponding video vector for any group of video frames according to the corresponding image vectors.
[0110] Optionally, in certain optional implementations, the image vector calculation subunit includes: a first calculation subunit;
[0111] The first calculation subunit is used to calculate each video frame separately using a pre-established image neural network model for any group of video frames to obtain an image vector corresponding to each video frame, wherein one video frame corresponds to one image vector.
[0112] Optionally, in certain optional implementations, the video vector calculation subunit includes: a second calculation subunit;
[0113] The second calculation subunit is used to calculate the average value of the corresponding image vectors for any group of video frames to obtain the corresponding video vector.
[0114] Optionally, in some optional implementations, the text processing unit 300 includes: a text processing subunit;
[0115] The text processing subunit is used to perform at least one of splitting processing and copying processing on the pre-established text information according to the video requirements, so as to obtain a text set corresponding to the text information.
[0116] Optionally, in some optional implementations, the vector matching unit 400 includes: a third calculation subunit and a fourth calculation subunit;
[0117] The third calculation subunit is used to calculate the text vector corresponding to each piece of text information in the text set using a pre-established text neural network model;
[0118] The fourth calculation subunit is used to calculate the similarity between each video vector and the text vector for any of the text vectors, and determine the video vector with the highest similarity as the video vector matching the text vector.
[0119] Optionally, in some optional implementations, the video editing unit 500 includes: a video editing subunit;
[0120] The video clipping subunit is used to splice the video clips in the order corresponding to the determined video vectors, and add corresponding audio and subtitles to obtain the corresponding video, wherein the audio and subtitles of any video clip correspond to the corresponding text information.
[0121] Optionally, in some optional implementations, the video splitting unit 100 includes: a video splitting subunit;
[0122] The video splitting subunit is used to divide the target video into multiple video segments according to the storyboard information, wherein the storyboard information is pre-identified and one piece of storyboard information corresponds to one video segment.
[0123] The present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, any of the above-mentioned video processing methods is implemented.
[0124] like Figure 5 As shown, the present invention provides an electronic device 70, which includes at least one processor 701, and at least one memory 702 and a bus 703 connected to the processor 701; wherein the processor 701 and the memory 702 communicate with each other through the bus 703; the processor 701 is used to call the program instructions in the memory 702 to execute any of the video processing methods described above.
[0125] In the present invention, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0126] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0127] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the present invention may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown in the present invention, but will conform to the widest scope consistent with the principles and novel features disclosed in the present invention.
[0128] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A video processing method, characterized in that: include: Divide the target video into multiple video segments; For any of the video clips, a video vector corresponding to the video clip is calculated according to a group of video frames in the video clip, wherein one video clip corresponds to one video vector, and the video vector is a mean value of image vectors of each group of video frames; According to the video requirements, the pre-established text information is processed to obtain a corresponding text set; Calculating a text vector corresponding to each text information in the text set, and determining a video vector matching the text vector, wherein the text set includes a plurality of text information, one text information corresponds to one text vector, and one text vector matches one video vector; According to the parameters and the video clips corresponding to the determined video vectors, the corresponding videos are edited, wherein the parameters are determined according to the type of the video to be produced, and the parameters are used to configure the editing method in the video; The method of processing the pre-established text information according to the video requirements to obtain a corresponding text set includes: According to the video requirements, at least one of splitting processing and copying processing is performed on the pre-established text information to obtain a text set corresponding to the text information; the video requirements are represented by parameters, different types of videos are represented by different parameters, and different video requirements correspond to the content and format requirements of the corresponding text information.
2. The method according to claim 1, characterized in that The step of calculating, for any of the video segments, a video vector corresponding to the video segment according to a group of video frames in the video segment, comprises: For any of the video clips, extract a group of video frames from the video clip, wherein the group of video frames includes a plurality of video frames; For any group of video frames, calculate the image vectors corresponding to each video frame; For any group of video frames, the corresponding video vector is calculated based on the corresponding image vectors.
3. The method according to claim 2, characterized in that The step of calculating the image vectors corresponding to each video frame for any group of video frames includes: For any group of video frames, a pre-established image neural network model is used to calculate each video frame respectively to obtain an image vector corresponding to each video frame, wherein one video frame corresponds to one image vector.
4. The method according to claim 2, characterized in that: The step of calculating a corresponding video vector for any group of video frames according to the corresponding image vectors includes: For any group of video frames, the average value of the corresponding image vectors is calculated to obtain the corresponding video vector.
5. The method according to claim 1, characterized in that: The calculating of the text vector corresponding to each text information in the text set and determining the video vector matching the text vector includes: For each piece of text information in the text set, a pre-established text neural network model is used to calculate the text vector corresponding to each piece of text information; For any of the text vectors, the similarity between each video vector and the text vector is calculated, and the video vector with the highest similarity is determined as the video vector matching the text vector.
6. The method according to claim 1, characterized in that The step of editing the video clips corresponding to the determined video vectors to obtain corresponding videos includes: The video clips corresponding to the determined video vectors are spliced in order and matched with corresponding audio and subtitles to obtain a corresponding video, wherein the audio and subtitles of any video clip correspond to the corresponding text information.
7. The method according to claim 1, characterized in that The step of dividing the target video into multiple video segments comprises: According to the storyboard information, the target video is divided into multiple video segments, wherein the storyboard information is identified in advance, and one piece of storyboard information corresponds to one video segment.
8. A video processing device, characterized in that: include: Video splitting unit, video vector calculation unit, text processing unit, vector matching unit and video editing unit; The video splitting unit is used to split the target video into multiple video segments; The video vector calculation unit is used to calculate, for any of the video segments, a video vector corresponding to the video segment according to a group of video frames in the video segment, wherein one video segment corresponds to one video vector, and the video vector is a mean value of image vectors of each group of video frames; The text processing unit is used to process the pre-established text information according to the video requirements to obtain a corresponding text set; wherein the text processing unit includes a text processing sub-unit, and the text processing sub-unit is used to perform at least one of splitting processing and copying processing on the pre-established text information according to the video requirements to obtain a text set corresponding to the text information; the video requirements are represented by parameters, different types of videos are represented by different parameters, and different video requirements correspond to the content and format requirements of the corresponding text information; The vector matching unit is used to calculate the text vector corresponding to each text information in the text set, and determine the video vector matching the text vector, wherein the text set includes a plurality of text information, one text information corresponds to one text vector, and one text vector matches one video vector; The video editing unit is used to edit the corresponding video according to the parameters and the video segments corresponding to the determined video vectors. The parameters are determined according to the type of video to be produced, and the parameters are used to configure the editing method in the video.
9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the video processing method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the video processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Video classification method and device, electronic equipment and storage medium
CN113220940A
Method and device for generating plot explanation short video and electronic equipment
CN114222196A
Video generation method and device, equipment and storage medium
CN115967833A
Video tag extraction method, system and device and medium
CN117793483A
Automatic video mixing and cutting method and system for video retrieval and storage medium
CN117830910A
