Video generation method and device, equipment, storage medium and program product
By splitting and extracting features from the novel text, target images and audio clips are generated, and target videos are synthesized, solving the problem of inconsistent video materials and improving the coherence and consistency of novel videos.
Patent Information
- Application Number
- CN202310587425.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2024-11-26
AI Technical Summary
Existing technologies cannot consistently match the scenes in the novel when producing videos, resulting in significant differences in effects and poor continuity.
By splitting the text to be processed, the character features, scene features, and text features of the text fragments are obtained, target images and audio fragments are generated, and finally the target video is synthesized.
The generated video is highly consistent with the characters and scenes in the novel, improving coherence and consistency and avoiding the waste of time searching for materials.
Smart Images

Figure CN119031201A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer processing technology, and in particular to a video generation method, device, equipment, storage medium and program product. Background Art
[0002] With the continuous development of Internet technology, many application programs have been born. Among them, more and more users like to read stories through electronic devices (such as mobile phones, PADs, etc.), especially novels with various storylines.
[0003] In order to enhance the visual experience of users when reading novels, a video will be produced based on the story scenes in the novels. In the process of video production, video materials are generally found through search. However, the video materials obtained through search are usually not completely consistent with the characters and scenes in the novel scenes, resulting in large differences in video effects and poor coherence. Summary of the invention
[0004] In order to solve the above technical problems, the embodiments of the present disclosure provide a video generation method, device, equipment, storage medium and program product to improve the coherence and consistency of the automatic film-forming of novels.
[0005] In a first aspect, an embodiment of the present disclosure provides a video generation method, including:
[0006] Split the text to be processed to obtain at least one text segment;
[0007] Acquire character features, scene features, and text features based on the text segment, and generate a target image corresponding to the text segment;
[0008] Based on the character features and text features corresponding to the text segment, generating a target audio segment corresponding to the text segment;
[0009] A target video corresponding to the text to be processed is generated based on the target image and the target audio segment.
[0010] In a second aspect, an embodiment of the present disclosure provides a video generating device, including:
[0011] A text segmentation module is used to segment the text to be processed to obtain at least one text segment;
[0012] A target image generation module, used to obtain character features, scene features and text features based on the text segment, and generate a target image corresponding to the text segment;
[0013] A target audio segment generating module, used for generating a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment;
[0014] A target video generation module is used to generate a target video corresponding to the text to be processed based on the target image and the target audio segment.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] A storage device for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the video generating method as described in any one of the first aspects above.
[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the video generation method as described in any one of the above-mentioned first aspects.
[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the video generation method as described in any one of the first aspects above is implemented.
[0021] The disclosed embodiments provide a video generation method, apparatus, device, storage medium and program product, the method comprising: splitting a text to be processed to obtain at least one text segment; acquiring character features, scene features and text features based on the text segment, and generating a target image corresponding to the text segment; generating a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment; and generating a target video corresponding to the text to be processed based on the target image and the target audio segment. In the disclosed embodiments, the target image corresponding to the text segment is generated through character features, scene features and text features, the target audio segment corresponding to the text segment is generated based on the character features and text features corresponding to the text segment, and the target video is generated based on the target image and the target audio segment. The problem of users wasting time looking for materials is avoided, and the video generated by the text segment is usually highly consistent with the characters and scenes in the novel scene, thereby improving the coherence and consistency of the novel automatic filming effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0023] Figure 1 A schematic diagram of a video generation method in an embodiment of the present disclosure;
[0024] Figure 2 is a schematic diagram of a target image in an embodiment of the present disclosure;
[0025] Figure 3 is a structural schematic diagram of a video generating device in an embodiment of the present disclosure;
[0026] Figure 4 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0033] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations.
[0034] In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.
[0035] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0036] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0037] As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending a prompt message to the user may be, for example, a pop-up window, in which the prompt message may be presented in text. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0038] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0039] With the continuous development of Internet technology, many application programs have been born. Among them, more and more users like to read stories through electronic devices (such as mobile phones, PADs, etc.), especially novels with various storylines.
[0040] In order to improve the visual experience of users when reading novels, a video will be made based on the story scenes in the novel. There are two main methods for making videos: one method is to obtain a video corresponding to the story scene of the novel through a series of operations such as manually drawing pictures, recording audio, adding background music, and video editing. The other method is to find video materials through offline or online search, and then edit the video materials to obtain a video corresponding to the story scene of the novel.
[0041] In the first video production method mentioned above, a lot of manpower and material resources will be wasted. In the second video production method, the video materials obtained through search may have copyright issues. On the other hand, even if the video materials are stylized, the consistency of the characters and scenes in the novel scenes cannot be achieved. The effect of each frame is quite different and the coherence is poor.
[0042] To solve at least one of the above-mentioned technical problems, an embodiment of the present disclosure provides a video generation method, which includes: splitting a text to be processed to obtain at least one text segment; acquiring character features, scene features and text features based on the text segment, and generating a target picture corresponding to the text segment; generating a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment; and generating a target video corresponding to the text to be processed based on the target picture and the target audio segment.
[0043] In the disclosed embodiment, the target image corresponding to the text segment is generated through the character features, scene features and text features, the target audio segment corresponding to the text segment is generated based on the character features and text features corresponding to the text segment, and the target video is generated based on the target image and the target audio segment. This avoids the problem of users wasting time looking for materials, and the video generated from the text segment is usually highly consistent with the characters and scenes in the novel scene, improving the coherence and consistency of the novel automatic film.
[0044] The video generation method provided in the embodiments of the present disclosure is described in detail below in conjunction with the embodiments and drawings.
[0045] Figure 1 This is a flowchart of a video generation method in an embodiment of the present disclosure. This embodiment is applicable to the case of producing a video based on a novel scene. The method can be executed by a video generation device, and the video generation device can be implemented in software and / or hardware. The video generation method can be executed by an electronic device.
[0046] like Figure 1 As shown, the video generation method provided by the embodiment of the present disclosure mainly includes steps S101-S104.
[0047] S101: Split the text to be processed to obtain at least one text segment.
[0048] In the disclosed embodiment, the text to be processed may refer to a story text including descriptive contents such as characters, scenes, and storylines. Furthermore, the text to be processed may be a novel, a story in a magazine, or a part of a novel.
[0049] In the embodiment of the present disclosure, the text segment may be one sentence or multiple sentences in the text to be processed.
[0050] In one embodiment of the present disclosure, the text to be processed is split according to the sentence pattern and the preset word number unit of the text to be processed to obtain at least one text segment. Specifically, the text to be processed is divided into sentences according to the sentence pattern to obtain multiple sentences. The number of words included in the sentences is judged in sequence, and it is judged whether the number of words in the Nth sentence is within the preset word number range. If so, the Nth sentence is taken as a text segment. If the number of words in the Nth sentence is less than the minimum value in the preset word number range, the number of words in the N+1th sentence is read, and it is judged whether the sum of the number of words in the Nth sentence and the N+1th sentence is within the preset word number range. If so, the Nth sentence and the N+1th sentence are taken as a text segment; if the sum of the number of words in the Nth sentence and the N+1th sentence is less than the minimum value in the preset word number range, the number of words in the N+2th sentence is read, and it is judged whether the sum of the number of words in the Nth sentence, the N+1th sentence, and the N+2th sentence is within the preset word number range. According to the above method, it is judged in sequence until the number of words in multiple sentences is within the preset word number range, and the multiple sentences read are taken as text segments. Then, the sentence after the last sentence in the multiple sentences is judged as the new Nth sentence to judge whether it can be used as a new text segment.
[0051] The preset word count range can be set according to actual conditions, for example, it can be 20 to 30. In one embodiment of the present disclosure, the number of text segments is determined by the specific content of the text to be processed, which is not specifically limited in the embodiment of the present disclosure.
[0052] S102: Acquire character features, scene features, and text features based on the text segment, and generate a target image corresponding to the text segment.
[0053] In one embodiment of the present disclosure, steps S102 and S103 are performed for each text segment, and each text segment generates its corresponding target image and target audio segment.
[0054] In the embodiment of the present disclosure, the role feature refers to the description information about the character in the text segment. A text segment may include one character or multiple characters, which is not specifically limited in the embodiment of the present disclosure.
[0055] In one embodiment of the present disclosure, the character feature may be just the name of a character, or may include some basic description information of the character, wherein the basic description information includes: the character's gender, the character's age group, etc. The character's age group may refer to whether the character is a child, a young person, a middle-aged person, an elderly person, etc., or may be a specific age value. The embodiments of the present disclosure are not specifically limited.
[0056] The scene feature refers to the text information describing the scene in the text segment, which may include: season, location, specific objects in the scene, sound, etc. The scene feature may be "hot summer night, Linxian Bridge", "rainstorm night", "sparkling lake", etc. The scene description information may also include: some descriptions of the actions of the characters in the text segment, such as "eating a pancake seriously".
[0057] The text feature refers to the expression of the character's emotion in the text segment, for example, "laughing out loud", "crying silently", "with tears in the eyes", etc., which are text information about the character's emotion. The text feature is used to indicate the expression of the character in the target image. For example, when the text feature is "laughing out loud", the facial expression of the character in the target image is processed as laughing with the mouth open. When the text feature is "with tears in the eyes", tears are added to the eyes of the character in the target image.
[0058] In one embodiment of the present disclosure, character features, scene features, and text features are input into a pre-trained image generation model to obtain a target image corresponding to the text segment.
[0059] In one embodiment of the present disclosure, a target image corresponding to the text fragment is generated based on the character features, scene features and text features included in the text fragment, including: obtaining target image information corresponding to the character features, wherein the target image information includes a target image picture and / or a target image description information; and generating a target image corresponding to the text fragment based on the target image information, scene features and text features.
[0060] In one embodiment of the present disclosure, the image information can be understood as information indicating the appearance, clothing, accessories, etc. of the character, and the character image information can be a picture or a textual description. For example: "a beautiful face wearing a white torn coat, a black torn skirt, long black hair, earrings, Chinese-style clothes, big eyes, and dark brown pupils."
[0061] In one embodiment of the present disclosure, when the target image information is a target image picture, the target image picture, scene features and text features are input into a pre-trained first image generation model to obtain a target image corresponding to the text segment.
[0062] In one embodiment of the present disclosure, when the target image information is a target image description content, the target image description content, scene features and text features are input into a pre-trained second image generation model to obtain a target image corresponding to the text segment.
[0063] In one embodiment of the present disclosure, the text segment is: "It is a hot summer night. At the bridgehead of Linxian Bridge, Jian Huan is sitting on the side, chewing a pancake seriously", and its corresponding character feature is "Jian Huan", the scene features are: "It is a hot summer night. At the bridgehead of Linxian Bridge", "Sitting on the side", "Eating a pancake seriously", and the text feature is "serious". Among them, the character feature is that the target image information corresponding to the target image information is: "A beautiful face with long black hair, wearing a white torn coat, a black torn skirt, and a Chinese-style clothes, big eyes, dark brown pupils, and a girl". Furthermore, the content input to the pre-trained second image generation model is: "At the bridgehead of Linxian Bridge, the summer night is hot. At the bridgehead of Linxian Bridge, at the bridgehead of Linxian Bridge, a beautiful face with long black hair, wearing a white torn coat, a black torn skirt, and a Chinese-style clothes, big eyes, dark brown pupils, and a girl is sitting on the side, chewing a pancake seriously", and the second image generation model outputs the corresponding target image, such as Figure 2 shown.
[0064] Among them, the first image generation model is different from the second image generation model. The first image generation model is trained based on character image pictures, scene features and text features, and the second image generation model is trained based on character image description content, scene features and text features.
[0065] In an embodiment of the present disclosure, a method for determining target image information is provided. Specifically, the method for determining target image information includes: obtaining at least one candidate character image and image description information matching the character feature based on the character feature, and displaying the candidate character image; and in response to receiving a selection instruction for the candidate character image, using the selected candidate character image and the image description information corresponding to the candidate character image as the target image information corresponding to the character feature.
[0066] In the disclosed embodiment, a character library is pre-built, and the character library includes image pictures and image description information, and one image picture corresponds to one image description information. It should be noted that the materials in the character library can be used when any text to be processed generates a video.
[0067] Further, the text to be processed is analyzed to obtain multiple character features included in the text to be processed. For each character feature, the image description information in the character library is matched based on the character feature to obtain multiple image description information matching the character feature, and the image pictures corresponding to the multiple image description information are displayed as the character images to be selected in the terminal interface. Further, the user can view the multiple character images to be selected corresponding to the character feature in the terminal interface, and in response to the user's selection operation of the character image to be selected, the character image to be selected selected by the user is used as the target image information corresponding to the character feature. Further, the image description information corresponding to the image picture selected by the user is used as the target image description information corresponding to the character feature.
[0068] It should be noted that the target image information corresponding to each task role feature in the text to be processed is determined in the above manner. In the process of generating a target image based on a text segment, the target image information corresponding to the role feature is read based on a predetermined determination relationship and the role feature included in the text segment.
[0069] In one embodiment of the present disclosure, a target image corresponding to the text fragment is generated based on the character features, scene features and text features included in the text fragment, including: generating an initial image based on the target image information, scene features and text features; editing elements in the initial image to obtain an edited image, and performing style transfer processing on the initial image and / or the edited image to obtain a target image.
[0070] In the disclosed embodiment, after the target image corresponding to the text segment is generated based on the target image information, scene features and text features, step S104 can be directly executed. The image generated based on the character features, scene features and text features included in the text segment can also be processed again.
[0071] In the embodiment of the present disclosure, an initial image is generated based on the target image information, scene features and text features, which is similar to the method of generating the target image in the above embodiment. For details, please refer to the description in the above embodiment, and the embodiment of the present disclosure will no longer perform specific processing.
[0072] In the disclosed embodiment, the elements in the initial image include elements describing the background in the initial image and elements describing the image of the characters in the initial image. The elements in the initial image can be clothing, skin, hair, eyes, etc. of the characters, and can also be buildings, trees, etc. in the background.
[0073] In one embodiment of the present disclosure, editing the elements in the initial picture to obtain the edited picture includes: editing the hairstyle, hair color, pupil color, clothing color, etc. of the element characters in the initial picture. It may also include: editing the shape, color, etc. of the house of the element characters in the initial picture.
[0074] The style transfer refers to transferring the target style to the original image or the edited image. The target style may be an animation style, an oil painting style, etc. The target style may be set according to the actual situation of the user and is not specifically limited in the embodiments of the present disclosure.
[0075] S103: Generate a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment.
[0076] In one embodiment of the present disclosure, each character feature corresponds to one or more audio parameters. Further, each character feature corresponds to a specific audio parameter under its specific text feature. For example, when character A is sad, it corresponds to audio parameter 1, when he is happy, it corresponds to audio parameter 2, and when he is normal, it corresponds to audio parameter 3. Further, the narration content corresponds to its specific audio parameter.
[0077] In an embodiment of the present disclosure, the text content of a text segment, as well as its corresponding character features and text features, are input into an AI audio synthesis model to generate a target audio segment corresponding to the text segment.
[0078] In one embodiment of the present disclosure, generating a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment includes: obtaining dialogue content included in the text segment, character features corresponding to the dialogue content, and text features corresponding to the dialogue content; inputting the dialogue content and the text features into an audio synthesis model corresponding to the character features to obtain a dialogue audio segment corresponding to the dialogue content; and / or inputting the narration content included in the text segment into a narration audio synthesis model to obtain a narration audio segment corresponding to the narration content; and synthesizing the dialogue audio segment and the narration audio segment based on the positional relationship between the dialogue content and the narration content in the text segment to obtain a target audio segment.
[0079] In one embodiment of the present disclosure, the text content in the text segment is divided according to the characters, that is, the characters to which the text content belongs are determined, for example: the dialogue content corresponding to character A, the dialogue content corresponding to character 2, and the narration content.
[0080] In one embodiment of the present disclosure, if the text segment only includes narration content, the text segment is input into a narration audio synthesis model to obtain a narration audio segment corresponding to the narration content, and the narration audio segment is used as the target audio segment corresponding to the text segment.
[0081] In one embodiment of the present disclosure, if the text segment only includes dialogue content, the character characteristics to which the dialogue content belongs and the corresponding text emotion characteristics are determined, the dialogue content, the character characteristics to which it belongs, and the corresponding text emotion characteristics are input into an audio synthesis model to obtain a dialogue audio segment corresponding to the dialogue content, and the dialogue audio segment is used as the target audio segment corresponding to the text segment.
[0082] In one embodiment of the present disclosure, if the text segment includes dialogue content and narration content, the dialogue audio segment and the narration audio segment are synthesized based on the positional relationship between the dialogue content and the narration content in the text segment to obtain the target audio segment.
[0083] S104: Generate a target video corresponding to the text to be processed based on the target image and the target audio segment.
[0084] In an embodiment of the present disclosure, the target image and the at least one audio segment are synthesized according to the order of the text segments in the text to be processed to generate a target video corresponding to the text to be processed.
[0085] In one embodiment of the present disclosure, a target video corresponding to the text to be processed is generated based on a target image and a target audio clip, including: determining a video template and background audio corresponding to the text to be processed based on a text type corresponding to the text to be processed; and generating a target video corresponding to the text to be processed based on the target image, the target audio clip, the video template and the background audio.
[0086] In one embodiment of the present disclosure, the text type corresponding to the to-be-processed text may be a novel type. For example, the text type may be martial arts, history, reasoning, romance, science fiction, etc.
[0087] In one embodiment of the present disclosure, the correspondence between the text type and the video template is preset, and then the corresponding video model is obtained according to the text type corresponding to the text to be processed.
[0088] In one embodiment of the present disclosure, the correspondence between the text type and the background audio is preset, and then the corresponding background audio is obtained according to the text type corresponding to the text to be processed. In a specific embodiment, when the text type is history, the corresponding background music can be traditional Chinese music. When the text type is reasoning, the corresponding background music can be suspense music. When the text type is romance, the corresponding background music can be love song background music.
[0089] In the disclosed embodiment, the video template includes editing information of each video material, for example: the transition method between target pictures, and the time axis relationship between the target picture and the target audio clip.
[0090] In one embodiment of the present disclosure, at least one target picture, at least one target audio clip, and background audio are input into a video template to obtain a target video.
[0091] In one embodiment of the present disclosure, the method further includes: determining a time segment corresponding to the target picture in the target video; and adding subtitles formed based on the text segment to the target picture based on the time segment.
[0092] In one embodiment of the present disclosure, at least one target image, at least one target audio segment, background audio, and at least one text segment are input into a video template to obtain a target video, wherein the time axis of the text segment is consistent with the corresponding target audio segment and the corresponding target image.
[0093] The disclosed embodiments provide a video generation method, apparatus, device, storage medium and program product, the method comprising: splitting a text to be processed to obtain at least one text segment; acquiring character features, scene features and text features based on the text segment, and generating a target image corresponding to the text segment; generating a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment; and generating a target video corresponding to the text to be processed based on the target image and the target audio segment. In the disclosed embodiments, the target image corresponding to the text segment is generated through character features, scene features and text features, the target audio segment corresponding to the text segment is generated based on the character features and text features corresponding to the text segment, and the target video is generated based on the target image and the target audio segment. The problem of users wasting time looking for materials is avoided, and the video generated by the text segment is usually highly consistent with the characters and scenes in the novel scene, thereby improving the coherence and consistency of the novel automatic filming effect.
[0094] Figure 3This is a flowchart of a video generation method in an embodiment of the present disclosure. This embodiment is applicable to the situation of making a video based on a novel scene. The method can be executed by a video generation device, and the video generation device can be implemented in software and / or hardware.
[0095] like Figure 3 As shown, the video generating device provided by the embodiment of the present disclosure mainly includes: a text segmentation module 31, a target picture generating module 32, a target audio segment generating module 33 and a target video generating module 34.
[0096] The text segmentation module 31 is used to segment the text to be processed to obtain at least one text segment;
[0097] A target image generation module 32, configured to obtain character features, scene features and text features based on the text segment, and generate a target image corresponding to the text segment;
[0098] A target audio segment generating module 33, configured to generate a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment;
[0099] The target video generation module 34 is used to generate a target video corresponding to the text to be processed based on the target image and the target audio segment.
[0100] In one embodiment of the present disclosure, the target video generation module 34 includes: an audio and template determination unit, which is used to determine the video template and background audio corresponding to the text to be processed based on the text type corresponding to the text to be processed; and a target video generation unit, which is used to generate the target video corresponding to the text to be processed based on the target picture, the target audio clip, the video template and the background audio.
[0101] In one embodiment of the present disclosure, the target video generation module 34 also includes: a time segment reading unit, used to determine the time segment corresponding to the target image in the target video; and a subtitle adding unit, used to add subtitles formed based on the text segment to the target image based on the time segment.
[0102] In one embodiment of the present disclosure, the target image generation module 32 includes: a target image information acquisition unit, used to acquire target image information corresponding to the character characteristics, wherein the character characteristics include: character name and / or character basic information, and the target image information includes a target image picture and / or target image description information; a target image generation unit, used to generate a target image corresponding to the text fragment based on the target image information, the scene characteristics and the text characteristics.
[0103] In one embodiment of the present disclosure, the device also includes: a unit for determining a character image to be selected, which is used to match in a preset character library based on the character characteristics to obtain at least one character image to be selected and its image description information that matches the character characteristics; a character image to be selected module, which is used to display the character image to be selected; and a target image information determination module, which is used to respond to receiving a selection instruction for the character image to be selected and use the selected character image and the image description information corresponding to the character image to be selected as the target image information corresponding to the character characteristics.
[0104] In one embodiment of the present disclosure, a target image generation module includes: an initial image generation unit, used to generate an initial image based on the target image information, scene features and text features; an initial image editing unit, used to edit elements in the initial image to obtain an edited image; and a style transfer unit, used to perform style transfer processing on the initial image and / or the edited image to obtain a target image.
[0105] In one embodiment of the present disclosure, the target audio segment generation module 33 includes: a dialogue content division unit, which is used to obtain the dialogue content included in the text segment, the character features corresponding to the dialogue content, and the text features corresponding to the dialogue content; a dialogue audio segment generation unit, which is used to input the dialogue content and the text features into an audio synthesis model corresponding to the character features to obtain a dialogue audio segment corresponding to the dialogue content; a narration voice segment generation unit, which is used to input the narration content included in the text segment into a narration audio synthesis model to obtain a narration audio segment corresponding to the narration content; and a target audio segment generation unit, which is used to synthesize the dialogue audio segment and the narration audio segment based on the positional relationship between the dialogue content and the narration content in the text segment to obtain a target audio segment.
[0106] In one embodiment of the present disclosure, the text segmentation module 31 is specifically used to segment the text to be processed according to the sentence structure and the preset word count range of the text to be processed to obtain at least one text segment.
[0107] The video generating device provided in the embodiment of the present disclosure can execute the steps executed in the video generating method provided in the method embodiment of the present disclosure, and the execution steps and beneficial effects are not repeated here.
[0108] Figure 4 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 4, which shows a schematic diagram of the structure of an electronic device 400 suitable for implementing the embodiment of the present disclosure. The electronic device 400 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable terminal devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. Figure 4 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.
[0109] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403 to implement the video generation method of the embodiment described in the present disclosure. In the RAM 403, various programs and data required for the operation of the terminal device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0110] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the terminal device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The terminal device 400 is shown to have 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.
[0111] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the video generation method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0112] 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.
[0113] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0114] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0115] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the terminal device, the terminal device: splits the text to be processed to obtain at least one text segment; obtains role features, scene features and text features based on the text segment, and generates a target picture corresponding to the text segment; generates a target audio segment corresponding to the text segment based on the role features and text features corresponding to the text segment; and generates a target video corresponding to the text to be processed based on the target picture and the target audio segment.
[0116] Optionally, when the above one or more programs are executed by the terminal device, the terminal device may also execute other steps described in the above embodiments.
[0117] 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, but not limited to, 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 a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0118] 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.
[0119] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] In addition, although each operation is described in a specific order, this should not be required to perform these operations 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.
[0124] 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 video generation method, It is characterized in that include: Split the text to be processed to obtain at least one text segment; Acquire character features, scene features, and text features based on the text segment, and generate a target image corresponding to the text segment; Based on the character features and text features corresponding to the text segment, generating a target audio segment corresponding to the text segment; A target video corresponding to the text to be processed is generated based on the target image and the target audio segment.
2. The method according to claim 1, It is characterized in that The step of generating a target video corresponding to the text to be processed based on the target picture and the target audio segment includes: Based on the text type corresponding to the text to be processed, determine the video template and background audio corresponding to the text to be processed; A target video corresponding to the text to be processed is generated based on the target image, the target audio clip, the video template and the background audio.
3. The method according to claim 1 or 2, It is characterized in that The method further comprises: Determine the time segment corresponding to the target picture in the target video; A subtitle formed based on the text segment is added to the target picture based on the time segment.
4. The method according to claim 1, It is characterized in that The acquiring character features, scene features, and text features based on the text segment and generating a target image corresponding to the text segment includes: Acquire target image information corresponding to the character features, wherein the character features include: a character name and / or basic character information, and the target image information includes a target image picture and / or target image description information; A target image corresponding to the text segment is generated based on the target image information, the scene features and the text features.
5. The method according to claim 4, It is characterized in that The step of obtaining target image information corresponding to the character feature includes: Based on the character features, matching is performed in a preset character library to obtain at least one character image to be selected that matches the character features and its image description information; Displaying the image of the role to be selected; In response to receiving a selection instruction for the character image to be selected, the selected character image to be selected and the image description information corresponding to the character image to be selected are used as target image information corresponding to the character characteristics.
6. The method according to claim 4, It is characterized in that The generating a target image corresponding to the text segment based on the target image information, scene features and text features includes: Generate an initial image based on the target image information, scene features and text features; Editing elements in the initial image to obtain an edited image; Perform style transfer processing on the initial image and / or the edited image to obtain a target image.
7. The method according to claim 1, It is characterized in that The step of generating a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment includes: Acquire the dialogue content included in the text segment, the character features corresponding to the dialogue content, and the text features corresponding to the dialogue content; Inputting the dialogue content and the text features into the audio synthesis model corresponding to the character features to obtain a dialogue audio segment corresponding to the dialogue content; and / or, Inputting the narration content included in the text segment into a narration audio synthesis model to obtain a narration audio segment corresponding to the narration content; Based on the positional relationship between the dialogue content and the narration content in the text segment, the dialogue audio segment and the narration audio segment are synthesized to obtain a target audio segment.
8. The method according to claim 1, It is characterized in that The text to be processed is split to obtain at least one text segment, including: The text to be processed is split according to the sentence structure and the preset word count range of the text to be processed to obtain at least one text segment.
9. A video generating device, It is characterized in that include: A text segmentation module is used to segment the text to be processed to obtain at least one text segment; A target image generation module, used to obtain character features, scene features and text features based on the text segment, and generate a target image corresponding to the text segment; A target audio segment generating module, used for generating a target audio segment corresponding to the text segment based on the character features and text features corresponding to the text segment; A target video generation module is used to generate a target video corresponding to the text to be processed based on the target image and the target audio segment.
10. An electronic device, It is characterized in that The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the video generating method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the video generating method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program or instructions, wherein the computer program or instructions, when executed by a processor, implements the video generation method according to any one of claims 1 to 8.
Citation Information
Cited By
Video generation method and device, equipment, medium and product
CN120416622A
Video generation method and device based on electronic book and related product
CN120529144A
