Video template variation method and device, storage medium and program product
By splitting the material type and templated rendering parameters of the initial video template, multiple materialized templates are generated, which solves the problems of monotonous video style and poor generation flexibility in the existing technology, and realizes efficient batch generation of diverse styles of videos.
Patent Information
- Application Number
- CN202510443790.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-04-09
AI Technical Summary
In the prior art, the video style generated based on batch generation based on preset templates is monotonous and has serious homogeneity, and the flexibility of video generation is poor.
By obtaining the initial video template, using the material type as the split variable, the initial video template is parsed, and information fragments corresponding to multiple material types are obtained, rendering parameter information is extracted, and templated to obtain a variety of materialized templates. Each template is used to describe the rendering rules of a video material.
It improves the flexibility and content diversity of video generation, and realizes efficient batch generation of diverse styles of videos.
Smart Images

Figure CN120186432A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of information processing, and in particular, to a method, device, storage medium, and program product for video template variableization. Background Art
[0002] In the field of video generation, video editing software can be used to manually edit materials to obtain videos that meet personal needs. However, video editing software has a certain learning threshold, and the labor cost of using it is relatively high, making it difficult to achieve batch video generation.
[0003] In order to reduce the learning threshold and improve video generation efficiency, some video editing software provides preset templates, where the text or images in the preset templates are allowed to be replaced. The user's materials are used to replace the text or images in the preset templates to generate the videos required by the user. Among them, the method of directly replacing the text or images in the preset templates to generate new videos simplifies the video generation process and is suitable for batch video generation. However, the videos generated in batches based on preset templates have a monotonous style, serious homogenization, and poor flexibility in video generation. Summary of the Invention
[0004] Embodiments of this application provide a method, device, storage medium, and program product for video template variableization, which are used to improve the flexibility and content diversity of video generation, and further achieve efficient batch generation of videos with diverse styles.
[0005] An embodiment of this application provides a method for video template variableization, including: obtaining an initial video template, where the initial video template includes rendering rules for various video materials required for video generation and the hierarchical relationship between various video materials; parsing the initial video template with the material type as the splitting variable to obtain information segments corresponding to various material types; respectively extracting rendering parameter information corresponding to various material types from the information segments corresponding to various material types; and templatizing the rendering parameter information corresponding to various material types to obtain various materialized templates, where each materialized template is used to describe the rendering rules of a video material.
[0006] An embodiment of this application also provides an electronic device, including: a processor and a memory, where the memory stores a computer program, and when the computer program is executed by the processor, the processor can implement each step in the method for video template variableization provided by the embodiment of this application.
[0007] An embodiment of this application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor can implement each step in the method for video template variableization provided by the embodiment of this application.
[0008] The embodiments of the present application also provide a computer program product, including computer programs / instructions, which, when executed by a processor, enable the processor to implement each step in the video template variable method provided by the embodiments of the present application.
[0009] In the embodiments of the present application, by obtaining an initial video template and using the material type as a splitting variable, the initial video template is parsed to obtain information segments corresponding to multiple material types; further, rendering parameter information corresponding to each of the multiple material types is respectively extracted from the information segments corresponding to each of the multiple material types; the rendering parameter information corresponding to each of the multiple material types is templatized to obtain multiple materialized templates, and each materialized template is used to describe the rendering rules of a video material. Applying the multiple materialized templates to video generation can improve the flexibility and content diversity of video generation, and thus achieve efficient batch generation of diversified style videos. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0011] Figure 1 is a schematic flowchart of a video template variable method provided by an exemplary embodiment of the present application;
[0012] Figure 2 is a schematic flowchart of a video batch generation method provided by an exemplary embodiment of the present application;
[0013] Figure 3 is an interaction schematic diagram of another video batch generation method provided by an exemplary embodiment of the present application;
[0014] Figure 4 is a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0015] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Apparently, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0016] It should be noted that in the case where the embodiments of the present application involve user information, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject. Additionally, various models (including but not limited to language models or large models) involved in the present application comply with relevant laws and standards.
[0017] To solve the problems in the prior art that the videos generated in batches based on a preset template have a monotonous style, serious homogenization, and poor flexibility in video generation. In the embodiments of the present application, by obtaining an initial video template and using the material type as a splitting variable to parse the initial video template, information segments corresponding to multiple material types are obtained; further, from the information segments corresponding to each of the multiple material types, the rendering parameter information corresponding to each of the multiple material types is respectively extracted; the rendering parameter information corresponding to each of the multiple material types is templatized to obtain multiple materialized templates, and each materialized template is used to describe the rendering rules of a video material. Applying the multiple materialized templates to video generation can improve the flexibility and content diversity of video generation, and thus achieve efficient batch generation of videos with diverse styles.
[0018] The following will, with reference to the accompanying drawings, elaborate on the technical solutions provided by each embodiment of the present application.
[0019] Figure 1 It is a schematic flowchart of a method for variable video templates provided by an exemplary embodiment of the present application. As Figure 1 shown, the method includes:
[0020] S11. Obtain an initial video template, where the initial video template includes the rendering rules of multiple video materials required for generating a video and the hierarchical relationship between the multiple video materials;
[0021] S12. Use the material type as a splitting variable to parse the initial video template to obtain information segments corresponding to multiple material types;
[0022] S13. Respectively extract the rendering parameter information corresponding to each of the multiple material types from the information segments corresponding to each of the multiple material types;
[0023] S14. Templatize the rendering parameter information corresponding to each of the multiple material types to obtain multiple materialized templates, and each materialized template is used to describe the rendering rules of a video material.
[0024] In the embodiments of the present application, the initial video template may be an existing video production framework. Among them, the video production framework may be preset or exported after video editing by an editing software. Regardless of which method, the initial video template includes rendering rules for generating various video materials required for video provision and the hierarchical relationship between various video materials. In the embodiments of the present application, the specific method of obtaining the initial video template is not limited. For example, the initial video template may be a commonly used video template preset by the system by default, or a custom video template created by the user according to requirements, or a video template imported from other external sources.
[0025] Among them, the various video materials required for video provision refer to various multimedia elements that make up the video content. The joint action of various video materials can provide rich content for the video. In the embodiments of the present application, the specific type of video materials is not limited. For example, the video materials may be videos, images, texts, or audios. It should be noted here that the initial video template does not include video materials, but includes rendering rules and hierarchical relationships. The rendering rules correspond to the types of video materials, and the hierarchical relationship describes the display order and occlusion logic existing between different video materials.
[0026] In the embodiments of the present application, the rendering rules for various video materials may be specific parameters and operation methods followed when synthesizing various video materials into the video to achieve the presentation effect of various video materials in the video. In the embodiments of the present application, the specific type of rendering rules is not limited. For example, the rendering rules may include special effect rules, which are used to describe but are not limited to: visual special effects such as blur, shadow, and halo in the video; they may also include color adjustment, which is used to describe but is not limited to: brightness, contrast, saturation, etc. in the video; they may also include filter effects, which are used to describe but are not limited to: vintage, black and white, color filters, etc. in the video. In addition, the rendering rules may also be animation effects such as fade-in, fade-out, zoom, and rotation. In the embodiments of the present application, the rendering effects represented by the specific parameters in the rendering rules are not limited.
[0027] Among them, each type of video material has its corresponding rendering rules. For example, if the type of video material is video, its rendering rules may include adjusting resolution, setting playback speed, adding filters or controlling display duration, etc.; if the type of video material is image, its rendering rules may include scaling, position coordinates, transparency or rotation angle, etc.; if the type of video material is text, its rendering rules may include defining font style, font color, animation effect or dynamic path, etc.; if the type of video material is audio, its rendering rules may include volume adjustment, fade-in and fade-out effects and synchronization points of the video screen, etc. The rendering rules of each type of video material are defined independently. For example, the rendering rule for a video material that is a piece of background music may be "the volume is set to 50%, and the video starts playing at the 5th second and continues until the end"; and the rendering rule for a video material that is a piece of text content may be "white sans serif font, displayed in the upper right corner of the screen with a 0.5 second fade-in effect".
[0028] In the embodiment of the present application, the hierarchical relationship between multiple video materials describes the display order and occlusion logic of different material types in video synthesis. In the embodiment of the present application, the specific type of the hierarchical relationship between different material types is not limited. For example, the hierarchical relationship between different material types can be a picture-in-picture effect, in which one material type is located at a higher level and covers another material type at a lower level; it can also be a special effect superposition, where multiple special effect layers are superimposed together to form a complex visual effect; it can also be a text content overlay, where the text content is located at a higher level and covers the video or image at a lower level. Among them, the hierarchical relationship determines the front and back positions of different material types in the picture, affects the occlusion and display effects between different material types, and different visual effects can be achieved by adjusting the hierarchical relationship between different material types, so that the video is more in line with the creative intention. For example, the material type is a video material, which can be located at a lower level as a background layer to provide basic visual content for the entire video; the material type is an image material, which can be located in the middle layer, covering the video material, used to highlight specific information or decoration; the material type is a text material, which can be located at the highest level as a foreground layer to ensure that the text information is clear and readable. This hierarchical arrangement allows text to effectively convey information, while images and videos provide a rich visual background. In addition, the hierarchical relationship between different types of materials can be flexibly adjusted according to creative needs. For example, in order to highlight a certain image material, its level can be raised so that it covers the text material. Or, in order to create a picture-in-picture effect, a video material can be placed at a higher level so that it appears on top of another video material. In this way, creators can precisely control the visual hierarchy of each element in the video, thereby achieving richer and more diverse video effects.
[0029] Further, after obtaining the initial video template, the initial video template is parsed using the material type as the splitting variable. Herein, the material type refers to different types of video materials, which is a classification criterion for differentiating different video materials, and the splitting variable refers to the independent information segments obtained by dividing the initial video template according to the material type when parsing the initial video template. For example, if the initial video template contains two types of video materials, i.e., images and audio, the initial video template will be split into independent information segments of images and audio according to the material type as the classification criterion, and subsequent processing will be performed separately.
[0030] Among them, the information segment refers to the information segment extracted from the initial video template and corresponding to the material type, and the information segment may include the rendering parameter information of the corresponding material type. For example, an information segment may include rendering parameter information such as path information, playing time, and special effect application for the material type.
[0031] In the embodiments of the present application, the rendering parameter information is used to describe at least one attribute of a material file of a certain material type. Each attribute can be used as a rendering parameter, and the attribute value of each attribute in the initial video template is used as the default parameter value of the corresponding rendering parameter. The rendering parameters with default parameter values form a rendering parameter information corresponding to the material file of this material type. Herein, the "material file" refers to various resource files used in the materialized template, mainly including various video materials, such as pictures, videos, and audio, etc. The rendering parameter information can be used to control the rendering logic of the material file so that the rendering effect presented by the material file in the finally generated video can be obtained. The rendering parameter information quantitatively describes the attributes of the material file, so that the attributes of the video material are converted into the attributes of the rendering parameter information, and the rendering effect of the video material in the finally generated video is controlled through the rendering parameter information. In other words, the attributes of the video material are described as corresponding rendering parameters by the rendering parameter information, and the rendering parameters with default parameter values define the attribute values of a certain attribute of the material file.
[0032] Among them, the rendering parameter information can be extracted separately from the information segments corresponding to various material types. The rendering parameter information corresponding to each material type includes at least one rendering parameter and its corresponding default parameter value, and each rendering parameter is used to describe the attribute of a material file of a certain material type. In the embodiments of the present application, the specific attributes corresponding to the rendering parameters of various material types are not limited.
[0033] In the embodiments of the present application, templatization can convert the rendering parameter information corresponding to various material types from the rendering parameters with fixed configuration default parameter values into a variable parameter set with dynamically replaceable parameter values. Among them, by templatizing the rendering parameter information corresponding to various material types, various materialized templates corresponding to various material types can be obtained. Each materialized template is used to describe the rendering rules of a material type, and the rendering rules include at least one variable parameter, and each variable parameter is associated with multiple candidate parameter values, so as to control the rendering effect of video generation.
[0034] In the embodiments of the present application, a materialized template is the result of templatizing the rendering parameter information corresponding to various material types. It includes a placeholder for the path information of the material file, as well as variable parameters and multiple candidate parameter values associated therewith. The materialized template describes the rendering rules of the material file of the corresponding material type in video generation. The rendering rules are used to describe the rendering logic followed by this type of video material during the video rendering process, so as to control the expected rendering effect of the presentation of this material file in the generated video. Among them, the materialized template formed by converting the rendering parameter information from the rendering parameters with fixed configuration having default parameter values into a dynamically replaceable variable parameter set can flexibly adjust the rendering effect of the material file in the generated video in different scenarios by assigning different candidate parameter values to the variable parameters. Among them, the rendering parameter information is templatized to form a variety of materialized templates that can be modularly recombined. For the materialized templates for different material types, different target video templates can be recombined, and then diversified videos can be generated in batches, without the need to design and adjust the individual video templates for each video, which not only saves time and human resources, but also improves the flexibility and content diversity of video template generation, and then realizes the efficient batch generation of diversified style videos.
[0035] For another example, multiple materialized templates can be flexibly selected and combined for use. Different materialized templates can be selected according to specific requirements and combined together to generate more complex and diversified video content. For example, one materialized template can define the background effect of the video, and another materialized template can define the animation effect of the text. By combining these two materialized templates, a video with rich visual effects can be quickly generated.
[0036] For example, for the same materialized template, various attributes and attribute values of the material type corresponding to the materialized template can also be flexibly set. For example, the transparency of the image material, the playback speed of the video material, or the font size of the text material can be adjusted, so as to achieve fine control of the video content. The materialized template improves the flexibility of video generation, can significantly improve the efficiency and quality of video generation, and at the same time meet diversified creative requirements.
[0037] In the embodiments of the present application, the specific content of the candidate parameter values associated with the variable parameters obtained after templating the rendering parameter information corresponding to various material types is not limited. For example, for a materialized template with a video material type of video, the configured optional parameter values may include "playback speed" (optional values: 0.5x speed, 1x speed, 1.5x speed), "filter type" (optional values: black and white, vintage, vivid), "transparency" (optional range: 0% - 100%), etc.; for a materialized template with a video material type of image, the configured optional parameter values may include "scaling ratio" (optional values: 50%, 100%, 200%), "rotation angle" (optional range: 0° - 360°), "layer position" (optional values: centered, upper left corner, lower right corner), etc.
[0038] Among them, by associating multiple candidate parameter values with the variable parameters, the variable parameters can be flexibly adjusted according to requirements, improving the flexibility and diversity of video template generation, and thus achieving efficient batch generation of videos with diverse styles.
[0039] In an optional embodiment, the initial video template can be implemented as an MLT (Media Lovin' Toolkit) template and stored in the XML (eXtensible Markup Language) structured data format, that is, an XML document.
[0040] In an optional embodiment, using the material type as a splitting variable, the initial video template is parsed to obtain information segments corresponding to various material types, including: loading the XML document corresponding to the initial video template, the XML document includes a root element and multiple non-root elements connected to the root element, and multiple specific elements are included in the multiple non-root elements, each specific element is used to describe the rendering rules of a material type; starting from the root element, traversing the non-root elements in the XML document to identify multiple specific elements; extracting multiple information segments where the multiple specific elements are located as information segments corresponding to various material types. Among them, the XML document of the initial video template can be loaded into memory to form a parseable tree structure. In the embodiments of the present application, the XML document can be loaded into memory through a DOM (Document Object Model) parser to form a tree structure parsing method.
[0041] Among them, the tree structure includes a root element and non-root elements. The root element is the top-level node of the XML document, and the non-root elements are all directly or indirectly nested under the root element. An XML document has exactly one root element, and the root element is the first element of the XML document and can be used as the starting point of the XML document. For example, <template>is the root element, and its attribute version = "1.0" represents the version number of the initial video template. Other elements (such as <metadata> 、 <images>) are all its child elements and are also non-root elements.
[0042] Among them, non-root elements are child elements directly or indirectly nested under the root element, and are used to divide different information segments of the initial video template according to the material type. Multiple specific elements are included in the non-root elements. Starting from the root element and traversing the non-root elements in the XML document, multiple specific elements can be identified. A specific element is an element that can directly describe the rendering rules of a certain material type, and each specific element corresponds to a material type. For example, if the material type is an image, then is a specific element, and its <path> 、 <position>The equal sub-nodes can define the path and position of the image.
[0043] For example, the XML document corresponding to the initial video template is as follows:
[0044]
[0045] Load the XML document corresponding to the initial video template and recognize the root element <template>, from the root element <template>Start with non-root elements in the XML document <metadata>And <media>Traverse, in non-root elements <media>Specific elements are recognized below <video>and <audio>, extract specific elements <video>The video material information segment where it is located:
[0046]
[0047] Extract specific elements <audio>The audio material information segment where it is located:
[0048]
[0049] By extracting these information segments, the system can quickly identify the attributes of the material file and perform rendering based on their attribute values. This design of extracting information segments significantly improves the flexibility and diversity of video generation, meets the diverse creation needs, and provides a technical basis for efficient batch video generation.
[0050] In an optional embodiment, starting from the root element, traverse the non-root elements in the XML document to identify multiple specific elements, including: S1. Starting from the root element, traverse the non-root elements in the XML document; S2. For the currently traversed non-root element, obtain the element tag included in the currently traversed non-root element; S3. If the element tag is a specific tag, determine whether the currently traversed non-root element contains sub-elements; S4. If the currently traversed non-root element contains sub-elements, use the sub-elements as the currently traversed non-root element and return to execute step S2; S5. If the element tag is a non-specific tag, continue to the next non-root element and return to execute step S2; S6. If the currently traversed non-root element does not contain sub-elements, use the currently traversed non-root element as a specific element.
[0051] Among them, in step S1, starting from the root element of the XML document, visit the non-root elements one by one for traversal. In the embodiments of the present application, the specific implementation strategy of traversal is not limited. For example, traversal can be implemented using a depth-first search algorithm or a breadth-first search algorithm. In the embodiments of the present application, taking the depth-first search algorithm as an example, the process of traversing the non-root elements in the XML document to identify multiple specific elements is described in detail.
[0052] Next, execute step S2. For the currently traversed non-root element, obtain the element tag included in the currently traversed non-root element. Among them, in the XML document, the element tag is the identifier within angle brackets (<>), which is used to mark the type and semantic meaning of the element. Different material types are distinguished by the name of the element tag. For example, represents an image material; the specific position of the material is located through the hierarchical relationship of the element tags. For example, <images>Under the container element.
[0053] After obtaining the element tag included in the current non-root element being traversed, determine whether the element tag is a specific tag. Among them, the specific tag can be a predefined set of key tags, representing the element tags that need to be specially processed in the XML document, and are used to identify the types of materials to be extracted. For example, <text>, and <video>Can be specific tags because they describe the rendering rules for different material types. Non-specific tags are tags that do not belong to a material type. For example, a non-specific tag can be like <images>or <texts>Container tags for organizational structures, or can also be such as <metadata>or <author>Metadata tags for describing the overall information of the initial video template, or it can be such as <settings>or <global-effects>Auxiliary tag for defining global parameters.
[0054] Next, execute step S3 or S5. If step S5 is executed, that is, the element tag is a non-specific tag, continue with the next non-root element and return to execute step S2.
[0055] If step S3 is executed, that is, the element tag is a specific tag, continue to determine whether the currently traversed non-root element contains sub-elements. Among them, the sub-elements can be other elements nested inside the currently traversed non-root element. For example, The <path>Element.
[0056] Next, execute step S4 or S6. If step S4 is executed, that is, the non-root element currently traversed contains sub-elements, then the sub-elements are used as the non-root element currently traversed, and return to execute step S2. If step S6 is executed, that is, the non-root element currently traversed does not contain sub-elements, then the non-root element currently traversed is used as a specific element. Among them, step S4 is the recursive processing when there are sub-elements. The sub-elements of the non-root element currently traversed are set as the new traversal starting point, and steps S2 - S6 are re-executed for each sub-element. After the recursion ends, continue to traverse other non-root elements. Step S6 is the end collection when there are no sub-elements, and the non-root element currently traversed is used as a specific element.
[0057] For example, the XML document is:
[0058]
[0059] The traversal process is: First, execute step S1 from the root element <videotemplate>Start by traversing non-root elements one by one; execute step S2 for the currently traversed non-root element <textelement>, obtain non-root elements <textelement>The included element tag is TextElement; if it is determined that the element tag TextElement is a specific tag, then continue to execute step S3 to determine the non-root element <textelement>Whether it contains child elements; it is determined that it is not a root element <textelement>Contains sub-elements <position>and <fontsize>, then step S4 is executed to make the child element <position>As the non-root element currently traversed, return to execute step S2; executing step S2 for the non-root element currently traversed <position>, obtain non-root elements <position>The included element tag is Position; if it is determined that the element tag Position is a non-specific tag, then proceed to step S5 and continue with the next non-root element <fontsize>, return to execute step S2; execute step S2 for the currently traversed non-root element <fontsize>, obtain non-root elements <fontsize>The included element tag FontSize; determine that the element tag FontSize is a non-specific tag. When it is a non-root element <textelement>After all child elements of <textelement>The included element tag TextElement itself is a specific tag and the traversal of its child elements has been completed. Finally, step S6 is executed to process the non-root element <textelement>Marked as a specific element.
[0060] In an optional embodiment, rendering parameter information corresponding to each of multiple material types is respectively extracted from information segments corresponding to the multiple material types, including: for each information segment, extracting path information of a material file and at least one attribute value of the material file from the information segment, where the attribute value is used to render the material file; reading the material file according to the path information, and determining the material type described by the information segment according to the extension of the material file; taking at least one attribute to which the at least one attribute value belongs as at least one rendering parameter, and taking the at least one attribute value as the default parameter value of the at least one rendering parameter, so as to obtain the rendering parameter information corresponding to the material type described by the information segment.
[0061] Among them, the information segment is a part related to the material type extracted from an XML document, and includes the path information of the material file and at least one attribute value of the material file. Among them, the material file can be used to construct various media files for the finally generated video. In the embodiments of the present application, the material file may include but is not limited to: video files such as MP4, AVI, etc., which contain dynamic images and audio and are used to display a series of continuous pictures; audio files such as WAV, MP3, etc., which provide background music, narration or special effect sounds, etc.; image files such as JPEG, PNG, etc., which can be used as background images, icons or visual elements in specific scenes; text files that are not directly used as display content but may contain subtitle information or other text content that needs to be superimposed on the video. Among them, the path information of the material file is a string representing the storage location of the material file, which may include the file name and extension, and the material file can be located and read according to the path information. For example, / videos / intro.mp4 is a path information, pointing to the intro.mp4 video file stored in the videos directory.
[0062] In an optional embodiment, the extension of the material file is an identifier at the end of the path information of the material file, which is used to determine the material type described by the information segment, and different extensions represent different material types. For example,.mp4,.mov,.avi represent the material type as video;.mp3,.wav represent the material type as audio;.png,.jpg represent the material type as image;.srt represent the material type as text.
[0063] Among them, at least one attribute value of the material file extracted from the information segment is the specific value corresponding to the attribute, so as to describe the specific state of the attribute. The attribute can describe the rendering effect of the material file. For example, for a material file that is a video file, the attribute can be video duration, video speed, filter effect, etc. If the attribute is video duration, the attribute value can be 2 minutes, 1 hour, 1 day, etc.
[0064] In an optional embodiment, the rendering parameter information corresponding to the material type described by the information segment includes at least one rendering parameter and the default parameter value of at least one rendering parameter. The default parameter value can be the attribute value of the attribute corresponding to the rendering parameter before quantization. Among them, at least one attribute for extracting at least one attribute value of the material file in the information segment can be used as at least one rendering parameter, and at least one attribute value can be used as the default parameter value of at least one rendering parameter, so as to obtain the rendering parameter information. That is to say, a key-value pair set is formed by the rendering parameter and the default parameter value, which is used to control the rendering logic of the material file in the video to achieve the expected rendering effect.
[0065] For example, the XML document of an information segment is as follows:
[0066]
[0067] Among them, the path information of the material file is / images / logo.png. The material file is read according to the path information to obtain the extension name of the material file as.png; according to the extension name.png, it is determined that the material type described by the information segment is an image; the attributes of the material file are width, height, format, and the attribute values are 100 (width), 100 (height), PNG (format). The attributes width, height, format are used as rendering parameters, and the attribute values 100 (width), 100 (height), PNG (format) are used as the default parameter values of the rendering parameters, and the rendering parameter information corresponding to the material type described by the information segment is obtained as "rendering parameter width, default value 100; rendering parameter height, default value 100; rendering parameter format, default value PNG". Through the above steps, the corresponding rendering parameter information can be generated for each material type, and the rendering parameter information can be used in the subsequent process of generating and rendering the video to ensure that the materials can be correctly displayed according to the predetermined rendering rules.
[0068] In an optional embodiment, the rendering parameter information corresponding to each of multiple material types is templatized to obtain multiple material templates, including: for each material type, selecting at least one variable parameter from the rendering parameter information corresponding to the material type; associating multiple candidate parameter values with at least one variable parameter; and generating a material template corresponding to the material type according to the multiple candidate parameter values associated with at least one variable parameter. Among them, the variable parameter is obtained by variable processing of a rendering parameter with a default parameter value. Each variable parameter is associated with multiple candidate parameter values, and different candidate parameter values correspond to different rendering logics to produce different rendering effects in the generated video, which can be used to generate diverse material templates. For each material type, at least one variable parameter is selected from the rendering parameter information corresponding to it, and these variable parameters can vary within the adjustment range to obtain different material templates. For example, when the material file is a video material, the playback speed and filter effects can be selected as variable parameters. The variable parameter is associated with multiple candidate optional values to limit the adjustment range of the variable parameter and ensure that the material file of the generated video meets the design requirements and avoid invalid settings. For example, for the variable parameter of playback speed, the candidate parameter values can include 0.5x, 1x, 1.5x; for the filter effect, the candidate parameter values can include grayscale and vintage.
[0069] In an optional embodiment, when selecting at least one variable parameter from the rendering parameter information corresponding to the material type, two selection methods are provided: one is to use all rendering parameters as variable parameters, and the other is to select some rendering parameters as variable parameters according to the weight values. Among them, when selecting to use all rendering parameters as variable parameters, there is no need to compare the weight values, and all rendering parameters can be adjusted as variable parameters.
[0070] In an optional embodiment, the method of selecting some rendering parameters as variable parameters according to the weight values can be to select at least one variable parameter from the rendering parameter information corresponding to the material type, including: pre-configuring the weight values of each rendering parameter for the material type; parsing out each rendering parameter from the rendering parameter information corresponding to the material type, and selecting at least one rendering parameter with a weight value greater than the set weight threshold from each rendering parameter as at least one variable parameter. Among them, the weight value can be an importance score assigned to each rendering parameter, used to quantify the influence degree of the rendering parameter on the rendering effect of the material file in video generation, and at least one rendering parameter that has a greater impact on the user perception or application target can be selected as at least one variable parameter. The weight threshold is a predefined critical value. By screening the rendering parameters corresponding to the weight values higher than the weight threshold, the user can select the parameters with weight values higher than the weight threshold as variable parameters to avoid taking too many irrelevant rendering parameters as variable parameters to prevent problems such as configuration conflicts or rendering logic confusion.
[0071] In the embodiments of the present application, there is no limitation on the way of pre-configuring the weight values of each rendering parameter. For example, the weight values of each rendering parameter can be pre-configured according to empirical annotations or automatically generated through user behavior data analysis.
[0072] For example, the weight value configuration for the rendering parameter with the material type of image can be:
[0073] Rendering parameters Weight value Default parameter value brightness(brightness) 0.7 100% contrast(contrast) 0.5 90% saturation(saturation) 0.9 80%
[0074] Filter the rendering parameters according to the weight threshold set to 0.6. According to 0.7 > 0.6, 0.9 > 0.6, and 0.5 < 0.6, select the variable parameters as brightness and saturation, and exclude the rendering parameter contrast.
[0075] Optionally, at least one variable parameter can also be randomly selected from the rendering parameter information corresponding to the material type according to the set number of variable parameters. In an alternative embodiment, a materialization template corresponding to the material type is generated according to multiple candidate parameter values associated with at least one variable parameter, including: adding each rendering parameter corresponding to the material type and the default parameter values of each rendering parameter to a preset template file, and adding multiple candidate parameter values associated with at least one variable parameter to the preset template file; and adding a placeholder for carrying the material file corresponding to the material type to the preset template file to obtain the materialization template corresponding to the material type. Wherein, the preset template file is a basic video template containing basic configurations, including the basic structure of the video template and some preset rendering parameters. Adding each rendering parameter corresponding to the material type and the default parameter values of each rendering parameter to the preset template file can ensure that the finally obtained materialization template has complete rendering parameter information.
[0076] In this embodiment, on the basis of adding each rendering parameter corresponding to the material type and the default parameter values of each rendering parameter to the preset template file, multiple candidate parameter values associated with at least one variable parameter are added to the preset template file. Among them, the candidate parameter values provide multiple choices, allowing the user or the system to select different candidate parameter values according to requirements.
[0077] In an alternative embodiment, based on adding multiple candidate parameter values associated with at least one variable parameter to a preset template file, a placeholder for carrying a material file corresponding to a material type can be added to the preset template file to obtain a materialized template corresponding to the material type. The placeholder is a reserved position for filling the material file and supports dynamic replacement. For example, the path information of the actual material file corresponding to the material type can be filled. Through the placeholder, different material files can be flexibly replaced without modifying the template structure.
[0078] Scenario example:
[0079] Taking the material type of video as an example, its rendering parameter information, including rendering parameters and default parameter values, is as follows:
[0080]
[0081] The weight values of each pre-configured rendering parameter are: duration (video duration): 0.8, language (language): 0.6, resolution (resolution): 0.4; setting the weight threshold to 0.5, then duration and language are selected as variable parameters.
[0082] Multiple candidate parameter values associated with at least one variable parameter are: duration: 1 minute, 2 minutes, 3 minutes, language: Chinese, English, Japanese.
[0083] By adding rendering parameters and default parameter values, multiple candidate parameter values associated with at least one variable parameter, and a placeholder [VIDEO_PATH] for carrying the actual path of the video file with a default value of / videos / intro.mp4 to the preset template file, the following materialized template is obtained:
[0084]
[0085] In the above embodiments, by integrating the rendering parameters of the material type and their default parameter values into the preset basic template, the materialized template ensures the integrity of the rendering parameter information of the generated materialized template. At the same time, by associating multiple candidate parameter values with the variable parameters, the dynamic selection of the parameter values of the variable parameters is realized to flexibly adjust the video style. The embedding of the placeholder further decouples the parameter configuration of the initial video template from the material file, supporting the dynamic replacement of the material file without modifying the template structure. Thus, it is allowed to assign corresponding candidate parameter values to the variable parameters according to the application requirements to obtain a freely combined materialized template, ultimately significantly improving the flexibility and diversity of video template generation, and then efficiently batch-producing video content with different styles, solving the problems such as cumbersome parameter configuration of video templates, complex adaptation process, and serious homogenization of generated video content in traditional video production.
[0086] Based on the above-mentioned multiple materialized templates, batch video generation or single video generation can be performed. For the batch video generation scenario, multiple videos with diverse styles and different contents can be generated by using the multiple materialized templates provided in the embodiments of the present application. A specific implementation manner of batch video generation based on the multiple materialized templates provided in the embodiments of the present application will be described in detail below.
[0087] Figure 2 It is a schematic flowchart of a video batch generation method provided in the embodiments of the present application. As Figure 2 shown, the method includes:
[0088] S21. Respond to the input operations on the video generation page for the number of videos and video categories, and generate a batch video generation task, where the batch video generation task includes the number of videos N and the video category, and N is an integer greater than or equal to 2;
[0089] S22. According to the batch video generation task, generate N video instance identifiers, and generate a set of video materials related to the video category for each video instance identifier;
[0090] S23. For each video instance identifier, determine at least one target materialized template from multiple materialized templates according to the material type in the set of video materials corresponding to the video instance identifier;
[0091] S24. Based on the hierarchical relationship between multiple video materials included in the initial video template, combine at least one target materialized template to obtain the target video template corresponding to the video instance identifier, where the target video template is used to describe the rendering rules and hierarchical relationship of a set of video materials;
[0092] S25. Perform video generation processing based on N video instance identifiers, their respective corresponding target video templates, and a set of video materials to obtain N videos under a video category.
[0093] In this embodiment, the execution subject of the above video batch generation method is not limited. For example, this method can be implemented as a service product. This service product can adopt a client-server architecture. In the case of adopting a client-server architecture, on the one hand, a video generation page for batch video generation is provided to the user on the client to receive the user's input operations for the number of videos and video categories, and then a batch video generation task is initiated to the server. On the other hand, in response to the client initiating a batch video generation task through the video generation service page on the server, the server batch generates videos through resources such as the server's computing resources, network bandwidth, and storage resources, which is beneficial to improving the speed of video generation.
[0094] For another example, as the processing power of the corresponding hardware device of the client increases, the above method can also be executed by the client. The client can provide a video generation page to the user and, in response to the user's input operations for the number of videos and video categories on the video generation page, generate a batch video generation task, and then batch generate videos through resources such as the client's own computing resources and storage resources. Among them, when the batch generation task is deployed to be executed on the client side, there is no need to transmit data to the server, which can save network latency.
[0095] In this embodiment, the batch video generation task includes the number of videos N and the video category. N is an integer greater than or equal to 2. The video category is used to describe the expression theme of the video content for batch video generation, and the specific implementation of the video category is not limited. For example, it includes but is not limited to: product introduction, teaching explanation, knowledge popularization, beauty and skincare, etc. Optionally, the video category can be implemented as a single-level video category. For example, it can be implemented as industrial and commercial registration or legal consultation, etc. Optionally, the video category can also be implemented as a multi-level video category. For example, the first-level video category can be industrial and commercial registration; the second-level video category of this first-level video category can be cleaning or food business, etc.
[0096] In this embodiment, according to the batch generation task, N video instance identifiers are generated. The N video instance identifiers are different from each other. Each video instance identifier can be used to uniquely represent a video to be generated, so as to facilitate tracking of the required video materials and video templates for the video to be generated. That is to say, this video instance identifier can also be used as the unique identity identifier of the relevant content (such as video materials) of the video to be generated.
[0097] Among them, the method for generating N video instance identifiers is not limited. For example, it includes but is not limited to numbers and strings, etc. For example, it can be an increasing sequence starting from any integer with a fixed step size to obtain N integers as the N video instance identifiers; or it can also be a preset N strings, etc.
[0098] In this embodiment, a set of video materials related to the video category is generated for each video instance identifier, and this set of video materials is used to generate the video corresponding to this video instance identifier. Among them, each set of video materials includes video materials of at least one material type. In some embodiments of the present application, the video materials of one material type are simply referred to as one kind of video material.
[0099] Among them, the material type refers to the media resource type that constitutes the video, including but not limited to: material types such as audio, video, background image, subtitle, digital human, etc.
[0100] In this embodiment, the implementation manner of generating a set of video materials related to the video category for each video instance identifier is not limited.
[0101] In an optional implementation manner, for any video instance identifier, video materials can be randomly extracted from multiple material types stored in the basic material library, and at least one extracted video material is used as a set of video materials for this video instance identifier. Among them, the basic material library stores multiple video materials under multiple video categories.
[0102] In another optional implementation manner, for any video instance identifier, the semantic similarity between at least one video material in the basic material library and the video category is calculated respectively to obtain multiple similarity information; the video materials that meet the similarity conditions among the multiple similarity information are used as a set of video materials for this video instance identifier.
[0103] Furthermore, in this embodiment, multiple materialized templates obtained by variable processing of the initial video template are obtained. Optionally, the initial video template can be implemented as an MLT (Media Lovin' Toolkit) template. The MLT template is an open-source framework for multimedia processing, which is a file based on the XML format and records all parameters of video editing, such as video segments on the timeline, audio tracks, filter effects, transitions, etc., and can be used for video editing.
[0104] In the embodiments of the present application, the initial video template can be an existing video production framework. Among them, the video production framework can be preset or exported after video editing by an editing software. In the embodiments of the present application, the specific manner of obtaining the initial video template is not limited. For example, the initial video template can be a preset general video template provided by the system by default, or a custom video template created by the user according to requirements, or a video template imported from other external sources.
[0105] Among them, the initial video template includes the rendering rules of various video materials required for generating a video, as well as the hierarchical relationship between various video materials. In the embodiments of the present application, the rendering rule of each video material is used to describe the rendering logic followed by this type of video material during the video rendering process, so as to achieve the expected rendering effect of this type of video material in the generated video. Among them, the hierarchical relationship formed between various video materials in the initial video template refers to the layer stacking order of various video materials during the video generation process in the initial video template, which is used to determine the front-to-back covering relationship and occlusion logic of various video materials during video generation. For example, when generating a video, the subtitle can be located in the relatively upper layer of the layer, the background image can be located in the relatively lower layer of the layer, the digital human can be superimposed on the upper layer of the background image, and under the layer of the subtitle.
[0106] In this embodiment, part of the variable processing of the initial video template is reflected in splitting the initial video template structurally and templatizing the rendering parameter information by taking the material type as the splitting variable, so as to obtain a variety of materialized templates. Among them, there is a corresponding relationship between the materialized template and the material type. For example, the material types include material types such as audio, video, background image, subtitle, digital human, etc. Then the types of the corresponding materialized templates include but are not limited to: audio materialized template, video materialized template, background image materialized template, subtitle materialized template, digital human materialized template, etc. In other words, each material type corresponds to a materialized template, and each materialized template is used to describe the rendering rule of this type of video material.
[0107] In this embodiment, the timing of the variable processing is not limited. For example, the initial video template can be variablized in advance. Another example is that the initial video template can also be variablized dynamically. For the detailed content of how to perform the variable processing, reference can be made to the subsequent embodiments.
[0108] In this embodiment, the materialized templates after variable processing can be modularly reorganized. For each video instance identifier, at least one target materialized template is determined from a variety of materialized templates according to the material types in a group of video materials corresponding to the video instance identifier. There is a corresponding relationship between the material types in this group of video materials and the materialized templates.
[0109] For example, in the case where the types of materials included in the group of video materials are audio, video, background images, and subtitles, the target materialization template can include the target materialization templates corresponding to audio, video, background images, and subtitles respectively; for another example, in the case where the types of materials included in the group of video materials are audio, video, background images, subtitles, and digital humans, the target materialization template can include the target materialization templates corresponding to the types of materials of audio, video, background images, subtitles, and digital humans respectively.
[0110] Furthermore, in the case of obtaining at least one target materialization template corresponding to a group of video materials, based on the hierarchical relationship between the various video materials included in the initial video template, the at least one target materialization template is combined to obtain the target video template corresponding to the video instance identifier. Among them, the target video template is used to describe the rendering rules and hierarchical relationship of a group of video materials.
[0111] Among them, for the hierarchical relationship between the various video materials included in the initial video template, this hierarchical relationship can represent the layer stacking order of multiple materialization templates, and can be used to organize and integrate the target materialization templates, so as to form a target video template with a clear hierarchical relationship and corresponding rendering rules for video materials. Among them, the target video template describes the hierarchical relationship of a group of video materials, which is consistent with the hierarchical relationship of this group of video materials in the initial video template.
[0112] Among them, in this embodiment, the N video instance identifiers respectively correspond to their own target video templates, that is to say, each group of video materials has its own corresponding target video template, which enriches the types of target video templates used for batch video generation. Among them, based on the rendering rules described by the N target video templates, video generation processing is performed on the grouped video materials corresponding to the N video instance identifiers, so that the style of each video generated in batch matches the video template used respectively, and the diversification degree of the video content generated in batch is improved.
[0113] In the case of obtaining the target video template corresponding to the video instance identifier, video generation processing is performed according to the target video templates respectively corresponding to the N video instance identifiers and a group of video materials to obtain N videos under the video category. Video generation processing refers to the process of filling and rendering video materials for the target video template based on the target video template corresponding to each video instance identifier and a group of video materials to obtain the video corresponding to the video instance identifier. For example, for the N video instance identifiers, a group of video materials respectively corresponding to the N video instance identifiers can be filled into the N target video templates to obtain the filled target video templates, and then the filled target video templates can be rendered to obtain the videos under the video category.
[0114] In an alternative embodiment, batch video generation processing can be performed on the video generation corresponding to each of the N video instance identifiers. M videos are generated in parallel for each batch, where M is less than N and M is an integer. After the generation of M videos is completed, the subsequent M videos are continuously processed until all the videos corresponding to the N video instance identifiers are processed. Through batch video generation processing, the resource utilization rate of the server is improved, and at the same time, the server pressure overload caused by high concurrency is avoided.
[0115] In the embodiments of the present application, in batch video generation, a materialized template of various material types obtained by variable processing of an initial video template is used to reorganize the materialized template to obtain a video template required for generating a video. Further, a video instance identifier is generated for each video generation, and a respective set of video materials is bound to the video instance identifier. According to the set of video materials corresponding to the video instance identifier, a target materialized template for reorganization is determined from various materialized templates, and in combination with the hierarchical relationship between the materialized templates provided by the initial template, the target materialized template is organized and integrated to obtain a video template corresponding to each video instance identifier for video generation processing of each respective set of video materials corresponding to the video instance identifier. Since the video template can be obtained by personalized reorganization in combination with the video materials for generating the video, the flexibility of video generation is improved. In addition, the reorganized video template has a corresponding relationship with the video instance identifier, which enriches the types of video templates to a certain extent, so that the style of each batch-generated video matches the respective adopted video template, and the diversification degree of the batch-generated video content is improved.
[0116] In the embodiments of the present application, the method of variable processing has been described in detail in the foregoing embodiments and will not be elaborated herein.
[0117] In the embodiments of the present application, an initial video template is subjected to variable processing to obtain various materialized templates. During batch video generation, for each video instance identifier, at least one target materialized template is determined from various materialized templates according to the material types in the set of video materials corresponding to the video instance identifier.
[0118] In an alternative embodiment, when determining at least one target materialized template from various materialized templates according to the material types in the set of video materials corresponding to the video instance identifier, it includes: identifying at least one material type included in the set of video materials corresponding to the video instance identifier; selecting at least one initial materialized template from various materialized templates according to the at least one material type included in the set of video materials, with each material type corresponding to one initial materialized template; and adjusting the parameters of at least some of the selected at least one initial materialized templates to obtain at least one target materialized template.
[0119] In this embodiment, the materialized templates included in the multiple materialized templates obtained by variable processing of the initial video template are referred to as initial materialized templates. When determining at least one initial materialized template corresponding to a certain group from the multiple initial materialized templates, the rendering rules described by the initial materialized templates can be referred to as initial rendering rules. Furthermore, parameter adjustment is performed on at least some of the initial materialized templates among the at least one initial materialized template to obtain at least one target materialized template. Each initial materialized template obtains a corresponding target materialized template after parameter adjustment. The target materialized template after parameter adjustment includes a target rendering rule, and the target rendering rule is different from the initial rendering rule described by the initial materialized template.
[0120] In this embodiment, since the initial materialized template is obtained by variable processing, the variable processing can convert the fixed rendering parameters in the initial video template into variable parameters that can be dynamically assigned values, so as to achieve flexible configuration of the template content. If the values of the optional parameters are different, the rendering rules will be different. Optionally, each initial materialized template includes at least one variable parameter, and each variable parameter is associated with multiple candidate parameter values and default parameter values.
[0121] In this embodiment, the parameter adjustment of the initial materialized template is to obtain multiple target materialized templates with different candidate parameter values by assigning different candidate parameter values to the variable parameters of the initial materialized template. Among them, the target materialized template for a certain material type can be used for the video material rendering of different groups of video instance identifiers. If the parameter values of the variable parameters are different, it means that the rendering rules described by the target materialized templates of the same material type are different, so that the rendering results of the batch-generated videos are different, and differences are formed between different videos, improving the richness of video content. Hereinafter, how to perform parameter adjustment on the initial materialized template will be introduced.
[0122] In an optional embodiment, when performing parameter adjustment on at least some of the initial materialized templates among the at least one initial materialized template to obtain at least one target materialized template, it includes: determining the number of templates with parameters to be adjusted, where the number of templates is less than or equal to the number of at least one initial materialized template; selecting the initial materialized templates to be adjusted from the at least one initial materialized template according to the number of templates to be adjusted; determining the variable parameters to be adjusted from the initial materialized templates to be adjusted; randomly determining the target parameter values from the multiple candidate parameter values associated with the variable parameters to be adjusted; and assigning the target parameter values to the variable parameters to be adjusted to obtain the target materialized template.
[0123] In this embodiment, there is no limitation on the method for determining the number of templates for the parameters to be adjusted. For example, parameter adjustment can be performed on each initialized video template, and then the number of templates to be adjusted is the number of at least one initial materialized template. Another example is that, according to the random number generation algorithm, a random integer within a preset range is generated as the number of templates to be adjusted, where the preset range refers to being less than or equal to the number of at least one initial materialized template. There is no limitation on the random number generation algorithm, including but not limited to: the Linear congruential generator (LCG) and the Mersenne Twister, etc.
[0124] Further, according to the number of templates to be adjusted, the initial materialized templates to be adjusted are selected from at least one initial materialized template. In an alternative embodiment, the initial materialized templates to be adjusted are selected according to the priority of the material types and the number of templates to be adjusted. Herein, the priority of the material type refers to the importance degree of the material type to the presentation effect of the generated video. For example, the subtitle material type generally has a relatively low importance degree for the presentation effect, so the priority of the subtitle material type can be set to a lower priority; relatively speaking, the priority of the background image can be higher than that of the subtitle, so it can be set to a medium priority; and, the digital human has a relatively high importance degree for the presentation effect, so it can be set to a higher priority. Then, according to the high or low priority, the templates for adjusting parameters are preferentially selected from the initial material templates with a higher priority of the material type. If the number of these initial material templates is less than the previously determined number of templates to be adjusted, then selection can be made from the initial materialized templates with a lower priority of the material type. Finally, the number of the selected templates to be adjusted is less than or equal to the number of at least one initial materialized template.
[0125] Further, from the initial materialized templates to be adjusted, the variable parameters to be adjusted are determined. In an alternative embodiment, all the variable parameters in the initial materialized templates to be adjusted can be used as the variable parameters to be adjusted. In another alternative embodiment, the target variable parameters in the adjusted initial materialized templates are used as the optional parameters to be adjusted, and the target variable parameters are pre-selected optional parameters.
[0126] Furthermore, the target parameter value is randomly determined from multiple candidate parameter values associated with the variable parameters to be adjusted. In some embodiments, among the at least one initial materialized template corresponding to each of the N video instance identifiers, there are the same variable parameters to be adjusted. The multiple candidate parameter values associated with the variable parameters to be adjusted can be randomly used as the target parameter values of each of the N video instance identifiers respectively, so that the optional parameter values of the N video instance identifiers are as different as possible.
[0127] Further, assign the target parameter value to the variable parameter to be adjusted to obtain the target materialized template.
[0128] In the case of obtaining the target materialized template, combine the target materialized templates to obtain the target video template. Regarding the combination method, this embodiment does not make any limitations. The following provides two combination methods, but is not limited thereto.
[0129] In an alternative embodiment, according to the hierarchical relationship between multiple video materials included in the initial video template, generate a basic video template, which serves as the framework of the target video template and includes multiple blank structural positions corresponding to multiple video materials. Among them, the blank structural position is a placeholder for the target materialized template preset in the basic video template, used to identify the position where the target materialized template can be inserted, and each blank structural position corresponds to the filling of the target materialized template of one material type. The positional relationship between multiple blank structural positions reflects the hierarchical relationship between multiple video materials. As described in the above embodiment, the hierarchical relationship represents the front-to-back stacking order of multiple materials in the generated video. In some embodiments, this hierarchical relationship is extracted from the initial video template; alternatively, it can also be preset, preset based on at least one target materialized template, that is to say, the hierarchical relationship can be set as needed. For example, the structural position corresponding to the subtitle is located in the upper layer, the structural position corresponding to the digital human is located in the middle layer, and the structural position corresponding to the background image is located in the lower layer. Further, insert at least one target materialized template into the corresponding blank structural position in the basic video template to obtain the target video template corresponding to the video instance identifier.
[0130] In another alternative embodiment, according to at least one target materialized template, overwrite the structural position where the rendering rule of the video material of the same material type in the initial video template is located to obtain the target video template corresponding to the video instance identifier. Among them, the difference between the structural position and the above blank structural position is that the rendering rule of each video material in the initial video template occupies a structural position, while the blank structural position is empty. Among them, the positional relationship between the structural positions reflects the hierarchical relationship between multiple video materials.
[0131] In the case of obtaining the target video template, video generation processing is performed based on the target video template corresponding to each video instance identifier and a set of video materials. In an alternative embodiment, when performing video generation processing based on the target video templates corresponding to N video instance identifiers and a set of video materials respectively to obtain N videos under the video category, it includes: for each video instance identifier, filling the set of video materials corresponding to the video instance identifier into the target materialized template in the target video template corresponding to the video instance identifier; for the filled target video template, rendering the set of video materials according to the rendering rules and hierarchical relationships of the set of video materials described in the filled target video template to obtain a video under the video category.
[0132] Among them, the target materialized template includes at least one placeholder for the corresponding material type, which is used to fill the video materials of the material type.
[0133] In an alternative embodiment, generating a set of video materials related to the video category for each video instance identifier includes: obtaining a set of video material description information related to the video category for each video instance identifier, and each set of video material description information includes description information of multiple video materials; for each video instance identifier, according to the set of video material description information corresponding to the video instance identifier, calling multiple material generation models based on artificial intelligence to generate multiple video materials corresponding to the video instance identifier, and synchronously uploading the multiple video materials corresponding to the video instance identifier to the content distribution network; correspondingly, before performing video generation processing based on the target video templates corresponding to N video instance identifiers and a set of video materials respectively to obtain N videos under the video category, it also includes: in response to a batch video generation trigger event, respectively obtaining multiple sets of video materials corresponding to N video instance identifiers from the content distribution network. Hosting video materials through the content distribution network reduces the storage pressure on the server side, enables the server to efficiently render a large number of videos, and improves the user experience.
[0134] In this embodiment, the description information of each set of video materials is used to generate the video materials corresponding to its video instance identifier. Among them, each set of video materials includes video materials of multiple material types. The material type refers to the type of different video elements that make up the video content, including but not limited to: material types such as audio, video, background image, subtitle, digital human, etc.
[0135] In this embodiment, the implementation manner of the description information for generating a set of video materials related to the video category for each video instance identifier is not limited.
[0136] In an alternative embodiment, for any video instance identifier, the description information of video materials can be randomly extracted from various material types stored in the basic material library, and the description information of multiple video materials extracted is used as the description information of a group of video materials for any video instance identifier. Among them, the basic material library stores the description information of multiple video materials under multiple video categories.
[0137] In another alternative embodiment, for any video instance identifier, the semantic similarity between the description information of multiple video materials in the basic material library and the video category is calculated respectively to obtain multiple similarity information; the description information of the video materials that meet the similarity condition among the multiple similarity information is used as the description information of a group of video materials for this video instance identifier.
[0138] In yet another alternative embodiment, for any video instance identifier, according to the video category, a material description information generation model is called, and this model is used to generate the description information of multiple video materials related to this video category. Among them, this material description information generation model is trained by combining the description information of sample video materials of a large number of different sample video categories and different material types. By learning the semantic correlation between the description information of sample video materials of different sample video categories and different material types, this model can specifically combine different video categories and generate the description information of multiple video materials related to them.
[0139] Furthermore, for each video instance identifier, according to the group of video material description information corresponding to this video instance identifier, multiple material generation models based on artificial intelligence are called to generate multiple video materials corresponding to this video instance identifier, and the multiple video materials corresponding to this video instance identifier are synchronously uploaded to the content delivery network.
[0140] Among them, one material generation model can generate at least some of the multiple video materials. For example, one material generation model can generate one video material. The following also takes this as an example for illustration, but is not limited to this.
[0141] In this embodiment, when generating the video materials of the video instance identifier, according to the multiple video materials corresponding to each video instance identifier, the target video template corresponding to each video instance identifier is determined, and the target video template corresponding to each video instance identifier is used to describe the rendering rules and hierarchical relationships of the multiple video materials corresponding to this video instance identifier. The determination method of the target video template corresponding to each video instance identifier can refer to the above embodiment and will not be elaborated here.
[0142] In this embodiment, in response to a batch video generation trigger event, according to N video instance identifiers, a variety of video materials corresponding to the N video instance identifiers are respectively obtained from a content delivery network; video generation is performed according to the variety of video materials and a target video template corresponding to each of the N video instance identifiers to obtain N videos under a video category.
[0143] In this embodiment, the specific implementation of the batch video generation trigger event is not limited and can be flexibly configured according to actual application requirements. For example, it can be the case where all the variety of materials corresponding to the N video instance identifiers are generated; or, it can also be the case where for each generation of the variety of materials corresponding to a video instance identifier, in which case, video generation is performed for the variety of video materials corresponding to the video instance identifier; or the batch video generation trigger event can also be a preset trigger time, such as after a period of time in response to an input operation on the number of videos and video categories on a video generation page. For example, it can be 2 hours, 1 day, or 1 week, etc., and the time span is not limited.
[0144] It should be noted that each video instance identifier corresponds to the generation of one video, and the N video instance identifiers can correspond to the generation of N videos. When performing video generation for the variety of video materials corresponding to each of the N video instance identifiers, the generation process of the video corresponding to each video instance identifier is asynchronous, and the video generations corresponding to the respective video instance identifiers do not affect each other, so as to improve the generation efficiency of the N videos.
[0145] Further optionally, the description information of each group of video materials includes but is not limited to: subtitle description information, audio type description information, digital human description information, and background image description information. As Figure 3 shown, when calling multiple material generation models based on artificial intelligence according to a group of video material description information corresponding to a video instance identifier to generate a variety of video materials corresponding to the video instance identifier, it includes: calling a generative language model according to the subtitle description information to generate text information to obtain a target subtitle; calling a text-to-speech model according to the target subtitle and the audio type description information to convert the target subtitle into a target audio adapted to the audio type description information; calling a multimodal model according to the target audio and the digital human description information, selecting a target digital human according to the digital human description information, and generating a green screen video of the target digital human based on the target audio to obtain a green screen video of the target digital human; calling an image generation model according to the background image description information to generate a background image to obtain a target background image.
[0146] In this embodiment, the APIs (Application Programming Interfaces) of multiple material generation models are associated with endpoints. In this embodiment, the video generation page is the presentation of the front-end code of the endpoint. Among them, the endpoint is used for the generation of video materials, the management of batch video generation tasks, and the control of the video generation process.
[0147] Among them, the endpoint includes front-end code and back-end code, that is, the client-server structure is adopted as described in the above embodiment. The front-end code refers to the video generation page built based on the front-end framework. This video generation page runs on the client and is used to interact with users, receive the input operations of users, and initiate batch video generation tasks to the server. The back-end code of the endpoint runs on the server. The back-end code is obtained by API-ifying the code of the existing video editing software, such as shortcut, etc. Among them, in the existing video editing software, the front-end UI code is highly coupled with the video rendering function code. In this embodiment, it is split according to functions to decouple the front-end UI of the video editing software from the video rendering function code, and then encapsulate the video rendering function code of the existing video editing software into an independent API, so that the external can call the video rendering function through the standard API method to achieve automated video generation.
[0148] As Figure 3 the endpoint in, in one example, the front-end code of the endpoint can be a video generation page built based on Astro, which is responsible for receiving callback notifications. For example, when the material generation model finishes processing, it can send a notification to the endpoint to notify that the subsequent process of video generation can continue. The back-end code of the endpoint can be obtained by API-ifying the video rendering code of the video editing software and exposed to the outside through the API interface for external calls.
[0149] In an alternative embodiment, when calling the generative language model to generate text information according to the subtitle description information to obtain the target subtitle, it includes: matching the corresponding keywords according to the video category, calling the pre-designed prompt template, and filling the keywords of the video category into the prompt template to obtain the prompt for the video category; inputting the prompt for the video category into the generative language model to generate text information to obtain the target subtitle related to the video category.
[0150] Among them, the keywords are used to describe the theme content expressed by the video category. Different video categories can correspond to different keywords, and the prompt templates corresponding to different video types can also be different. Among them, the target subtitle includes all the text content required for each video. By calling the generative language model, the target subtitle can be automatically generated based on the category of the video without manual intervention, improving the generation efficiency.
[0151] Further optionally, according to the target subtitle and the audio type description information, call the text-to-speech model to convert the target subtitle into a target audio adapted to the audio type description information. Among them, the target subtitle is used to provide text content, and the audio type description information is used to specify the audio type of the generated target audio. The audio type includes, but is not limited to: audio format, audio language, audio tone, audio quality, etc. Any audio type that can be used to specify the sound effect of the target audio is applicable to this embodiment. Based on the target subtitle and the audio description information, call the text-to-speech model to generate the corresponding target audio and upload it to the content delivery network to improve the automation degree of audio generation.
[0152] Further, call the multi-modal model to generate a green screen video of the virtual human. Among them, the virtual human refers to a virtual character generated based on AI technology, which can synchronously simulate the behaviors of real people such as appearance, voice, and lip shape, and can be used in scenarios such as intelligent customer service, short video production, virtual anchors, etc., but is not limited to this. In this embodiment, by combining various video materials corresponding to each video instance identifier, a video with the effect of real people speaking can be generated.
[0153] In an alternative embodiment, the virtual human can be a pre-recorded real person video or picture. In subsequent embodiments, the real person video and picture are collectively referred to as video frames, and the number of video frames can be one or more. In this case, the description information for different virtual humans can be implemented as identification information, and the identification information serves as the unique identity identifier of the virtual human and is used to obtain the video frames of the virtual human corresponding to the identification information. In another alternative embodiment, the video frames of the virtual human can be dynamically generated based on the multi-modal model. In this case, the description information of the virtual human can be the prompt words used to generate the virtual human, and the description information of the virtual human corresponding to each video instance identifier can be different.
[0154] Further optionally, when calling a multimodal model according to the target audio and digital human description information, selecting a target digital human according to the digital human description information, and generating a green screen video based on the target audio and the target digital human to obtain the green screen video of the target digital human, the following steps are included: obtaining corresponding target digital human video frames based on the digital human description information; calling a multimodal model according to the video frames of the target digital human and the target audio to perform multi-dimensional feature extraction on the target audio to obtain multi-dimensional speech features; wherein the multi-dimensional speech features include, but are not limited to, speech content features and speech emotion features; determining the lip movement control parameters of the target digital human according to the speech content features; determining the facial expression control parameters of the target digital human according to the speech emotion features; determining the limb movement control parameters of the target digital human according to the speech content features and the speech emotion features; generating a green screen video of the target digital human based on the lip movement control parameters, expression control parameters and limb movement control parameters of the target digital human; the lip movement, facial expression and limb movement of the green screen video of the target digital human match the target audio.
[0155] In this embodiment, the speech content features are used to reflect the semantic information in the target audio, such as lexical content, grammatical structure, speech intention and speech rhythm, and are mainly used to drive the lip movement of the digital human to be synchronized with the semantics of the target audio. The speech emotion features are used to reflect the emotional state of the target audio, including but not limited to the strength of tone, speech rate and intonation change, etc., and are mainly used to drive the facial expression and limb movement of the digital human.
[0156] Further, determine the lip movement control parameters of the target digital human according to the speech content features; determine the facial expression control parameters of the target digital human according to the speech emotion features; determine the limb movement control parameters of the target digital human according to the speech content features and the speech emotion features.
[0157] In the case of obtaining the lip movement control parameters, facial expression control parameters and limb movement control parameters, drive the target digital human to perform action rendering based on the lip movement control parameters, expression control parameters and limb movement control parameters of the target digital human to generate the corresponding green screen video of the target digital human, which is convenient for subsequent flexible replacement with the background image. Since the green screen video of the target digital human is generated by controlling the multi-dimensional speech features extracted from the target audio content, it is ensured that the dynamic performance of the lip movement, facial expression and limb movement of the target digital human in the green screen video matches the target audio in terms of semantics, timing and emotion, ensuring the accurate alignment of the lip movement and improving the realism and visual experience of the generated video.
[0158] Further, in this embodiment, the target audio and the target subtitle are aligned, for example, the timestamp of the target subtitle is inferred and aligned and marked through the timestamp of the speech content in the target audio to ensure that the subsequent display of the target subtitle is completely synchronized with the target audio.
[0159] In this embodiment, there are two ways to generate the background image. One is to call the text-to-image model according to the background image description information to generate the background image and obtain the target background image. The other is to directly obtain the pre-generated or captured background image, and there is no limitation on this.
[0160] In an optional embodiment, a corresponding set of video material generation states is maintained for each of the N video instance identifiers. The generation state of the video material of any material type in each set of video materials includes: the state of preparing to generate, the state of generating, the state of successful generation, and the state of failed generation. For example, for any video instance identifier, taking the multiple video materials that need to be generated for this video instance identifier including: target subtitles, target audio, the green screen video of the target digital human, and the target background image as an example. Then, the generation states of the target subtitles, target audio, the green screen video of the target digital human, and the target background image can be maintained respectively.
[0161] Among them, for each video instance identifier, mark the multiple video materials corresponding to this video instance identifier as the state of preparing to generate; when calling multiple material generation models based on artificial intelligence to generate multiple video materials corresponding to this video instance identifier, if any material generation model returns a generating response message, update the video material that should be generated by this material generation model to the state of generating; if any material generation model returns a successful generation message, update the video material that should be generated by this material generation model to the state of successful generation; if any material generation model returns a failed generation message, update the video material that should be generated by this material generation model to the state of failed generation. As Figure 3 shown, a subscription service is provided. This subscription service can receive notifications from each material generation model to notify the subscription service of the generation state of the video material of this material model, for example, it can be the state of successful generation. Furthermore, the subscription service will return a successful generation message to the server to inform the server that the corresponding video material has been successfully generated. Figure 3 Only the notification process of the target digital human is taken as an example here, but it is not limited to this.
[0162] Further optionally, if the generation state of the video material is updated to the state of failed generation, a failure reminder message is output to the user who initiated the input operation. The failure reminder message includes the material type of the video material updated to the state of failed generation and its corresponding video instance identifier. If a regeneration operation triggered by the user is received, according to the video instance identifier corresponding to the video material, obtain the description information of the corresponding video material, and call the corresponding material generation model based on artificial intelligence to regenerate the corresponding video material.
[0163] In this embodiment, when generating multiple video materials corresponding to each video instance identifier, the multiple video materials corresponding to each video instance identifier can be synchronously uploaded to the content delivery network, and the access links of the video materials corresponding to each video instance identifier in the content delivery network can be obtained. Continuing with the above example, for any video instance identifier, when the multiple video materials corresponding to the video instance identifier include a target subtitle, a target audio, a green screen video of a target digital human, and a target background image, the target subtitle, the target audio, the green screen video of the target digital human, and the target background image are respectively uploaded to the content delivery network, and the access links of the target subtitle, the target audio, the green screen video of the target digital human, and the target background image are obtained.
[0164] Further, in response to a batch video generation trigger event, according to the access links of the multiple video materials corresponding to each of the N video instance identifiers in the content delivery network, the multiple video materials corresponding to the N video instance identifiers are respectively obtained; and, video generation is performed according to the multiple video materials corresponding to each of the N video instance identifiers and a target video template to obtain N videos under the video category.
[0165] Continuing with the above example, in response to a batch video generation trigger event, according to the access links of the target subtitle, the target audio, the green screen video of the target digital human, and the target background image corresponding to each of the N video instance identifiers in the content delivery network, the target subtitle, the target audio, the green screen video of the target digital human, and the target background image corresponding to the N video instance identifiers are respectively obtained; and, video generation is performed according to the target subtitle, the target audio, the green screen video of the target digital human, the target background image, and the target video template corresponding to each of the N video instance identifiers to obtain N videos under the video category.
[0166] Further optionally, the videos corresponding to the N video instance identifiers and the target video template are uploaded to the content delivery network, and the access links of the videos corresponding to the N video instance identifiers and the target video template in the content delivery network are obtained, and the access links are added to the video generation result page; in response to a viewing operation of the video result page, the video generation result page is displayed, and the video generation result page includes the access links of a set of video materials, videos, and the target video template corresponding to at least one video instance identifier among the N video instance identifiers in the content delivery network.
[0167] In this embodiment, the video materials, videos, and target video templates corresponding to each video instance identifier are stored in the content delivery network. The server does not need to store a large number of files, reducing the disk I / O load and ensuring service stability. Further, for the video materials, videos, and target video templates corresponding to each video instance identifier, the access links stored in the content delivery network can avoid data expansion, reduce query pressure, and at the same time support larger-scale data management.
[0168] In this alternative embodiment, in response to a trigger operation for access links of a set of video materials, videos, and / or target video templates corresponding to at least one video instance identifier in a content delivery network, a set of video materials, videos, and / or target video templates corresponding to at least one video instance identifier information is accessed. By hosting videos and video templates through the CDN, the video generation result page can directly load videos from the content delivery network. Compared with pulling videos from the server, it occupies less bandwidth and has a faster loading speed, which can significantly improve performance and is suitable for large-scale video browsing scenarios.
[0169] The detailed implementation manners and beneficial effects of each step in the method of this embodiment have been described in detail in the foregoing embodiments, and will not be elaborated here.
[0170] In addition, in some processes described in the foregoing embodiments and the accompanying drawings, a plurality of operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 11, 12, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., do not represent a sequence, and do not limit that "first" and "second" are of different types.
[0171] Figure 4 A schematic structural diagram of an electronic device provided for an exemplary embodiment of the present application. As Figure 4 shown, the device includes: the device includes: a memory 44 and a processor 45.
[0172] The memory 44 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of these data include instructions for any application program or method for operating on the electronic device, initial video templates, rendering rules of video materials, rendering parameter information, etc.
[0173] The memory 44 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.
[0174] A processor 45, coupled to a memory 44, is configured to execute a computer program in the memory 44 for: obtaining an initial video template, the initial video template including rendering rules for various video materials required for generating a video and a hierarchical relationship between the various video materials; parsing the initial video template with the material type as a splitting variable to obtain information segments corresponding to the various material types; respectively extracting rendering parameter information corresponding to the various material types from the information segments corresponding to the various material types; and templatizing the rendering parameter information corresponding to the various material types to obtain various materialized templates, each materialized template being used to describe the rendering rules of a video material.
[0175] In an alternative embodiment, the processor 45 parses the initial video template with the material type as a splitting variable to obtain information segments corresponding to the various material types, including: loading an XML document corresponding to the initial video template, the XML document including a root element and a plurality of non-root elements connected to the root element, and the plurality of non-root elements including a plurality of specific elements, each specific element being used to describe the rendering rules of a material type; starting from the root element, traversing the non-root elements in the XML document to identify the plurality of specific elements; and extracting the plurality of information segments where the plurality of specific elements are located as the information segments corresponding to the various material types.
[0176] In an alternative embodiment, the processor 45 starts from the root element and traverses the non-root elements in the XML document to identify the plurality of specific elements, including: S1. Starting from the root element, traversing the non-root elements in the XML document; S2. For the currently traversed non-root element, obtaining the element tag included in the currently traversed non-root element; S3. If the element tag is a specific tag, determining whether the currently traversed non-root element includes sub-elements; S4. If the currently traversed non-root element includes sub-elements, taking the sub-elements as the currently traversed non-root element and returning to execute step S2;
[0177] S5. If the element tag is a non-specific tag, continuing to the next non-root element and returning to execute step S2; S6. If the currently traversed non-root element does not include sub-elements, taking the currently traversed non-root element as a specific element.
[0178] In an alternative embodiment, the processor 45 extracts the rendering parameter information corresponding to each of multiple material types from the information segments corresponding to the multiple material types respectively, including: for each information segment, extracting the path information of the material file and at least one attribute value of the material file from the information segment, where the attribute value is used to render the material file; reading the material file according to the path information, and determining the material type described by the information segment according to the extension of the material file; taking at least one attribute to which at least one attribute value belongs as at least one rendering parameter, and taking at least one attribute value as the default parameter value of at least one rendering parameter, so as to obtain the rendering parameter information corresponding to the material type described by the information segment.
[0179] In an alternative embodiment, the processor 45 templates the rendering parameter information corresponding to each of multiple material types to obtain multiple material templates, including: for each material type, selecting at least one variable parameter from the rendering parameter information corresponding to the material type; associating multiple candidate parameter values with at least one variable parameter; and generating a material template corresponding to the material type according to the multiple candidate parameter values associated with at least one variable parameter.
[0180] In an alternative embodiment, the processor 45 selects at least one variable parameter from the rendering parameter information corresponding to the material type, including: pre-configuring the weight value of each rendering parameter for the material type; parsing out each rendering parameter from the rendering parameter information corresponding to the material type, and selecting at least one rendering parameter whose weight value is greater than a set weight threshold from each rendering parameter as at least one variable parameter.
[0181] In an alternative embodiment, the processor 45 generates a material template corresponding to the material type according to the multiple candidate parameter values associated with at least one variable parameter, including: adding each rendering parameter corresponding to the material type and the default parameter value of each rendering parameter to a preset template file; adding multiple candidate reference values associated with at least one variable parameter to the preset template file; and adding a placeholder for carrying the material file corresponding to the material type to the preset template file, so as to obtain the material template corresponding to the material type.
[0182] In an optional embodiment, the processor 45 responds to input operations on the video generation page for the number of videos and video categories, generates a batch video generation task, where the batch video generation task includes the number of videos N and the video category, and N is an integer greater than or equal to 2; according to the batch video generation task, generates N video instance identifiers, and generates a set of video materials related to the video category for each video instance identifier; for each video instance identifier, determines at least one target materialization template from multiple materialization templates according to the material type in the set of video materials corresponding to the video instance identifier; based on the hierarchical relationship between multiple video materials included in the initial video template, combines at least one target materialization template to obtain the target video template corresponding to the video instance identifier, where the target video template is used to describe the rendering rules and hierarchical relationship of a set of video materials; performs video generation processing according to the target video templates and a set of video materials corresponding to the N video instance identifiers to obtain N videos under the video category.
[0183] Further, as Figure 4 shown, the electronic device further includes: other components such as a communication component 46, a display 47, a power supply component 48, and an audio component 49. Figure 4 Only some components are schematically shown, and it does not mean that the computing platform only includes Figure 4 the components shown. Additionally, Figure 4 the components within the dashed box in Figure 4 are optional components, rather than mandatory components, and can be determined according to the product form of the working node. The working node in this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, or an IOT device, or can also be a server device such as a conventional server, a cloud server, or a server array. If the working node in this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, or a smart phone, it can include Figure 4 the components within the dashed box in
[0184] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed, it can implement each step executable by the electronic device in the above method embodiment.
[0185] The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disc.
[0186] The above-mentioned communication component is configured to facilitate communication between the device where the communication component is located and other devices in a wired or wireless manner. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra wide band (UWB) technology, Bluetooth (BT) technology and other technologies.
[0187] The above-mentioned display includes a screen, and the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operations.
[0188] The above-mentioned power supply component provides power for various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.
[0189] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC). When the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio signals. The received audio signals can be further stored in the memory or sent via the communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals.
[0190] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memories, compact disc read-only memories (CD-ROMs), optical memories, etc.) containing computer-usable program code.
[0191] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0192] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0193] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 steps for implementing the functions specified in one block or multiple blocks.
[0194] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), an input / output interface, a network interface, and memory.
[0195] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (Random Access Memory, RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
[0196] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (Phase-change Random Access Memory, PRAM), static random access memory (SRAM), dynamic random access memory (Dynamic Random Access Memory, DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (Digital Video Disc, DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0197] It should also be noted that the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, commodity or device including the element.
[0198] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.< / textelement> < / textelement> < / textelement> < / fontsize> < / fontsize> < / fontsize> < / position> < / position> < / position> < / fontsize> < / position> < / textelement> < / textelement> < / textelement> < / textelement> < / videotemplate> < / path> < / settings> < / author> < / metadata> < / texts> < / images> < / video> < / text> < / images> < / audio> < / video> < / audio> < / video> < / media> < / media> < / metadata> < / template> < / template> < / position> < / path> < / images> < / metadata> < / template>
Claims
1. A method for variable video template, characterized in that: include: Acquire an initial video template, wherein the initial video template includes rendering rules of multiple video materials required to generate a video and a hierarchical relationship between the multiple video materials; Taking the material type as a splitting variable, parsing the initial video template to obtain information fragments corresponding to multiple material types; Extracting rendering parameter information corresponding to each of the multiple material types from the information fragments corresponding to each of the multiple material types; The rendering parameter information corresponding to each of the multiple material types is templated to obtain multiple material templates, and each material template is used to describe a rendering rule of a video material.
2. The method according to claim 1, characterized in that The initial video template is parsed using the material type as a split variable to obtain information fragments corresponding to various material types, including: Loading an XML document corresponding to the initial video template, the XML document comprising a root element and a plurality of non-root elements connected to the root element, the plurality of non-root elements comprising a plurality of specific elements, each of which is used to describe a rendering rule for a material type; Starting from the root element, traverse the non-root elements in the XML document to identify the multiple specific elements; A plurality of information segments where the plurality of specific elements are located are extracted as information segments corresponding to the plurality of material types.
3. The method according to claim 2, characterized in that Starting from the root element, non-root elements in the XML document are traversed to identify the multiple specific elements, including: S1. Starting from the root element, traverse the non-root elements in the XML document; S2. For the non-root element currently traversed, obtain the element tag contained in the non-root element currently traversed; S3. If the element tag is a specific tag, determine whether the currently traversed non-root element contains child elements; S4. If the currently traversed non-root element contains a child element, the child element is used as the currently traversed non-root element, and the process returns to step S2. S5. If the element tag is a non-specific tag, continue to the next non-root element and return to step S2; S6. If the currently traversed non-root element does not contain any child elements, the currently traversed non-root element is treated as a specific element.
4. The method according to claim 1, characterized in that: Extracting rendering parameter information corresponding to each of the multiple material types from the information segments corresponding to each of the multiple material types respectively includes: For each information segment, extracting path information of the material file and at least one attribute value of the material file from the information segment, wherein the attribute value is used to render the material file; Reading the material file according to the path information, and determining the material type described by the information segment according to the extension of the material file; At least one attribute to which the at least one attribute value belongs is used as at least one rendering parameter, and the at least one attribute value is used as a default parameter value of the at least one rendering parameter, so as to obtain rendering parameter information corresponding to the material type described by the information segment.
5. The method according to any one of claims 1 to 4, characterized in that: Template-forming the rendering parameter information corresponding to each of the multiple material types to obtain the multiple material templates, including: For each material type, selecting at least one variable parameter from the rendering parameter information corresponding to the material type; Associating a plurality of candidate parameter values for the at least one variable parameter; A material template corresponding to the material type is generated according to a plurality of candidate parameter values associated with the at least one variable parameter.
6. The method according to claim 5, characterized in that Selecting at least one variable parameter from the rendering parameter information corresponding to the material type includes: Pre-configure the weight value of each rendering parameter for the material type; Various rendering parameters are parsed from the rendering parameter information corresponding to the material type, and at least one rendering parameter having a weight value greater than a set weight threshold is selected from the various rendering parameters as the at least one variable parameter.
7. The method according to claim 5, characterized in that Generating a material template corresponding to the material type according to a plurality of candidate parameter values associated with the at least one variable parameter includes: Adding various rendering parameters corresponding to the material type and default parameter values of various rendering parameters to the preset template file; Adding a plurality of candidate parameter values associated with the at least one variable parameter in the preset template file; And a placeholder for carrying the material file corresponding to the material type is added to the preset template file to obtain a material template corresponding to the material type.
8. The method according to any one of claims 1 to 4, 6 and 7, characterized in that Also includes: In response to an input operation on the video generation page for the number of videos and the video category, a batch video generation task is generated, wherein the batch video generation task includes the number of videos N and the video category, where N is an integer ≥ 2; Generate N video instance identifiers according to the batch video generation task, and generate a group of video materials related to the video category for each video instance identifier; For each video instance identifier, determining at least one target materialization template from the multiple materialization templates according to a material type in a group of video materials corresponding to the video instance identifier; Based on the hierarchical relationship between the multiple video materials included in the initial video template, the at least one target material template is combined to obtain a target video template corresponding to the video instance identifier, wherein the target video template is used to describe the rendering rules and hierarchical relationship of the group of video materials; Video generation processing is performed according to the target video templates and a group of video materials corresponding to the N video instance identifiers, so as to obtain N videos under the video category.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the processor is enabled to implement the steps in the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is enabled to implement the steps in the method according to any one of claims 1 to 8.
11. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, enables the processor to implement the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Video template synthesis and recommendation system, method and device and storage medium
CN112667910A
Video production method, template generation method, device and equipment
CN115082595A
Special effect rendering method and device, computer readable medium and electronic equipment
CN115937378A
Media information material processing method and device, electronic equipment and storage medium
CN116801008A
Multi-style video template creation method, system and device and storage medium
CN117412119A
Cited By
Video processing method, video processor, storage medium and program product
CN121194029A