Video generation method and device
By generating incremental rendering data and synthesizing target rendering data, the full rendering problem when frequently modifying video elements is solved, significantly shortening the video generation time and improving user experience.
Patent Information
- Application Number
- CN202411698218.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-21
AI Technical Summary
When users use templates to generate videos, frequently modifying video elements requires full rendering of the entire video, resulting in a longer time to generate the video and a poor user experience.
By obtaining the target template of the first video file and the second template protocol corresponding to the modified second video file, incremental rendering data is generated, and target rendering data of the second video file is synthesized based on the intermediate product and incremental rendering data to avoid Full rendering.
It effectively shortens the time for video generation, improves the efficiency of video generation, and improves the user experience.
Smart Images

Figure CN119496951A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of video processing technology, and in particular, to a video generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Traditional video synthesis technology can be implemented based on real-time rendering. When users use templates to generate videos, the entire video is rendered to generate the final video output. When users modify an element in the video generated by the template, such as changing the special effects at the end of the video, the entire modified video needs to be rendered again.
[0003] However, when users use templates to generate videos, there is a great demand for fast video generation, and users often want to see the video effect immediately after modification. Since modifying some elements of the video requires full rendering of the video, when multiple modifications are required, users have to wait for a long time for the video synthesis effect, resulting in a poor user experience.
[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the invention
[0005] The embodiments of the present application provide a video generation method, apparatus, computer device, computer-readable storage medium, and computer program product to solve or alleviate one or more of the technical problems raised above.
[0006] One aspect of an embodiment of the present application provides a video generation method, the method comprising: Acquire a target template of a first video file; the target template includes a first template protocol and an intermediate product rendered based on the first template protocol; Editing the first video file to obtain a second video file, where the second video file corresponds to a second template protocol; Acquire modification information of the second template protocol relative to the first template protocol; generating incremental rendering data based on the modification information; The target rendering data of the second video file is synthesized according to the intermediate product and the incremental rendering data.
[0007] Optionally, the plurality of intermediate products include text rendering data, visual effect rendering data, audio rendering data and / or video rendering data; and the method further includes: Assigning corresponding index numbers to each of the intermediate products; Correspondingly, synthesizing target rendering data of the second video file according to the intermediate product and the incremental rendering data includes: Based on the modification information, determining a target intermediate product among the plurality of intermediate products; Obtaining the target intermediate product according to the index number corresponding to the target intermediate product; The target intermediate product is merged with the incremental rendering data to obtain target rendering data of the second video file.
[0008] Optionally, obtaining a target template of the first video file includes: Displaying a template download page, wherein the template download page includes template description information and template covers of multiple templates; Selecting the target template from the multiple templates according to the template description information and the template cover; A download request for the target template is sent to a server to download the target template of the first video file to a local computer.
[0009] Optionally, the first template protocol includes first timeline data; the first timeline data includes multiple element data describing the first video file; the second template protocol includes second timeline data; the second timeline data includes multiple element data describing the second video file; Correspondingly, obtaining modification information of the second template protocol relative to the first template protocol includes: Determining differentiated target element data according to the first timeline data and the second timeline data; The differentiated target element data is used to constitute the modification information.
[0010] Optionally, generating incremental rendering data based on the modification information includes: Determining corresponding preset rendering rules based on the differentiated target element data; According to the preset rendering rule, the differentiated target element data is rendered to obtain incremental rendering data.
[0011] Optionally, the multiple element data include: text data, visual effect data, audio data and / or video data.
[0012] Another aspect of an embodiment of the present application provides a video generation device, the device comprising: An acquisition module, used to acquire a target template of a first video file; the target template includes a first template protocol and an intermediate product rendered based on the first template protocol; An editing module, used for editing the first video file to obtain a second video file, where the second video file corresponds to a second template protocol; Correspondingly, the acquisition module is further used to acquire modification information generated by the second template protocol relative to the first template protocol; A rendering module, used for generating incremental rendering data based on the modification information; A synthesis module is used to synthesize the target rendering data of the second video file according to the intermediate product and the incremental rendering data.
[0013] Another aspect of an embodiment of the present application provides a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0014] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.
[0015] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the method described above when executed by a processor.
[0016] The above technical solution adopted in the embodiment of the present application may have the following advantages: The modification information is obtained by comparing the first template protocol with the second template protocol corresponding to the modified second video file. The content corresponding to the modified part is rendered according to the modification information, and the rendering data of the unmodified part reuses the intermediate product, thereby avoiding the need to re-render the video corresponding to the modified template in full. When the user modifies the template multiple times, the video generation time is effectively shortened, the efficiency of video generation is improved, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0018] Figure 1 The flowchart of the video generation method according to the first embodiment of the present application is schematically shown; Figure 2 The newly added flow chart of the video generation method according to the first embodiment of the present application is schematically shown; Figure 3 Schematically shows Figure 1 Flow chart of sub-steps of step S100; Figure 4 Schematically shows Figure 1 Flow chart of sub-steps of step S106; Figure 5 The newly added flow chart of the video generation method according to the first embodiment of the present application is schematically shown; Figure 6 Schematically shows Figure 4 Flow chart of sub-steps of step S400; Figure 7 The newly added flow chart of the video generation method according to the first embodiment of the present application is schematically shown; Figure 8 The newly added flow chart of the video generation method according to the first embodiment of the present application is schematically shown; Fig. 9 Schematically shows Figure 4 Another sub-step flow chart of step S400; Fig.10 The newly added flow chart of the video generation method according to the first embodiment of the present application is schematically shown; Fig.11 Schematically shows Figure 4 Another sub-step flow chart of step S400; Fig.12 A diagram schematically shows an application example of the video generation method according to the first embodiment of the present application; Fig.13 A block diagram schematically shows a video generating device according to the second embodiment of the present application; and Fig.14 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0020] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0021] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.
[0022] First, the following terms are explained: Template: refers to a pre-designed, reusable video framework or structure that can include multiple preset elements, such as backgrounds, text, animations, sound effects, and video clips. Templates can simplify the video production process and help users quickly create professional video content.
[0023] Template protocol: is a data structure or format used to describe and define the properties, configuration, and arrangement of each element in a video template. It can express the components of a video template in a standardized way, making the video editing and rendering process more efficient and flexible.
[0024] Intermediate products: semi-finished products or intermediate data generated during the video synthesis process, including but not limited to rendered textures, synthesized but not yet finalized video clips, etc. These intermediate products can serve as the basis for subsequent synthesis to improve synthesis efficiency.
[0025] Timeline data: It is a data model used in video editing software to organize and display the order and duration of various materials such as video, audio, images, text, filters, stickers, etc. on the timeline.
[0026] Rendering: It is the process of converting data and models (such as 3D scenes, images, and text) into images or animations. Rendering can combine lighting, shadows, textures, materials, and other effects to make the scene more realistic or meet design requirements. Through rendering, the computer can process abstract geometric data or code information into visual images and finally display them on the screen.
[0027] Video synthesis: It is the process of combining multiple images, video clips, audio or other multimedia elements into a whole content. It can be applied in film and television production, video editing, special effects production and animation to integrate each independent element into a coherent visual or auditory effect.
[0028] Texture data: Data used to describe the pixel information of a texture and its position, size, color and other characteristics in an image. The essence of texture data is the image pixel matrix, which can be loaded into memory and applied to a 3D object or 2D plane to make the surface of the object present the desired pattern, color or detail effect.
[0029] Rasterization: Converting vector data to a bitmap, such as converting text to a texture. Specifically, rasterization refers to the process of converting a graphic or image into a grid of pixels or dots. In the image rendering process, rasterization converts vector data that describes shapes (such as lines, polygons, text, etc.) into a series of pixels that can be displayed on the screen, so that the computer can draw and display these graphics. The result of rasterization is a bitmap, in which each pixel has a specific color value, suitable for display on the screen or further processing.
[0030] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the relevant technologies are described below: Traditional video synthesis technology can be implemented based on real-time rendering. When users use templates to generate videos, the entire video is rendered to generate the final video output. When users modify an element in the video generated by the template, such as changing the special effects at the end of the video, the entire modified video needs to be rendered again.
[0031] However, when users use templates to generate videos, there is a great demand for fast video generation, and users often want to see the video effect immediately after modification. Since modifying some elements of the video requires full rendering of the video, when multiple modifications are required, users have to wait for a long time for the video synthesis effect, resulting in a poor user experience.
[0032] To this end, an embodiment of the present application provides a video generation technical solution. In this technical solution, the modification information is obtained by comparing the first template protocol with the second template protocol corresponding to the modified second video file. The content corresponding to the modified part is rendered according to the modification information, and the rendering data of the unmodified part reuses the intermediate product, thereby avoiding the full re-rendering of the video corresponding to the modified template. In the case where the user modifies the template multiple times, the video generation time is effectively shortened, the efficiency of video generation is improved, and the user experience is improved. See below for details.
[0033] Embodiment 1 Figure 1 The flowchart of the video generation method according to the first embodiment of the present application is schematically shown.
[0034] like Figure 1 As shown, the video generation method may include steps S100 to S108, wherein: Step S100, obtaining a target template of a first video file; the target template includes a first template protocol and an intermediate product rendered based on the first template protocol.
[0035] Step S102, editing the first video file to obtain a second video file, where the second video file corresponds to a second template protocol.
[0036] Step S104: obtaining modification information of the second template protocol relative to the first template protocol.
[0037] Step S106: Generate incremental rendering data based on the modification information.
[0038] Step S108: synthesizing target rendering data of the second video file according to the intermediate product and the incremental rendering data.
[0039] The video generation method provided in this embodiment obtains modification information by comparing the first template protocol with the second template protocol corresponding to the modified second video file. The content corresponding to the modified part is rendered according to the modification information, and the rendering data of the unmodified part reuses the intermediate product, thereby avoiding re-rendering the video corresponding to the modified template in full. In the case where the user modifies the template multiple times, the time for video generation is effectively shortened, the efficiency of video generation is improved, and the user experience is improved.
[0040] The following combination Figure 1 , each step in steps S100~S108 and other optional steps are explained in detail.
[0041] Step S100 , obtaining a target template of a first video file; the target template includes a first template protocol and an intermediate product rendered based on the first template protocol.
[0042] Templates enable quick editing and personalized rendering of videos. For example, different video materials can generate a unified final output based on the same template, and the same video can achieve completely different visual effects by switching templates. Templates define the organization of videos, including clips, special effects, timeline information, etc. For example, a template can specify the switching order of multiple scenes in a video, the filter effects applied, and the display time and transition method of each clip.
[0043] In one example, the target template can be generated by video production software, template design tools, or manual configuration by the user. Specifically, the user can define the timeline structure of the video in the template design tool, including the order of clips, audio tracks, visual effects, text, and configuration special effects rules. After the template design is completed, the original materials such as video, audio, and pictures can be imported and associated with specific locations in the timeline. Finally, the video is rendered and the rendering data of the material is exported as an intermediate product, the user's design information is saved as a first template protocol, and the target template containing the first template protocol and the intermediate product is uploaded to the template server in the form of a file compression package for other users to download and use.
[0044] In one example, the first template protocol may include timeline information, element information, effect rules, associated resource paths, etc. Timeline information may be used to describe the video editing order, the start and end time of each segment, transition effects, etc. Element information may define various elements involved in the video, including text, images, sound effects, and special effect parameters. Effect rules may include specific configuration parameters of special effects such as filters, color correction, and scaling. Associated resource paths may point to file resources associated with the template, such as images, audio files, external plug-ins, etc.
[0045] In one example, the first template protocol can be stored in a text format such as JSON, XML, or Protobuf. Exemplarily, the first template protocol can be stored in a text format of Protobuf. Protobuf is a binary serialization protocol that can serialize data into a compact binary form, thereby greatly reducing the file size of the first template protocol and facilitating rapid transmission in a network environment.
[0046] In one example, the intermediate product is the complete rendering data of the first video file, which can be used as a reusable rendering data set in the later stage. The intermediate product may include video frame texture data, audio track, subtitle layer information and text texture data of the first video file.
[0047] Step S102 , edit the first video file to obtain a second video file, and the second video file corresponds to a second template protocol.
[0048] By editing the first video file, a new video file, namely the second video file, can be generated. During the editing process, the structure, content or effect of the first video file changes. In order to obtain these change information, a second template protocol corresponding to the content of the second video file can be generated. The second template protocol records the timeline, special effects, subtitles, audio tracks and other element data of the second video file in a structured form, thereby providing a basis for later video rendering and synthesis.
[0049] In one example, the first video file can be loaded through video editing software (such as Adobe Premiere, Final Cut Pro, etc.), and editing operations can be performed as required. The editing operations can include adding new video clips, modifying the time position or duration of existing clips, applying filter effects, adding subtitle correction, blurring, adding subtitles, audio tracks, or adjusting audio volume, and adding transition effects for scene switching, such as fade in and fade out or wipe transition.
[0050] In one example, in the case of synchronous collaborative editing of a video, the second template protocol can be dynamically and synchronously updated according to the real-time recorded editing operations. When the editor completes all operations and saves the second video file, the process of exporting the second template protocol can be triggered to generate a complete second template protocol.
[0051] Step S104 , obtaining modification information generated by the second template protocol relative to the first template protocol.
[0052] By comparing the second template protocol with the first template protocol, the difference information between the templates can be extracted, thereby identifying the specific modification operations of the user during the editing process.
[0053] In one example, in order to reduce the space occupied by the template protocol and improve transmission efficiency, the template protocol can be compressed into a binary format such as Protobuf format for storage and transmission. However, the template protocol in binary format lacks semantic information of the fields, and the obtained difference information is poorly readable. Therefore, the second template protocol and the first template protocol can first be converted from Protobuf format to timeline data class instances. The template protocol corresponds to the timeline field, and the simplified fields in the template protocol can be completely mapped back to the timeline data structure. By comparing the field contents between the timeline data instances corresponding to the second template protocol and the first template protocol, the newly added, modified or deleted fields are recorded and organized into structured modification information.
[0054] In one example, the modification information may be the addition, deletion, or modification of content, such as changes in text, audio, filters, transition effects, etc. in a video.
[0055] Step S106 , generating incremental rendering data based on the modification information.
[0056] By rendering the modified parts independently to obtain incremental rendering data, instead of rendering the entire video file after the modified template, the rendering time and computing resource consumption can be reduced. Compared with full rendering, incremental rendering only renders the modified parts of the template (such as newly added text, adjusted filters, changed audio, etc.).
[0057] In one example, the modification information may be parsed first to determine the target elements that need to be rendered, such as newly added text, modified visual effects, adjusted audio segments or video clips. Then, based on these target elements, the corresponding rendering data is generated item by item according to the preset rendering rules. For example, for newly added text, text texture data may be generated through rasterization technology; for newly added filter effects, filters may be applied to related video frames and processed image data may be generated. Finally, these processing results are integrated into a set of incremental rendering data.
[0058] To illustrate by way of example, in the first video file, the subtitle of a certain period of time is "Welcome", while in the second video file, the user changes it to "Welcome". After obtaining the modification information, it is identified that the modification involves text elements in the video, so only the modified subtitles can be incrementally rendered to generate new text texture data without rendering the remaining unmodified subtitles. If a filter effect is added to a segment in the second video file (such as a "black and white" filter), this modification will affect every frame of image data of the segment, so only this segment can be rendered without re-rendering the entire video. If the volume of the audio track is adjusted, for example, the volume of the audio track in the second video file is increased by 10%, it is only necessary to re-synthesize the audio track without rendering the video stream.
[0059] Step S108 , synthesizing target rendering data of the second video file based on the intermediate product and the incremental rendering data.
[0060] In this step, the intermediate product downloaded locally is synthesized with the incremental rendering data to quickly generate the target rendering data of the second video file. Through incremental rendering, the initial rendering results are reused to avoid repeated rendering calculations of the unmodified parts, while ensuring the seamless integration of the modified parts with the original video content, thereby significantly improving the efficiency and effect of video rendering.
[0061] In one example, the intermediate product can be loaded first to obtain the saved frames or other data rendered in the first video file, and then the incremental rendering data can be parsed to identify the parts that need to be updated, such as newly added text, modified filter effects, replaced video clips, etc. Then, the incremental rendering data can be merged into the intermediate product through the rendering engine, and the frame sequence of the entire second video file can be integrated and adjusted to ensure that the modified elements are accurately inserted in time and space, and finally generate the target rendering data of the second video file.
[0062] In one example, after the target rendering data of the second video file is generated, the key intermediate products generated in the rendering process, such as frame buffer, filter parameters, etc., can be extracted and combined with the structured information in the second template protocol to package them into a complete template compression package file. The template compression package file can be stored in the Protobuf format for easy transmission, recording the timeline, element position and attribute changes of the second video file. The user can upload the template compression package file to the template download website for other users to download and use.
[0063] In one example, after obtaining the target rendering data, the target rendering data can be encapsulated into a format suitable for video playback and storage. Video data can be stored in standard encapsulation formats such as MP4, MOV, etc. The encapsulated video data may include information such as video tracks, audio tracks, subtitle tracks, etc. After encapsulation, the target rendering data can be encoded and compressed to reduce the file size for easy storage and transmission. The encoding process can select video codecs such as H.264 and HEVC for processing, and set encoding parameters such as resolution, bit rate, etc. according to the requirements of the target playback platform. After encapsulation and encoding, a complete video file is generated, which contains all the visual and audio content and can be played, downloaded, etc. by users.
[0064] In this embodiment, the modification information is obtained by comparing the first template protocol with the second template protocol corresponding to the modified second video file. The content corresponding to the modified part is rendered according to the modification information, and the rendering data of the unmodified part reuses the intermediate product, thereby avoiding the need to re-render the video corresponding to the modified template in full. In the case where the user modifies the template multiple times, the time for video generation is effectively shortened, the efficiency of video generation is improved, and the user experience is improved.
[0065] In an optional embodiment, the plurality of intermediate products include text rendering data, visual effect rendering data, audio rendering data and / or video rendering data; Figure 2 As shown, the method also includes: Step S200, assigning a corresponding index number to each of the intermediate products; Correspondingly, step S108 includes: Step S202: determining a target intermediate product from the plurality of intermediate products based on the modification information.
[0066] Step S204: acquiring the target intermediate product according to the index number corresponding to the target intermediate product.
[0067] Step S206: merge the target intermediate product with the incremental rendering data to obtain target rendering data of the second video file.
[0068] By assigning a unique identifier and index number to each intermediate, it is possible to ensure that the desired intermediate can be quickly found and located in the subsequent synthesis process.
[0069] In one example, when video editing software is processing a video containing multiple elements (such as text, video clips, filter effects, etc.), the timeline data of the template protocol of the video contains information describing the multiple elements. The information of each element in the timeline data corresponds to an intermediate product, and each intermediate product is assigned a unique index number. The elements in the timeline data correspond to the intermediate products one by one. Exemplarily, there is a text element "Welcome" in the timeline data that is displayed from the 5th second to the 10th second. The element corresponds to a generated intermediate product, such as the texture data of the rendered "Welcome". The text element of "Welcome" can be identified as y1 in the timeline data, and a unique index number x1 is set for the intermediate product of the original color of the text. When the intermediate product is needed, the intermediate product can be quickly obtained based on the identifier in the timeline data of the template protocol and the index number corresponding to the intermediate product.
[0070] Exemplarily, first, a unique index number can be assigned to each intermediate product generated when rendering the first video file, for example: text intermediate product y1 (index number: ID1), the content is "Welcome"; filter effect intermediate product y2 (index number: ID2), the effect is "black and white"; video clip intermediate product y3 (index number: ID3), the content is "opening remarks". At this time, exemplarily, the user edits the first video file, and according to the modification information, it can be known that the user has modified the following content: text x1 ("Welcome") is changed to x2 ("Hello"); filter effect f1 ("black and white") is changed to f2 ("retro"); video clip p1 ("opening remarks") has not changed. Therefore, it can be determined that the target intermediate product is the unchanged video clip p1 ("opening remarks"), and the target intermediate product y3 can be quickly searched and obtained from multiple intermediate products through the index number of the target intermediate product y3. After obtaining the target intermediate product y3, it is merged with the newly added rendering data corresponding to x2 and f2 to obtain the target rendering data of the second video file.
[0071] In this embodiment, by assigning an index number to each intermediate product, it is ensured that the desired target intermediate product can be quickly found and located in multiple intermediate products in the subsequent synthesis process. When multiple modifications are made, the target intermediate product corresponding to the unmodified element can be quickly obtained and reused, thereby avoiding unnecessary repeated rendering and further improving the efficiency of video generation.
[0072] In an optional embodiment, if Figure 3 As shown, step S100 includes: Step S300: display a template download page, wherein the template download page includes template description information and template covers of multiple templates.
[0073] Step S302: selecting the target template from the multiple templates according to the template description information and the template cover.
[0074] Step S304: Send a download request for the target template to the server to download the target template of the first video file to the local computer.
[0075] In one example, the template description information may include information such as template name, function, applicable scenario, etc. For example, the description information for a business style template may be "a modern business style suitable for company promotional videos, with professional animation effects and text layout".
[0076] In one example, the template cover can be any frame of the first video file, and the template cover can reflect the key visual elements in the template video. For example, if the template is a promotional video about city scenery, the cover image may be a frame in the video showing skyscrapers and the city night scene. The extraction of the cover image can be done using a video processing tool or library (such as FFmpeg), and the frame at a specific time point can be set to be extracted, or a frame in the video can be randomly selected.
[0077] In one example, the template description information and template cover of multiple templates can be displayed to the user through the front-end page, the template description information can be stored in a database, and the template cover can be a static image file of the template. When the user selects a template, a download request can be sent to the server according to the unique ID of the template. After receiving the request, the server can locate the target template file according to the ID, and package it into a format suitable for downloading, such as a compressed package, and send it to the user.
[0078] In this embodiment, through the template description information and template cover in the template, the user can filter out the target template that suits him / her, and download it locally for use, so as to start video editing or creation, thereby improving the convenience and efficiency of operation.
[0079] In an optional embodiment, the first template protocol includes first timeline data; the first timeline data includes multiple element data describing the first video file; the second template protocol includes second timeline data; the second timeline data includes multiple element data describing the second video file.
[0080] Correspondingly, step S104 includes: Determine the target element data with differentiation according to the first timeline data and the second timeline data, wherein the target element data with differentiation is used to form the modification information.
[0081] In one example, the first template protocol and the second template protocol can store the definition of the template and related element data in a structured and simplified format (such as Protobuf format). The timeline data in the template protocol is a detailed data set that organizes and presents the elements in the template in chronological order. Specifically, the timeline data can be a data set that maps the element data in the template to the timeline and sorts and organizes it according to time.
[0082] In one example, the timeline data may use a data structure such as a tree or a graph to represent each element in the timeline data, and target element data with differentiation may be easily and quickly identified through traversal and comparison algorithms.
[0083] By comparing the first timeline data of the first video file and the second timeline data of the edited second video file, the difference between the two is identified. The differentiated target element data is the modified or updated part, which can reflect the specific changes made during the editing process, including the addition and subtraction of video clips, changes in special effects, and adjustments to audio tracks.
[0084] In one example, the timeline data may be composed of multiple elements, including video clips, audio tracks, special effects, filters, text, etc. The timeline data may be stored in a structured format (such as JSON, XML, etc.), including multiple time periods, each of which represents a specific clip of the video or audio. Before comparing the first timeline data and the second timeline data, the data of the two timelines may be parsed into various elements. For example, the video clip element may include information such as the start time, end time, and file path of the video, the audio track element may include information such as the start time, end time, volume, and audio file path of the audio, the special effects and filter elements may include the name, parameters, and duration of the special effects or filters applied to the clip, and the text elements may include text content, font, position, display time, etc. The differences between the timeline data are obtained by comparing each element one by one.
[0085] By way of example, the text element of the first timeline data may be compared with the text element of the second timeline data. It may be checked whether the text content has been changed, or whether a text element has been added or deleted, for example, the content of text A has changed from "Hello" to "Hi", or text B has been newly added to the second timeline. If the font, size, color, position, etc. of the text has changed, for example, the font of text A has changed from "Arial" to "Verdana", or the display position of the text has moved from the upper left corner of the screen to the middle, it may be determined that the text format and position have changed.
[0086] In one example, after the comparison is completed to determine the differentiated target element data, a differentiated report can be generated based on the differentiated target element data, which can include all elements that are different from the first timeline. The differentiated data may include the following: newly added elements, including newly added video clips, audio tracks, special effects, filters, text, etc.; modified elements, including elements with changed start time, end time, position, parameters, etc.; deleted elements, including elements deleted in the second timeline. The differentiated data can be stored in a structured format, such as JSON or XML format, for subsequent processing.
[0087] In this embodiment, by comparing the first timeline data in the first template protocol and the second timeline data in the second template protocol, the target element data with differences therein are identified. By rendering the target element data and combining it with the intermediate product of the first video file, repeated rendering is reduced. Especially in the case where the user needs to frequently modify the video, the efficiency of video editing, generation and rendering can be greatly improved by processing the differentiated data, thereby improving the user experience.
[0088] In an optional embodiment, if Figure 4 As shown, step S106 also includes: Step S400: determining a corresponding preset rendering rule based on the differentiated target element data.
[0089] Step S402: Render the differentiated target element data according to the preset rendering rule to obtain incremental rendering data.
[0090] The preset rendering rules include the specific operation methods on how to process the target element data. Different types of element data, such as special effects, filters, transitions, etc., correspond to different preset rendering rules.
[0091] In one example, the corresponding preset rendering rules can be compared and matched one by one according to the changes in the target element data. According to each differentiated element data, the appropriate rendering rule can be selected to guide the rendering process. For example, if a video clip has a new "black and white" filter effect, the rendering rules related to the "black and white" filter can be found according to the change and applied to the corresponding video clip. If the text content has changed, the text rendering rule can be used to rasterize the text and convert the text into a texture pattern to ensure that the font, size, position and other parameters can be correctly displayed on the video screen.
[0092] In one example, after determining the preset rendering rule, the target element data is rendered. For example, if a newly added filter effect is detected, only the affected video segment is rendered, and other unmodified parts are not re-rendered.
[0093] For example, when the target element data is a filter element, and a black and white filter is added to a certain segment, the special effect parameters of the black and white filter can be called according to the preset rendering rules and applied to each frame image of the segment. Through the rendering processing of the GPU, a new frame image containing only the black and white filter effect is generated as part of the incremental rendering data. When the target element data is a text element, for example, the content of a text title is changed from "Welcome" to "Hello", texture data with the text "Hello" can be generated according to the text rendering rules, and rendered on the frame of the text without processing other irrelevant frames, thereby quickly generating incremental rendering data containing only the modified text frame.
[0094] In this embodiment, by rendering differentiated target elements based on preset rendering rules, the rendering load can be effectively reduced, and only incremental rendering data is generated, that is, rendering results that only contain changed content, thereby saving system resources and rendering time, and further improving video generation efficiency.
[0095] In an optional embodiment, the multiple element data include: text data, visual effect data, audio data and / or video data.
[0096] In one example, text data may include subtitles, titles, annotations, and other content that appear in the video. Text data may not only refer to the content of the text, but also include information such as the font, color, size, position, animation effects, etc. For example, the company name displayed in the video title and the subtitles of the character dialogue that appear in the video are all text data.
[0097] In one example, visual effect data may refer to filters, transition effects, and various special effect data applied in a video. Visual effect data is used to enhance the look and feel of a video or to express a specific atmosphere. For example, a black and white filter can make a video appear retro, a blur filter can guide the viewer's sight, and a gradient transition effect is used to achieve a smooth transition between different video clips.
[0098] In one example, audio data may include background music, narration, human voice, sound effects, audio format, volume, track position, etc. When editing audio data, the volume can be adjusted, the track length can be increased or decreased, or audio effects such as echo and reverberation can be added. For example, background music can be added to a video, and the volume can be set to match the picture content to create a more vivid effect.
[0099] In one example, video data includes information such as the image frames, frame rate, resolution, and color data of the video, and is the main content of the video. Video data is the core element that constitutes the main body of the video, storing the picture information of each frame. For example, it contains dynamic image content captured by a camera, or an animation scene generated by 3D rendering.
[0100] In this embodiment, multiple element data refers to different types of data constituting a video file, and multiple element data can together constitute the content of a video. In the video editing process, accurate incremental synthesis and rendering can be achieved by accurately identifying and processing various types of element data.
[0101] The preset rendering rules will be further exemplified below through more embodiments.
[0102] In an optional embodiment, the text data includes character positions, character contents and / or character styles for describing a plurality of characters, the first timeline data includes first text data, and the second timeline data includes second text data.
[0103] Correspondingly, if Figure 5 As shown, determining differentiated target element data according to the first timeline data and the second timeline data includes: Step S500: If the second text data is changed in character position, character content and / or character style compared with the first text data, the text data change of the second text data relative to the first text data is obtained.
[0104] Step S502: acquiring the differentiated target element data according to the change of the text data.
[0105] In one example, when editing a video, the user can make adjustments to certain text in the video, such as changing the text content, repositioning the text, or modifying the font and color. By comparing the second text data with the original first text data, it is possible to analyze whether the position, content, and style of each character have changed. The offset of the text position, the replacement of the text content, or the modification of the style (such as font type, size, color, transparency) can be determined as a "text data change", and the difference information corresponding to the specific modified content can be extracted for subsequent processing. After being determined as a "text data change", the specific target element data in the video can be obtained based on the changed content.
[0106] For example, suppose a user adds a text description to a part of a video clip, and the user changes the content from "Welcome to watch!" to "Thank you for watching!", and changes the font from Arial to Times New Roman, and also adjusts the size and color of the text. At this time, the modified text data can be stored as the second text data and compared with the initial first text data. By comparison, it can be found that the text content has changed from "Welcome to watch!" to "Thank you for watching!", the font has changed from Arial to Times New Roman, the color has changed from black to red, and the font size has changed from 20 to 24. Based on these changes in text data, differentiated target element data is determined from multiple element data in the second video file as the basic data for subsequent incremental rendering.
[0107] In this embodiment, by identifying changes in text data, differentiated target element data is generated for the modified character position, content or style, avoiding repeated processing of the unmodified parts. This effectively reduces the amount of rendering calculations, speeds up the response speed of video editing, improves the efficiency and resource utilization of the system, and ensures that the final rendering result can accurately reflect the user's modifications, thereby improving the user's video editing experience.
[0108] In an optional embodiment, if Figure 6 As shown, step S400 includes: Step S600: acquiring a changed character according to a text data change of the second text data relative to the first text data.
[0109] Step S602, rasterizing the changed characters to obtain the incremental rendering data; wherein the incremental rendering data includes texture data of the changed characters.
[0110] In one example, character elements in the first text data and the second text data may be scanned and compared one by one to check whether the content of the character is replaced, the position is adjusted, or the style is changed (such as font, color, size, etc.). When a difference is found, the corresponding character may be marked as a "changed character".
[0111] For example, assume that the subtitle text content in the first video file is "Hello, welcome to watch!" The font is black and the position is centered. The subtitle of the edited second video file is changed to "Hello, welcome to watch again!" The font is changed to red, and the position is adjusted to the bottom of the screen. By comparing the first text data of the first video file with the second text data of the second video file, it can be detected that the two characters "again" belong to the newly added content, and the font color and position of "Welcome to watch" have also changed. Therefore, the data of the changed characters can be recorded as: "Newly added characters 'again', the font of 'Welcome to watch' is changed from black to red, and the position is changed from centered to the bottom". According to the changed characters, the update effects of the changed characters "again" and "Welcome to watch" can be converted into texture data through a rasterization algorithm. The rasterization process can draw the character content and style information (such as color, font, size, etc.) pixel by pixel into image data that can be directly used for display, and generate textures for the image data so that it can be synthesized in the video frame.
[0112] In this embodiment, by comparing the changes of the second text data and the first text data, the changed characters whose position, content or style are changed are identified, rasterization is performed according to the obtained changed characters, and the changed characters are converted into texture data, thereby generating incremental rendering data. The updated character part is rendered, and the remaining unchanged characters can be reused and merged with the incremental rendering data into target rendering data, thereby reducing the steps of repeated rendering and saving rendering resources.
[0113] In an optional embodiment, the audio data includes an audio file path and / or audio attributes, the first timeline data includes first audio data, and the second timeline data includes second audio data; correspondingly, Figure 7 As shown, determining differentiated target element data according to the first timeline data and the second timeline data includes: Step S700: If the audio file path and / or audio attribute of the second audio data is changed compared to the first audio data, obtain the audio data change of the second audio data relative to the first audio data.
[0114] Step S702: acquiring the differentiated target element data according to the change of the audio data.
[0115] In one example, the audio data change can be obtained by comparing the audio file path or audio attribute in the timeline data of the second video file with the timeline data of the first video file. For example, if the user changes the background music file, it can be detected that the audio file path in the timeline data of the second video file has changed; or if the user changes the volume or playback speed of the audio, the change of the audio attribute can be detected.
[0116] For example, if the audio data in the first video file records the audio information with the path " / audio / music1.mp3" and the volume of 70%. In the second video file, the user selects the new background music file path " / audio / music2.mp3" and adjusts the volume to 85%. By comparing the second audio data with the first audio data, it can be determined that the audio path and volume have changed, and the changes are extracted as audio data changes. Based on the audio data changes, the audio path " / audio / music2.mp3" and the new volume setting of 85% can be determined as target element data.
[0117] In this embodiment, by comparing the difference between the second audio data and the first audio data, the change of the audio content can be accurately identified, including the change of the audio file path and the audio attribute. Then, the part of the audio track that only needs to be resynthesized can be quickly found to achieve incremental rendering. By accurately locating the change position of the audio data, only the changed audio part can be processed, which improves processing efficiency and saves resources.
[0118] In an optional embodiment, step S400 includes: An audio track is synthesized according to the second audio data to obtain incremental rendering data including the audio track.
[0119] In one example, an audio track can be composed of multiple audio segments, each of which can correspond to a different scene or time period in a video. When the audio file path or audio properties (such as volume, sound effects, etc.) change, the audio segments that have been modified can be compared to determine which audio segments have been modified, and the audio segments of these changed parts can be processed to generate accurate incremental rendering data, optimize the rendering process, and improve efficiency.
[0120] In one example, when a user edits a video audio, some segments in the audio track are modified. For example, the user replaces the background music in the first minute of the video and increases the volume by 10%. At this time, the position of the modified audio segment can be determined based on the audio data change of the second audio data relative to the first audio data, and then only the modified audio segment needs to be synthesized, and the remaining unmodified audio segments do not need to be rendered repeatedly.
[0121] In one example, an audio track may be composed of multiple audio segments, and each segment may be distinguished by setting an index number according to the timeline to determine which segments have been modified and the position of the modified segments in the video, thereby accurately generating incremental rendering data containing only the modified parts.
[0122] For example, in the first timeline data, the audio track is divided into multiple sections, for example: 0:00-1:00: background music "A", 1:00-2:00: background sound effect "B", 2:00-3:00: background music "C". At this time, the user changes the background music of the first audio section (0:00-1:00) from "A" to "D", and increases the volume to 80%, and the remaining audio sections do not change. By comparing the first timeline data and the second timeline data, it can be identified that the 0:00-1:00 section has changed, and then only the audio track of this section needs to be re-synthesized to generate incremental rendering data. After obtaining the incremental rendering data, the incremental rendering data can be synthesized with the intermediate products corresponding to the audio sections (1:00-2:00 and 2:00-3:00) that have not changed to form the final audio track rendering data.
[0123] In this embodiment, the audio track is synthesized according to the audio data change between the second audio data and the first audio data to generate incremental rendering data including the audio track. By comparing different audio segments to determine which parts have been modified, and only processing the changed parts, accurate incremental rendering data is generated, avoiding the repeated rendering process of unmodified audio data, and further improving video editing efficiency.
[0124] In an optional embodiment, the visual effect data includes filter effect start and end time, transition effect start and end time, filter effect parameters and / or transition effect parameters, the first timeline data includes first visual effect data, and the second timeline data includes second visual effect data; correspondingly, Figure 8 As shown, determining differentiated target element data according to the first timeline data and the second timeline data includes: Step S800, if the second visual effect data is changed compared with the first visual effect data in terms of filter effect start and end time, transition effect start and end time, filter effect parameters and / or transition effect parameters, obtain the visual effect data change of the second visual effect data relative to the first visual effect data.
[0125] Step S802: acquiring the differentiated target element data according to the change of the visual effect data.
[0126] In one example, the start and end times of the visual effects in the first and second timelines can be compared. If the time period changes, the specific location of the changed time period needs to be determined to determine the area that needs to be re-rendered. For example, the start time of the filter is changed from 0:00 to 0:30, and the end time is changed from 2:00 to 2:30. According to the change in visual effect data, it can be determined that the affected video segment is 0:00~2:30, and the differentiated target element data is the filter effect element corresponding to 0:00~2:30.
[0127] In one example, the filter parameters of the visual effects in the first and second timelines can be compared. The filter parameters may include filter strength, color, blur, etc. By comparing the differences in these parameters, it is possible to determine which visual effects need to be updated, as well as the specific paragraphs to be updated. For example, the filter strength of the first visual effect in the first timeline data is 50%, and the filter strength of the second visual effect in the second timeline is changed to 80%. By comparison, it can be seen that the visual effect data changes to an increase in filter strength, and correspondingly, the target element data is the filter strength of the second visual effect in the second video file. The corresponding modified paragraph in the second video file is determined according to the target element data, and the modified paragraph is rendered to obtain incremental rendering data.
[0128] For example, when it is detected that the start and end time of the "retro filter" in the second timeline data has changed (for example, from 0:00-2:00 to 0:30-2:30), and the filter strength has also changed (for example, from 50% to 70%). At this time, the 0:30~2:30 segment can be incrementally rendered using the new filter effect. For example, the transition effect in the second timeline is changed from "fade in" to "rotate transition", and the transition time is reduced from 2 seconds to 1 second. The period (2:00-3:00) during which the transition effect changes can be re-rendered.
[0129] In this embodiment, according to the difference between the second visual effect data and the first visual effect data, the visual effect data changes are extracted, and the differentiated target element data are obtained according to these changes. By comparing the visual effect data in the first and second timelines, the video frames in the second video file that have changed relative to the first video file are identified, thereby ensuring that the synthesized final video content accurately reflects these changes, avoiding repeated rendering of unmodified video frames, and further improving the efficiency of video rendering.
[0130] In an optional embodiment, if Fig. 9 As shown, step S400 includes: Step S900: Acquire multiple video frames of the second video file.
[0131] Step S902, obtaining a target video frame associated with the change of the visual effect data from the plurality of video frames.
[0132] Step S904: Render the target video frame according to the second visual effect data to obtain the incremental rendering data including the rendering data of the target video frame.
[0133] In one example, a video file can be decoded frame by frame by video editing software to obtain pixel data and time information of each frame. Video frames are the basic components of a video. Each frame is a still image in the video playback. Each frame can contain different visual effect data, such as filters, transitions, text animations, etc.
[0134] In one example, by comparing the changes in the timeline data of the first video file and the second video file, the video frame associated with the visual effect change can be determined. The visual effect change may include the start and end of the filter application, the change of the transition effect, the adjustment of the animation effect, etc. The visual effect data in each frame of data is associated with a timestamp, and the target video frame to be rendered can be determined by searching for the timestamp with the change.
[0135] In one example, after the target video frame is determined, the target video can be rendered according to the change of visual effect data (such as filter strength change, transition time adjustment, etc.). The rendering operation can include adjustment of visual effect parameters, such as applying a new filter, changing color, adjusting animation speed, etc., and after rendering, new pixel data is generated as incremental rendering data. The incremental rendering data includes the rendering results of the changed frame, without re-rendering the entire video.
[0136] In this embodiment, by extracting target video frames associated with changes in visual effect data from the second video file and generating incremental rendering data based on these changes in visual effect data, local rendering is performed on the changed parts, thereby further improving rendering efficiency and saving computing resources.
[0137] In an optional embodiment, the video data includes video duration, the first timeline data includes first video data, and the second timeline data includes second video data; correspondingly, Fig.10 As shown, determining differentiated target element data according to the first timeline data and the second timeline data includes: Step S1000: If the second video data has a different video duration than the first video data, a video data change of the second video data relative to the first video data is obtained.
[0138] Step S1002: acquiring the differentiated target element data according to the change of the video data.
[0139] In one example, the duration in a video file refers to the total time the video is played. The duration of a video can be provided by the header information or metadata of the video file, and the duration data can be obtained through a video parsing tool. For example, the duration of the first video file is 10 minutes, and the duration of the second video file may change after editing, such as increasing or decreasing part of the duration. The change in duration can come from operations such as deleting, adding, and adjusting the length of a video clip.
[0140] In one example, if the duration of the second video file is different from that of the first video file, it can be determined that the video data has changed. For example, the duration of the first video is 10 minutes, and the duration of the second video becomes 9 minutes after editing, indicating that some video segments may have been cut or additional segments may have been added during the editing process.
[0141] By way of example, by obtaining the video duration information, it is found that the duration of the first video is 10 minutes, and the duration of the second video is 8 minutes after editing. It can be determined that some parts were cut out during the editing process. The deleted content and the corresponding video position can be marked as video data changes, and the differentiated target element is determined to be a video data element based on the video data changes.
[0142] In this embodiment, by comparing the timeline data of the first video file and the second video file, the changes in the video length are determined, and based on the changes, the target element data that needs to be updated or processed is extracted, thereby accurately locating the modified segments and types of the video, generating appropriate incremental rendering data, and further improving the video generation efficiency.
[0143] In an optional embodiment, if Fig.11 As shown, step S400 includes: Step S1100, when the video data changes to increase the video length, obtain a newly added video segment.
[0144] Step S1102: Render the newly added video segment to obtain incremental rendering data including rendering data of the newly added video segment.
[0145] In one example, by obtaining the target element data with differentiation between the first video file and the second video file as video data, the corresponding preset rendering strategy can be determined. According to the specific changes in the video data, the modified paragraph is determined. For example, the total length of the first video file is 100 seconds, and the total length of the second video file is 120 seconds. By comparison, it can be known that 20 seconds of video content has been added. The newly added 20 seconds of content can be extracted as a newly added video clip and marked as a paragraph to be rendered. The newly added video clip can include new scenes, picture effects or additional audio, etc. For example, the part from the 100th second to the 120th second is a newly added video clip, which can be marked as the target area to be rendered.
[0146] In one example, after locating the position of the newly added video segment, each frame can be rendered according to a preset rendering rule to generate independent rendering data of the newly added video segment without rendering the entire video. For example, if the newly added segment contains special filter effects or animation transitions, these effects can be applied frame by frame during rendering. After obtaining the incremental rendering data including the rendering result of the newly added video segment, the incremental rendering data corresponding to the newly added video segment can be added with a corresponding index number and uploaded to the server so that it can be reused in the subsequent video synthesis stage.
[0147] In this embodiment, by rendering the newly added video clips separately to obtain incremental rendering data, re-rendering the entire video is avoided, which not only processes the newly added content but also reduces the repeated processing of the existing content. This further improves the rendering efficiency, saves computing resources, and further accelerates the overall synthesis speed of the video.
[0148] In order to make this application easier to understand, the following Fig.12 An exemplary application is provided.
[0149] S11, downloading the target template to the local computer, the target template includes the first template protocol and the intermediate products rendered based on the first template protocol, such as text texture after rendering, video stream and audio stream that have been synthesized but not yet finally synthesized.
[0150] S12, assigning a unique index number to each intermediate product.
[0151] S13, parsing the first template protocol, combining the original video provided by the user, generating a first video file, and editing the first video file to obtain a second video file. For example, the editing operation may be to adjust the filter effect of the video clip in the first 3 seconds of the first video file.
[0152] S14, click Save after editing is completed, and export the second timeline data of the second video file from the editing software. The second timeline data includes the start time, end time, attributes and other information of all elements of the second video file, such as video, audio, text, filter, transition, etc.
[0153] S15, convert the data in the first template protocol into the first timeline data, and identify the changed elements by comparing the timeline data of the first video file and the second video file. The changed elements may include rasterized text, adding music, adding filter layers, adding transition effects, video transcoding or audio transcoding, etc. For example, if the timeline data of the second video file changes compared to the text content, position, style and other attributes of the first video file, it can be determined as a text element change; and for changes in the audio file path or audio data, it is determined as a music element change; and if the application scope and parameters of the filter / transition change, it is determined as a filter and transition element change.
[0154] S16, determine the rendering strategy according to different change elements. For example, if the text at a certain place is changed, the previously synthesized video-level persistent texture data is used as the basis, and only the modified text part is rasterized. At this time, the added text does not need to be rasterized again, because the intermediate product contains the rasterized text texture of the added text, and only the updated and changed part needs to be rasterized. If a certain music segment is changed, the audio track of the music segment is resynthesized, and the existing filters, stickers, transitions, text, etc. do not need to be reprocessed. Just add the audio track and repackage it. If the filter and transition are changed, the new filter or transition effect can be reapplied according to the video clip involved in the change of the filter / transition. At this time, only the video frames affected by the change are rendered. For example, in a multi-segment video, only the filter of segment 1 is modified, and the filter of segment 2 is not modified, then only the filter is added to segment 1 and then re-rendered and synthesized. If a certain video segment is added, only the newly added video segment is rendered, and then the intermediate product is reused and the rendering result of the newly added video segment is merged.
[0155] S17, after acquiring the newly added rendering data corresponding to the modified part, merge the newly added rendering data with the intermediate product corresponding to the unmodified part, encapsulate the audio and video files, and generate a final video file.
[0156] S18, outputting and saving the final video file to a specified location.
[0157] In this exemplary application, the modification information is obtained by comparing the first template protocol with the second template protocol corresponding to the modified second video file. The content corresponding to the modified part is rendered according to the modification information, and the rendering data of the unmodified part reuses the intermediate product, thereby avoiding the need to re-render the video corresponding to the modified template in full. When the user modifies the template multiple times, the time for video generation is effectively shortened, the efficiency of video generation is improved, and the user experience is improved.
[0158] Embodiment 2 Fig.13 The block diagram of the video generation device according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Fig.13 As shown, the video generation device 1600 may include: an acquisition module 1610, an editing module 1620, a rendering module 1630, and a synthesis module 1640, wherein: The acquisition module 1610 is used to acquire a target template of the first video file; the target template includes a first template protocol and an intermediate product rendered based on the first template protocol; The editing module 1620 is used to edit the first video file to obtain a second video file, and the second video file corresponds to a second template protocol; correspondingly, the acquisition module 1610 is also used to obtain modification information generated by the second template protocol relative to the first template protocol; A rendering module 1630, configured to generate incremental rendering data based on the modification information; The synthesis module 1640 is used to synthesize the target rendering data of the second video file according to the intermediate product and the incremental rendering data.
[0159] As an optional embodiment, the plurality of intermediate products include text rendering data, visual effect rendering data, audio rendering data and / or video rendering data; the apparatus 1600 is further configured to: Assigning corresponding index numbers to each of the intermediate products; Correspondingly, synthesizing target rendering data of the second video file according to the intermediate product and the incremental rendering data includes: Based on the modification information, determining a target intermediate product among the plurality of intermediate products; Obtaining the target intermediate product according to the index number corresponding to the target intermediate product; The target intermediate product is merged with the incremental rendering data to obtain target rendering data of the second video file.
[0160] As an optional embodiment, the device 1600 is further used for: Displaying a template download page, wherein the template download page includes template description information and template covers of multiple templates; Selecting the target template from the multiple templates according to the template description information and the template cover; A download request for the target template is sent to a server to download the target template of the first video file to a local computer.
[0161] As an optional embodiment, the first template protocol includes first timeline data; the first timeline data includes multiple element data describing the first video file; the second template protocol includes second timeline data; the second timeline data includes multiple element data describing the second video file; correspondingly, the device 1600 is further used for: Determining differentiated target element data according to the first timeline data and the second timeline data; The differentiated target element data is used to constitute the modification information.
[0162] As an optional embodiment, the device 1600 is further used for: Determining corresponding preset rendering rules based on the differentiated target element data; According to the preset rendering rule, the differentiated target element data is rendered to obtain incremental rendering data.
[0163] As an optional embodiment, the multiple element data include: text data, visual effect data, audio data and / or video data.
[0164] Embodiment 3 Fig.14 The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing the video generation method according to the third embodiment of the present application is schematically shown. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Fig.14As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them: The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 can be an internal storage module of the computer device 10000, such as a hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 can also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 can also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store an operating system and various application software installed in the computer device 10000, such as program codes of a video generation method, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or are to be output.
[0165] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.
[0166] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.
[0167] It should be pointed out that Fig.14 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0168] In this embodiment, the video generation method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.
[0169] Embodiment 4 An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the video generating method in the embodiment are implemented.
[0170] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the video generation method in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0171] Embodiment 5 An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0172] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0173] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A video generation method, characterized in that: Acquire a target template of a first video file; the target template includes a first template protocol and an intermediate product rendered based on the first template protocol; Editing the first video file to obtain a second video file, where the second video file corresponds to a second template protocol; Acquire modification information of the second template protocol relative to the first template protocol; generating incremental rendering data based on the modification information; The target rendering data of the second video file is synthesized according to the intermediate product and the incremental rendering data.
2. The method according to claim 1, characterized in that The plurality of intermediate products include text rendering data, visual effect rendering data, audio rendering data and / or video rendering data; the method further includes: Assigning corresponding index numbers to each of the intermediate products; Correspondingly, synthesizing target rendering data of the second video file according to the intermediate product and the incremental rendering data includes: Based on the modification information, determining a target intermediate product among the plurality of intermediate products; Obtaining the target intermediate product according to the index number corresponding to the target intermediate product; The target intermediate product is merged with the incremental rendering data to obtain target rendering data of the second video file.
3. The method according to claim 1, characterized in that Obtaining a target template for the first video file includes: Displaying a template download page, wherein the template download page includes template description information and template covers of multiple templates; Selecting the target template from the multiple templates according to the template description information and the template cover; A download request for the target template is sent to a server to download the target template of the first video file to a local computer.
4. The method according to claim 1, characterized in that: The first template protocol includes first timeline data; the first timeline data includes multiple element data describing the first video file; the second template protocol includes second timeline data; the second timeline data includes multiple element data describing the second video file; Correspondingly, obtaining modification information of the second template protocol relative to the first template protocol includes: Determining differentiated target element data according to the first timeline data and the second timeline data; The differentiated target element data is used to constitute the modification information.
5. The method according to claim 3, characterized in that: Generating incremental rendering data based on the modification information includes: Determining corresponding preset rendering rules based on the differentiated target element data; According to the preset rendering rule, the differentiated target element data is rendered to obtain incremental rendering data.
6. The method according to any one of claims 4 to 5, characterized in that The various element data include: text data, visual effect data, audio data and / or video data.
7. A video generating device, characterized in that: The device comprises: An acquisition module, used to acquire a target template of a first video file; the target template includes a first template protocol and an intermediate product rendered based on the first template protocol; An editing module, used for editing the first video file to obtain a second video file, where the second video file corresponds to a second template protocol; Correspondingly, the acquisition module is further used to acquire modification information generated by the second template protocol relative to the first template protocol; A rendering module, used to generate incremental rendering data based on the modification information; A synthesis module is used to synthesize the target rendering data of the second video file according to the intermediate product and the incremental rendering data.
8. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to claims 1 to 6 are implemented.