Video generation method and device, equipment and storage medium
By acquiring video description information and dividing the video to generate video frame sequences and audio data, the problem of low video digest generation efficiency in the prior art is solved, and more efficient video digest generation is achieved.
Patent Information
- Application Number
- CN202311118817.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, it takes a long time to generate a video summary of a movie video, resulting in a low efficiency of the video generation method.
By obtaining video description information, obtaining the introduction text information corresponding to the video and the time node information of the video clip, segmenting the video, generating a video frame sequence, converting the text information into audio data, and generating a video summary based on the video frame sequence and audio data.
The efficiency of video digest generation is improved, so that video digest can be automatically generated through video description information, which significantly improves efficiency compared with manual generation.
Smart Images

Figure CN119545123A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of video editing technology, and in particular to a method, apparatus, device and storage medium for generating a video. Background Art
[0002] At present, more and more users like to watch the video summary of a movie video to understand the key plot of the movie video. Among them, the video summary is a short video obtained by extracting the key plot fragments in the movie video and adding corresponding text explanations.
[0003] In the prior art, technicians first watch and understand the content of a movie video, and then segment the movie video based on their personal understanding to extract key plot segments. Then, based on the understanding of the movie video content, they write a text commentary related to the movie video and add the text commentary to the key plot segments to obtain a video summary of the movie video.
[0004] However, the inventors have found that the prior art has at least the following technical problems: since technicians are required to first watch and understand the movie video content and then extract key plot clips, it takes a long time to generate a video summary of the movie video, so the efficiency of the video generation method is low. Summary of the invention
[0005] The embodiments of the present disclosure provide a method, apparatus, device and storage medium for generating a video, which can improve the efficiency of generating a video.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for generating a video, comprising:
[0007] Obtaining a first video and video description information of the first video;
[0008] According to the video description information, obtaining introduction text information corresponding to the first video and time node information of at least one video segment in the first video;
[0009] Segmenting the first video according to time node information of the at least one video segment to obtain a video frame sequence corresponding to the at least one video segment;
[0010] The playing time of the video frame sequence is obtained, the introduction text information is converted into audio data of the playing time, and a second video is generated according to the video frame sequence and the audio data.
[0011] In a second aspect, an embodiment of the present disclosure provides a video generation device, including:
[0012] A first acquisition module, used to acquire a first video and video description information of the first video;
[0013] A second acquisition module, configured to acquire, according to the video description information, introduction text information corresponding to the first video and time node information of at least one video segment in the first video;
[0014] a segmentation module, configured to segment the first video according to time node information of the at least one video segment, to obtain a video frame sequence corresponding to the at least one video segment;
[0015] The generating module is used to obtain the playing time of the video frame sequence, convert the introduction text information into audio data of the playing time, and generate a second video according to the video frame sequence and the audio data.
[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0017] A processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the video generation method as described in the first aspect above.
[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method for generating a video as described in the first aspect above is implemented.
[0019] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video generation method as described in the first aspect above.
[0020] The video generation method, device, equipment and storage medium provided in this embodiment include: obtaining a first video and video description information of the first video; obtaining introduction text information corresponding to the first video and time node information of at least one video segment in the first video according to the video description information; segmenting the first video according to the time node information of at least one video segment to obtain a video frame sequence corresponding to at least one video segment; obtaining the playback time of the video frame sequence, converting the introduction text information into audio data of the playback time, and generating a second video according to the video frame sequence and the audio data. Since the video summary of the first video can be automatically generated through the video description information, the efficiency of generating the video summary is improved compared with manually generating the video summary of the original video. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 A schematic diagram of an application scenario of a method for generating a video provided in an embodiment of the present disclosure;
[0023] Figure 2 A flowchart of a method for generating a video provided by an embodiment of the present disclosure;
[0024] Figure 3 A schematic diagram of a method for generating a video provided by an embodiment of the present disclosure;
[0025] Figure 4 A flowchart of another method for generating a video provided by an embodiment of the present disclosure;
[0026] Figure 5 A structural block diagram of a video generation device provided in an embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0029] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0030] At present, more and more users like to watch the video summary of a movie video to understand the key plot of the movie video. Among them, the video summary is a short video obtained by extracting the key plot fragments in the movie video and adding corresponding text explanations.
[0031] In the prior art, a technician first watches and understands the content of a movie video, and then segments the movie video based on personal understanding to extract key plot segments. Then, based on the understanding of the movie video content, a text commentary related to the movie video is written, and the text commentary is added to the key plot segments to obtain a video summary of the movie video. However, since the technician needs to first watch and understand the movie video content and then extract the key plot segments, it takes a long time to generate a video summary of the movie video, so the efficiency of the video summary generation method is low.
[0032] Therefore, how to improve the generation efficiency of video summaries of movie videos is a technical problem that needs to be solved urgently.
[0033] In order to solve the above problems, this embodiment provides the following technical ideas: first, through the video identification of the video file, the introduction text information of the video summary and the time node information of the important video clips can be obtained, and then, according to the time node information of the important video clips, the important video clips are extracted from the original video file; finally, the introduction text information is converted into audio data and added to the audio track corresponding to the video frame sequence to obtain the video summary. Since the video summary of the original video corresponding to the video identification can be automatically generated through the video identification, the efficiency of generating the video summary is improved compared with manually generating the video summary of the original video.
[0034] The application scenarios of the embodiments of the present disclosure are explained below:
[0035] The video generation method provided by the embodiment of the present disclosure can be applied to various video generation scenarios, such as generating a video summary of a movie video or generating a video summary of a game video. Figure 1 Schematic diagram of an application scenario of a method for generating a video provided by an embodiment of the present disclosure. Figure 1 As shown, data is transmitted between the terminal 101 and the server 102 by wired or wireless connection. The terminal 101 can send a request to generate a video summary of a movie video to the server 102. The server 102 receives the request, generates a video summary of the movie video according to the video identifier carried in the request, and returns the video summary of the movie video to the terminal 101. The terminal 101 can play the video summary of the movie video. The following detailed embodiment is used to describe in detail the video generation method provided by the embodiment of the present disclosure.
[0036] Figure 2 The flowchart of a method for generating a video provided by an embodiment of the present disclosure. The execution subject of the method for generating a video can be a terminal device or a server device. This embodiment is described by taking the execution subject being a terminal device as an example. Figure 2, the method comprising:
[0037] S201. Obtain a first video and video description information of the first video.
[0038] In the disclosed embodiment, the first video may be an original video of any video material. For example, the first video may be an original video of a movie, or the first video may be an original video recorded by a user.
[0039] In some embodiments, the original video can be obtained locally from the terminal device. The terminal device stores the correspondence between the video name and the original video. Accordingly, the step of obtaining the first video is: according to the video name, from the correspondence between the video name and the original video, obtain the original video corresponding to the video name to obtain the first video.
[0040] In some other embodiments, the original video can be downloaded from the server. Accordingly, the step of obtaining the first video is: the terminal device sends a video acquisition request to the server, and the video acquisition request carries the video name; the server receives the video acquisition request, extracts the original video corresponding to the video name according to the video name, and returns the original video to the terminal, and the terminal obtains the first video.
[0041] The video description information may be a video name, a picture in the video, a certain video clip in the video, etc. Optionally, Figure 3 As shown, the first video is the original video of the movie, and the video description information of the first video is the name of the movie; accordingly, the steps for obtaining the video description information of the first video are: a "Movie Smart Summary" control is displayed in the client interface, and in response to a click operation on the "Movie Smart Summary" control, a video name input box is displayed; in response to detecting the movie name entered by the user through the video name input box, the terminal obtains the video description information of the first video.
[0042] S202: Obtain introduction text information corresponding to the first video and time node information of at least one video segment in the first video according to the video description information.
[0043] Optionally, the introduction text information corresponding to the first video and the time node information of at least one video segment in the first video can be obtained through a machine learning model. Accordingly, this step is: input the video description information into a preset machine learning model, and output the introduction text information corresponding to the first video and the time node information of at least one video segment in the first video, where the video segment is an important plot segment in the first video; wherein the machine learning model is used to obtain the introduction text information of the video and the time node information of at least one video segment in the video through the video description information of the video.
[0044] For example, Figure 3As shown, the video description information is the movie name. The movie name is input into the machine learning model, and the movie introduction text information and time node information of important plots are output.
[0045] Optionally, the introductory text information may be a text introduction to an important plot of the original video. The time node information includes the start time node and the end time node of the video segment. Exemplarily, at least one video segment includes video segment 1 and video segment 2; the time node information of video segment 1 is: 00:12:50-00:15:50; the time node information of video segment 2 is: 00:35:50-00:36:50.
[0046] S203: Segment the first video according to time node information of at least one video segment to obtain a video frame sequence corresponding to the at least one video segment.
[0047] Optionally, the time node information includes the start time node and the end time node of the video segment; accordingly, this step is: according to the start time node and the end time node of each video segment, the first video is segmented to extract at least one video segment, wherein the video segment includes multiple video frames; at least one video segment including multiple video frames is combined to obtain a video frame sequence corresponding to the at least one video segment.
[0048] The video segment includes a plurality of video frames, and a video frame sequence corresponding to the at least one video segment is obtained by sorting the plurality of video frames of the at least one video segment.
[0049] In some embodiments, the sorting can be performed according to the time sequence; accordingly, the step of combining at least one video segment including multiple video frames to obtain a video frame sequence corresponding to the at least one video segment is as follows: according to the time sequence of the video segments, at least one video segment including multiple video frames is combined to obtain a video frame sequence corresponding to the at least one video segment.
[0050] In other embodiments, the video clips may be ranked according to their plot importance; accordingly, the step of combining at least one video clip including a plurality of video frames to obtain a video frame sequence corresponding to the at least one video clip is as follows: combining at least one video clip including a plurality of video frames in order of importance levels of the video clips to obtain a video frame sequence corresponding to the at least one video clip, wherein the importance level is used to indicate the plot importance of the video clip.
[0051] It should be noted that if Figure 3 As shown, in the process of combining at least one video segment including a plurality of video frames, introduction text information (ie, video subtitles) may also be added to the video frame sequence.
[0052] S204: Obtain the playing time of the video frame sequence, convert the introduction text information into audio data of the playing time, and generate a second video according to the video frame sequence and the audio data.
[0053] In the disclosed embodiment, the second video may be a video that introduces the main plot of the first video. Exemplarily, the second video is a video summary of the first video.
[0054] According to one embodiment of the present disclosure, the introduction text information can be converted into audio data through a text recognition model. Figure 3 As shown, the audio data may be the narration of the original video.
[0055] Optionally, the video frame sequence can be displayed on the video track in the video editing interface, and the playback duration of the video frame sequence can be obtained through the timeline of the video track. Correspondingly, the audio data can be displayed on the audio track in the video editing interface, and the timeline of the audio track and the timeline of the video track can be aligned to obtain audio data with the same playback duration.
[0056] It should be noted that before generating the second video, the video frame sequence and the audio data may be previewed or adjusted. Figure 4 As shown, generating a second video according to a video frame sequence and audio data includes steps S401 to S402:
[0057] S401: Display a video frame sequence on a video track in a video editing interface, and display audio data on an audio track in the video editing interface.
[0058] The video editing interface includes a video track and an audio track. The video frame sequence can be adjusted through the video track. For example, the play time and play speed of the video frame sequence can be adjusted. The audio data can be adjusted through the audio track. For example, the play time and play speed of the audio data can be adjusted.
[0059] In some embodiments, the video frame sequence and / or audio data may be adjusted through the video editing interface first, and then the second video. The step of adjusting the video frame sequence and / or audio data includes: in response to receiving a first editing operation on the video frame sequence, adjusting the video frame sequence to obtain a new video frame sequence; and in response to receiving a second editing operation on the audio data, adjusting the audio data to obtain new audio data.
[0060] In the embodiment of the present disclosure, the first editing operation and the second editing operation are not specifically limited. Optionally, the first editing operation may be to add special effects, adjust the playback speed of the video frame, etc. The second editing operation may be to add background music, adjust the playback duration, adjust the playback speed, etc.
[0061] S402: In response to receiving an export operation of a second video, combine audio data on an audio track with a video frame sequence on a video track to generate a second video.
[0062] Optionally, an export control is displayed in the video editing interface. Accordingly, this step is: in response to receiving a trigger operation on the export control, determining that an export operation of the second video is received, combining the audio data on the audio track with the video frame sequence on the video track, and generating the second video. Exemplarily, the export control may be an "export video summary" control, and the trigger operation may be a click operation on the "export video summary" control.
[0063] It should be noted that, during the process of exporting the second video, an export information interface of the second video may also be displayed, which may include information such as video name, duration, data size (size of storage space occupied), resolution, format, frame rate, etc.
[0064] The video generation method provided in this embodiment, in response to receiving a video identifier, obtains a first video and video description information of the first video; according to the video description information, obtains introduction text information corresponding to the first video and time node information of at least one video segment in the first video; according to the time node information of at least one video segment, the first video is segmented to obtain a video frame sequence corresponding to at least one video segment; obtains the playback time of the video frame sequence, converts the introduction text information into audio data of the playback time, and generates a second video according to the video frame sequence and the audio data. Since the video summary of the first video can be automatically generated through the video description information, the efficiency of generating the video summary is improved compared with manually generating the video summary of the original video.
[0065] Figure 5 This is a structural block diagram of a video generation device provided by an embodiment of the present disclosure. Figure 5 The device includes: a first acquisition module 501, a second acquisition module 502, a segmentation module 503 and a generation module 504.
[0066] The first acquisition module 501 is used to acquire a first video and video description information of the first video;
[0067] A second acquisition module 502 is used to acquire, according to the video description information, introduction text information corresponding to the first video and time node information of at least one video segment in the first video;
[0068] A segmentation module 503, configured to segment the first video according to time node information of the at least one video segment, to obtain a video frame sequence corresponding to the at least one video segment;
[0069] The generating module 504 is used to obtain the playing time of the video frame sequence, convert the introduction text information into audio data of the playing time, and generate a second video according to the video frame sequence and the audio data.
[0070] According to one or more embodiments of the present disclosure, the second acquisition module 502 acquires the introductory text information corresponding to the first video and the time node information of at least one video segment in the first video according to the video description information, specifically comprising: inputting the video description information into a preset machine learning model, outputting the introductory text information corresponding to the first video and the time node information of at least one video segment in the first video, wherein the video segment is an important plot segment in the first video; wherein the machine learning model is used to obtain the introductory text information of the video and the time node information of at least one video segment in the video through the video description information of the video.
[0071] According to one or more embodiments of the present disclosure, the time node information includes the start time node and the end time node of the video segment; accordingly, the segmentation module 503 segments the first video according to the time node information of the at least one video segment to obtain a video frame sequence corresponding to the at least one video segment, specifically including: segmenting the first video according to the start time node and the end time node of each video segment to extract at least one video segment, wherein the video segment includes multiple video frames; combining at least one of the video segments including multiple video frames to obtain a video frame sequence corresponding to the at least one video segment.
[0072] According to one or more embodiments of the present disclosure, the segmentation module 503 combines at least one of the video clips including multiple video frames to obtain a video frame sequence corresponding to the at least one video clip, specifically including: combining at least one of the video clips including multiple video frames in chronological order of the video clips to obtain a video frame sequence corresponding to the at least one video clip; or combining at least one of the video clips including multiple video frames in order of importance levels of the video clips to obtain a video frame sequence corresponding to the at least one video clip, wherein the importance level is used to indicate the degree of plot importance of the video clip.
[0073] According to one or more embodiments of the present disclosure, the generation module 504 generates a second video based on the video frame sequence and the audio data, specifically including: displaying the video frame sequence on a video track in a video editing interface, and displaying the audio data on an audio track in the video editing interface; in response to receiving an export operation for the second video, combining the audio data on the audio track with the video frame sequence on the video track to generate the second video.
[0074] According to one or more embodiments of the present disclosure, it also includes: an adjustment module; the adjustment module is used to adjust the video frame sequence in response to receiving a first editing operation on the video frame sequence to obtain a new video frame sequence; and, in response to receiving a second editing operation on the audio data, adjust the audio data to obtain new audio data.
[0075] The first acquisition module 501, the second acquisition module 502, the segmentation module 503 and the generation module 504 are connected in sequence. The video generation device provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.
[0076] refer to Figure 6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure, and the electronic device 600 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 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.
[0077] like Figure 6As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0078] Typically, the following devices may be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 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.
[0079] 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 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 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0080] 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.
[0081] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0082] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0083] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely 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 entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via 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., via the Internet using an Internet service provider).
[0084] 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.
[0085] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0086] 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.
[0087] 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.
[0088] In a first aspect, according to one or more embodiments of the present disclosure, a method for generating a video is provided, comprising:
[0089] Obtaining a first video and video description information of the first video;
[0090] According to the video description information, obtaining introduction text information corresponding to the first video and time node information of at least one video segment in the first video;
[0091] Segmenting the first video according to time node information of the at least one video segment to obtain a video frame sequence corresponding to the at least one video segment;
[0092] The playing time of the video frame sequence is obtained, the introduction text information is converted into audio data of the playing time, and a second video is generated according to the video frame sequence and the audio data.
[0093] According to one or more embodiments of the present disclosure, obtaining the introductory text information corresponding to the first video and the time node information of at least one video segment in the first video based on the video description information includes: inputting the video description information into a preset machine learning model, outputting the introductory text information corresponding to the first video and the time node information of at least one video segment in the first video, the video segments being important plot segments in the first video; wherein the machine learning model is used to obtain the introductory text information of the video and the time node information of at least one video segment in the video through the video description information of the video.
[0094] According to one or more embodiments of the present disclosure, the time node information includes the start time node and the end time node of the video segment; accordingly, the first video is segmented according to the time node information of the at least one video segment to obtain a video frame sequence corresponding to the at least one video segment, including: segmenting the first video according to the start time node and the end time node of each video segment to extract at least one video segment, wherein the video segment includes multiple video frames; combining at least one of the video segments including multiple video frames to obtain a video frame sequence corresponding to the at least one video segment.
[0095] According to one or more embodiments of the present disclosure, wherein at least one of the video clips includes a plurality of video frames and is combined to obtain a video frame sequence corresponding to the at least one video clip, including: combining at least one of the video clips including a plurality of video frames in chronological order of the video clips to obtain a video frame sequence corresponding to the at least one video clip; or, combining at least one of the video clips including a plurality of video frames in order of importance levels of the video clips to obtain a video frame sequence corresponding to the at least one video clip, wherein the importance level is used to indicate the degree of plot importance of the video clip.
[0096] According to one or more embodiments of the present disclosure, generating a second video based on the video frame sequence and the audio data includes: displaying the video frame sequence on a video track in a video editing interface, and displaying the audio data on an audio track in the video editing interface; in response to receiving an export operation for the second video, combining the audio data on the audio track with the video frame sequence on the video track to generate the second video.
[0097] According to one or more embodiments of the present disclosure, it also includes: in response to receiving a first editing operation for the video frame sequence, adjusting the video frame sequence to obtain a new video frame sequence; and in response to receiving a second editing operation for the audio data, adjusting the audio data to obtain new audio data.
[0098] In a second aspect, according to one or more embodiments of the present disclosure, a video generation device is provided, including:
[0099] A first acquisition module, used to acquire a first video and video description information of the first video;
[0100] A second acquisition module, configured to acquire, according to the video description information, introduction text information corresponding to the first video and time node information of at least one video segment in the first video;
[0101] a segmentation module, configured to segment the first video according to time node information of the at least one video segment, to obtain a video frame sequence corresponding to the at least one video segment;
[0102] The generating module is used to obtain the playing time of the video frame sequence, convert the introduction text information into audio data of the playing time, and generate a second video according to the video frame sequence and the audio data.
[0103] According to one or more embodiments of the present disclosure, the second acquisition module acquires the introductory text information corresponding to the first video and the time node information of at least one video segment in the first video according to the video description information, specifically comprising: inputting the video description information into a preset machine learning model, outputting the introductory text information corresponding to the first video and the time node information of at least one video segment in the first video, wherein the video segment is an important plot segment in the first video; wherein the machine learning model is used to obtain the introductory text information of the video and the time node information of at least one video segment in the video through the video description information of the video.
[0104] According to one or more embodiments of the present disclosure, the time node information includes the start time node and the end time node of the video segment; accordingly, the segmentation module segments the first video according to the time node information of the at least one video segment to obtain a video frame sequence corresponding to the at least one video segment, specifically including: segmenting the first video according to the start time node and the end time node of each video segment to extract at least one video segment, wherein the video segment includes multiple video frames; combining at least one of the video segments including multiple video frames to obtain a video frame sequence corresponding to the at least one video segment.
[0105] According to one or more embodiments of the present disclosure, the segmentation module combines at least one of the video clips including multiple video frames to obtain a video frame sequence corresponding to the at least one video clip, specifically including: combining at least one of the video clips including multiple video frames in chronological order of the video clips to obtain a video frame sequence corresponding to the at least one video clip; or combining at least one of the video clips including multiple video frames in order of importance levels of the video clips to obtain a video frame sequence corresponding to the at least one video clip, wherein the importance level is used to indicate the degree of plot importance of the video clip.
[0106] According to one or more embodiments of the present disclosure, the generation module generates a second video based on the video frame sequence and the audio data, specifically including: displaying the video frame sequence on a video track in a video editing interface, and displaying the audio data on an audio track in the video editing interface; in response to receiving an export operation for the second video, combining the audio data on the audio track with the video frame sequence on the video track to generate the second video.
[0107] According to one or more embodiments of the present disclosure, it also includes: an adjustment module; the adjustment module is used to adjust the video frame sequence in response to receiving a first editing operation on the video frame sequence to obtain a new video frame sequence; and, in response to receiving a second editing operation on the audio data, adjust the audio data to obtain new audio data.
[0108] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0109] The memory stores computer-executable instructions;
[0110] The processor executes the computer-executable instructions stored in the memory to implement the video generation method described in the first aspect and various possible designs of the first aspect.
[0111] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the method for generating a video as described in the first aspect and various possible designs of the first aspect is implemented.
[0112] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video generation method described in the first aspect and various possible designs of the first aspect.
[0113] 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.
[0114] 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.
[0115] Although the subject matter has been described in language specific to structural features and / or methodological logical 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.
Claims
1. A method for generating a video, characterized in that: include: Obtaining a first video and video description information of the first video; According to the video description information, obtaining introduction text information corresponding to the first video and time node information of at least one video segment in the first video; Segmenting the first video according to time node information of the at least one video segment to obtain a video frame sequence corresponding to the at least one video segment; The playing time of the video frame sequence is obtained, the introduction text information is converted into audio data of the playing time, and a second video is generated according to the video frame sequence and the audio data.
2. The method according to claim 1, characterized in that The acquiring, according to the video description information, introduction text information corresponding to the first video and time node information of at least one video segment in the first video includes: The video description information is input into a preset machine learning model, and the introduction text information corresponding to the first video and the time node information of at least one video segment in the first video are output, wherein the video segment is an important plot segment in the first video; wherein the machine learning model is used to obtain the introduction text information of the video and the time node information of at least one video segment in the video through the video description information of the video.
3. The method according to claim 1, characterized in that The time node information includes the start time node and the end time node of the video clip; Correspondingly, segmenting the first video according to the time node information of the at least one video segment to obtain a video frame sequence corresponding to the at least one video segment includes: Segment the first video according to the start time node and the end time node of each video segment to extract at least one video segment, wherein the video segment includes multiple video frames; At least one of the video segments includes a plurality of video frames which are combined to obtain a video frame sequence corresponding to the at least one video segment.
4. The method according to claim 3, characterized in that: The at least one video segment includes a plurality of video frames, and the video frame sequence corresponding to the at least one video segment is obtained by combining the plurality of video frames, including: Combining at least one video segment including a plurality of video frames in a time sequence of the video segments to obtain a video frame sequence corresponding to the at least one video segment; or At least one video segment including multiple video frames is combined in order of importance levels of the video segments to obtain a video frame sequence corresponding to the at least one video segment, wherein the importance level is used to indicate the plot importance of the video segment.
5. The method according to claim 1, characterized in that The step of generating a second video according to the video frame sequence and the audio data comprises: Displaying the video frame sequence on a video track in a video editing interface, and displaying the audio data on an audio track in the video editing interface; In response to receiving an export operation of a second video, the audio data on the audio track is combined with the video frame sequence on the video track to generate the second video.
6. The method according to claim 5, characterized in that Also includes: In response to receiving a first editing operation on the video frame sequence, adjusting the video frame sequence to obtain a new video frame sequence; And, in response to receiving a second editing operation on the audio data, adjusting the audio data to obtain new audio data.
7. A video generation device, characterized in that: include: A first acquisition module, used to acquire a first video and video description information of the first video; A second acquisition module, configured to acquire, according to the video description information, introduction text information corresponding to the first video and time node information of at least one video segment in the first video; a segmentation module, configured to segment the first video according to time node information of the at least one video segment, to obtain a video frame sequence corresponding to the at least one video segment; The generating module is used to obtain the playing time of the video frame sequence, convert the introduction text information into audio data of the playing time, and generate a second video according to the video frame sequence and the audio data.
8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the video generation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method for generating a video as described in any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method for generating a video according to any one of claims 1 to 6.