Video generation method and device

By using the synthesis method of initial rendering data and incremental rendering data during the video editing process, the problem of low video generation efficiency under traditional full rendering method is solved, and a more efficient video rendering and editing experience is achieved.

CN119496950APending Publication Date: 2025-02-21SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411698202.8
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

Technical Problem

In the process of long video or high-resolution video editing, the traditional full-scale rendering method consumes time and consumes a lot of computing resources, resulting in low video generation efficiency and reduced user experience.

Method used

By obtaining the initial rendering data of the video file and extracting modification information after editing, generating incremental rendering data, synthesizing the target rendering data to generate the final video file, avoiding full rendering.

Benefits of technology

It effectively reduces video rendering time, reduces computing volume and storage needs, improves video editing efficiency and response speed, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496950A_ABST
    Figure CN119496950A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a video generation method. The method comprises the following steps: acquiring initial rendering data of a first video file; editing the first video file to obtain a second video file; obtaining modification information generated by the second video file relative to the first video file; generating incremental rendering data based on the modification information; and synthesizing target rendering data of the second video file according to the initial rendering data and the incremental rendering data. According to the embodiment of the invention, only the modified part is rendered by multiplexing the initial rendering result, so that full-amount rendering after video editing is avoided. In an editing scene of a long video or a high-resolution video, the video rendering time can be effectively shortened, the calculation amount and the storage requirement can be reduced, the video editing efficiency and the response speed are improved, and then the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

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] In the traditional video editing process, after the video content is modified, the entire video can be re-rendered by full rendering. For example, the modified video can be redrawn and the final video output can be generated through the OpenGL (Open Graphics Library) graphics processing interface.

[0003] However, when editing long videos or high-resolution videos, this full-rendering video generation method is time-consuming and consumes a lot of computing resources, resulting in low video generation efficiency and reduced 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: Obtaining initial rendering data of a first video file; Editing the first video file to obtain a second video file; Acquire modification information of the second video file relative to the first video file; generating incremental rendering data based on the modification information; The target rendering data of the second video file is synthesized according to the initial rendering data and the incremental rendering data.

[0007] Optionally, obtaining modification information of the second video file relative to the first video file includes: Acquire first timeline data of the first video file, where the first timeline data includes multiple element data describing the first video file; Acquire second timeline data of the second video file, where the second timeline data includes multiple element data describing the second video file; 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.

[0008] 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.

[0009] Optionally, the multiple element data include: text data, visual effect data, audio data and / or video data.

[0010] Optionally, 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; and determining differentiated target element data according to the first timeline data and the second timeline data includes: If the second character data is changed in character position, character content and / or character style compared with the first character data, obtaining a character data change of the second character data relative to the first character data; According to the change of the text data, the differentiated target element data is obtained.

[0011] Optionally, determining a corresponding preset rendering rule based on the differentiated target element data includes: acquiring a changed character according to a change in the character data of the second character data relative to the first character data; Performing rasterization processing on the changed characters to obtain the incremental rendering data; Wherein, the incremental rendering data includes texture data of the changed characters.

[0012] Optionally, 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; and determining differentiated target element data according to the first timeline data and the second timeline data includes: If the second audio data is changed in the audio file path and / or the audio attribute compared with the first audio data, obtaining the audio data change of the second audio data relative to the first audio data; According to the change of the audio data, the differentiated target element data is obtained.

[0013] Optionally, determining a corresponding preset rendering rule based on the differentiated target element data includes: According to the change of the audio data, the audio track is synthesized to obtain incremental rendering data including the audio track.

[0014] Optionally, 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; determining differentiated target element data according to the first timeline data and the second timeline data includes: If the second visual effect data is changed in filter effect start and end time, transition effect start and end time, filter effect parameter and / or transition effect parameter compared with the first visual effect data, obtaining a visual effect data change of the second visual effect data relative to the first visual effect data; According to the change of the visual effect data, the differentiated target element data is obtained.

[0015] Optionally, determining a corresponding preset rendering rule based on the differentiated target element data includes: Acquire multiple video frames of the second video file; Acquire a target video frame associated with the change of the visual effect data from the plurality of video frames; According to the change of the visual effect data, the target video frame is rendered to obtain the incremental rendering data including the rendering data of the target video frame.

[0016] Optionally, the video data includes video duration, the first timeline data includes first video data, and the second timeline data includes second video data; and determining differentiated target element data according to the first timeline data and the second timeline data includes: If the second video data has a different video duration than the first video data, obtaining a video data change of the second video data relative to the first video data; According to the change of the video data, the differentiated target element data is obtained.

[0017] Optionally, determining a corresponding preset rendering rule based on the differentiated target element data includes: When the video data changes to increase the video duration, obtaining a newly added video segment; The newly added video segment is rendered to obtain incremental rendering data including rendering data of the newly added video segment.

[0018] Another aspect of an embodiment of the present application provides a video generation device, the device comprising: An acquisition module, used for acquiring initial rendering data of a first video file; An editing module, used for editing the first video file to obtain a second video file; correspondingly, the acquisition module is also used for acquiring modification information of the second video file relative to the first video file; A rendering module, used for generating incremental rendering data based on the modification information; A synthesis module is used to synthesize target rendering data of the second video file according to the initial rendering data and the incremental rendering data.

[0019] 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.

[0020] 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.

[0021] 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.

[0022] The embodiment of the present application adopts the above technical solution and may include the following advantages: by obtaining the initial rendering data of the first video file, and extracting the modification information after editing the first video file, generating incremental rendering data according to the modification information, and then synthesizing the initial rendering data with the incremental rendering data to obtain the target rendering data of the second video file. The initial rendering result is reused, and only the modified part is rendered, thereby avoiding the full rendering after video editing. In the editing scenario of long videos or high-resolution videos, it can effectively reduce the video rendering time, reduce the amount of calculation and storage requirements, improve the video editing efficiency and response speed, and thus improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] 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.

[0024] Figure 1 The flowchart of the video generation method according to the first embodiment of the present application is schematically shown; Figure 2 Schematically shows Figure 1 Flow chart of sub-steps of step S104; Figure 3 Schematically shows Figure 1 Flow chart of sub-steps of step S106; Figure 4 Schematically shows Figure 2 Flow chart of sub-steps of step S204; Figure 5 Schematically shows Figure 3 Flow chart of sub-steps of step S300; Figure 6 Schematically shows Figure 2 Another sub-step flow chart of step S204; Figure 7 Schematically shows Figure 2 Another sub-step flow chart of step S204; Figure 8 Schematically shows Figure 3 Another sub-step flow chart of step S300; Fig. 9 Schematically shows Figure 2 Another sub-step flow chart of step S204; Fig.10 Schematically shows Figure 3 Another sub-step flow chart of step S300; Fig.11 A diagram schematically shows an application example of the video generation method according to the first embodiment of the present application; Fig.12 A block diagram schematically shows a video generating device according to the second embodiment of the present application; and Fig.13 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0025] 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.

[0026] 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.

[0027] 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.

[0028] First, the following terms are explained: 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.

[0029] 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.

[0030] 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.

[0031] OpenGL: It is a cross-language, cross-platform application programming interface for rendering 2D and 3D vector graphics. It is used to generate 2D and 3D graphics. It provides a set of standard functions that allow developers to control the computer's graphics hardware by writing code to render high-quality graphics effects.

[0032] 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.

[0033] 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.

[0034] 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: In the traditional video editing process, after the video content is modified, the entire video can be re-rendered by full rendering. For example, the modified video can be redrawn and the final video output can be generated through the OpenGL (Open Graphics Library) graphics processing interface. However, when editing long videos or high-resolution videos, this full-rendering video generation method is time-consuming and consumes a lot of computing resources, resulting in low video generation efficiency and reduced user experience.

[0035] To this end, an embodiment of the present application provides a video generation technology solution. In this technical solution, by reusing the initial rendering results, only the modified part is rendered, thereby avoiding the full rendering after video editing. In the editing scenario of long videos or high-resolution videos, it can effectively reduce the video rendering time, reduce the amount of calculation and storage requirements, improve the video editing efficiency and response speed, and thus improve the user experience. See below for details.

[0036] Embodiment 1 Figure 1 The flowchart of the video generation method according to the first embodiment of the present application is schematically shown.

[0037] like Figure 1 As shown, the video generation method may include steps S100 to S108, wherein: Step S100: obtaining initial rendering data of a first video file.

[0038] Step S102: edit the first video file to obtain a second video file.

[0039] Step S104: obtaining modification information of the second video file relative to the first video file.

[0040] Step S106: Generate incremental rendering data based on the modification information.

[0041] Step S108: synthesizing target rendering data of the second video file according to the initial rendering data and the incremental rendering data.

[0042] The video generation method provided in this embodiment obtains the initial rendering data of the first video file, extracts the modification information after the first video file is edited, generates incremental rendering data according to the modification information, and then synthesizes the initial rendering data with the incremental rendering data to obtain the target rendering data of the second video file. It can be seen that this embodiment reuses the initial rendering result and only renders the modified part, thereby avoiding the full rendering after the video is edited. In the editing scenario of long videos or high-resolution videos, it can effectively reduce the video rendering time, reduce the amount of calculation and storage requirements, improve the video editing efficiency and response speed, and thus improve the user experience.

[0043] The following combination Figure 1 , each step in steps S100~S108 and other optional steps are explained in detail.

[0044] Step S100 , obtain initial rendering data of the first video file.

[0045] The initial rendering data 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 initial rendering data may include video frame texture data, audio track, subtitle layer information and text texture data of the first video file.

[0046] In one example, the associated initial rendering data storage location can be searched in a cache database or file system based on the unique identifier of the first video file, such as the file name or file path. An index system can be set in the cache database or file system to record the initial rendering data file path or database record corresponding to each video file. After finding the initial rendering data storage location, the relevant data is loaded. Since the loaded data can be stored in multiple parts separately, such as audio and video frame data are stored separately, the initial rendering data can be parsed and reorganized, and the data of different parts can be combined for direct use in subsequent processing. Exemplarily, the initial rendering data can include video frames, background music, and subtitles. After parsing these data types, the video frame images, audio data, and subtitle information are saved in layers and aligned on the timeline. A time index can be established for each video frame, audio clip, and subtitle unit, thereby improving the efficiency of searching for the required initial rendering data.

[0047] Step S102 , edit the first video file to obtain a second video file.

[0048] By editing the first video file, you can add or delete materials, apply filters, modify text, insert video clips, etc., so that the first video file better meets specific needs and forms a second video file containing the modified content.

[0049] In one example, the first video file may be subjected to a variety of editing operations through video editing software, which may include adding subtitles, applying filter effects, adjusting the playback speed, inserting audio tracks or special effects, and the like.

[0050] Step S104 , obtain modification information of the second video file relative to the first video file.

[0051] By identifying and obtaining specific modifications made to the second video file relative to the first video file, the portion that needs to be re-rendered can be determined.

[0052] 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.

[0053] In one example, the second video file is the result of a user editing the first video file, for example, adding text, inserting music, or adjusting the brightness. Through video editing software, the differences between the first video file and the second video file can be compared, including modifying the elements of the video (such as text, audio, filters, etc.), and extracting the corresponding modification information.

[0054] In one example, the timeline data of the first video file and the second video file can be obtained through video editing software. By comparing the timeline data of the two video files, it is possible to identify which content has been modified. Specifically, the timeline data may include attributes of the video element, such as the start time, end time, duration, text, audio file, filter, transition effect, etc. For example, by comparing the timeline data of the first video file and the second video file, it is detected that the text, filter effect, and volume of the audio track of the second video file at a certain point in time are different from those of the first video file, and these differences can be marked as part of the modification information. The modification information may indicate that the second video file has added a text description, modified the filter effect, and adjusted the volume of the audio track at a certain point in time.

[0055] In one example, the image data of each frame of the first video file and the second video file can be compared to identify visual modifications (such as subtitle changes, filter applications, transition effects, etc.). Specifically, a video decoder can be used to convert the video into image frames, and the image data of each frame can be extracted from the two video files. The pixel data of each frame is compared to find the visually changed parts. For example, if new text is added to a frame in the second video file or the background color is changed, the difference can be detected by the pixel change, and each frame that has changed can be marked and recorded as modification information.

[0056] In one example, modification information can be obtained through version history records. Video editing software can provide version control or history record functions, which can be used to track and compare modifications to video files. Specifically, version history information is extracted from the video editing software, and modification records of the first video file and the second video file are obtained. By viewing the historical modification records, it is understood which parts have been edited, deleted, or added, and these modification records can be used as modification information. For example, a user deleted a segment of the first video file in a certain version of the second video file, or added a transition effect. The above modification information can be obtained through the version modification record.

[0057] Step S106 , generating incremental rendering data based on the modification information.

[0058] By rendering the modified parts independently to obtain incremental rendering data, instead of rendering the entire video file in full, you can reduce rendering time and computing resource consumption. Compared with full rendering, incremental rendering only renders the modified parts (such as newly added text, adjusted filters, changed audio, etc.).

[0059] 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.

[0060] Step S108, synthesizing target rendering data of the second video file according to the initial rendering data and the incremental rendering data.

[0061] In one example, the correspondence between the incremental rendering data and the initial rendering data can be confirmed first to synthesize the target rendering data. Specifically, the timestamp, frame number or timeline data information can be used to determine which parts of the initial rendering data have been modified, and then replaced with the incremental rendering data at the corresponding time. After confirming that the rendering data is aligned with the video timeline, each frame can be synthesized. If a frame falls within the modification range of the incremental rendering data, the updated content in the incremental rendering data (such as a "black and white" filter, text update, etc.) can be used, otherwise the content of the corresponding frame in the initial rendering data can be reused.

[0062] For example, assume that the first video file is a short film containing a tourist attraction, and the second video file has edited the video as follows: a "black and white" filter is added to segment 1, a text description is added to segment 2, and the font size of the text is adjusted, and the transition effect of segment 3 is modified to a "dissolve" effect. At this time, the initial rendering data may include the original tourist attraction video, as well as the unmodified part of the filter, text and other content. The incremental rendering data may include the "black and white" filter effect of segment 1, and the image data of segment 1 will be applied with the "black and white" filter to generate incremental rendering data; the new text and font adjustment of segment 2, and the text update of segment 2 will apply a new text style to generate new rendering frame data; the transition effect of segment 3 is updated, and the transition effect of segment 3 will be updated to "dissolve", and the video frame corresponding to the effect of this part will be re-rendered. After the incremental rendering data is synthesized with the initial rendering data, the target rendering data of the second video file is generated, including the modified content such as the "black and white" filter, font adjustment and the newly added rendering data corresponding to the transition effect, and the unmodified part such as the video rendering data of the original scenic spot.

[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 an optional embodiment, if Figure 2As shown, step S104 includes: Step S200: Acquire first timeline data of the first video file, where the first timeline data includes a variety of element data describing the first video file.

[0065] Step S202: Acquire second timeline data of the second video file, where the second timeline data includes a variety of element data describing the second video file.

[0066] Step S204: determining differentiated target element data according to the first timeline data and the second timeline data; wherein the differentiated target element data is used to constitute the modification information.

[0067] In one example, the metadata of the video file can be read by parsing the video file format. The metadata may include the duration, frame rate, and parameters of the audio track of the video track. The information on the timeline of each element data in the video, such as video clips, text, filters, audio, etc., can be extracted based on the metadata, such as the start time, duration, and properties of each element (such as filter type, volume, etc.). Based on the extracted element data, timeline data can be generated. The timeline data can be a data set containing multiple time periods and corresponding element data. The position and properties of each element in the video file can be obtained through the timeline data.

[0068] In one example, the timeline data can be exported through the export timeline data function of the video editing software. The timeline data export format can be XML, JSON, AAF, etc.

[0069] 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.

[0070] 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.

[0071] 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.

[0072] 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.

[0073] In this embodiment, by comparing the first timeline data and the second timeline data, the difference between the first timeline data and the second timeline data is accurately identified, the modified part is extracted, and the differentiated target element data is generated. By rendering the target element data and combining it with the initial rendering data, repeated rendering is reduced. Especially when the video content is large or needs to be modified frequently, the efficiency of video editing, generation and rendering can be greatly improved by processing the differentiated data, thereby improving the user experience.

[0074] In an optional embodiment, if Figure 3 As shown, step S106 includes: Step S300: determining a corresponding preset rendering rule based on the differentiated target element data.

[0075] Step S302: Render the differentiated target element data according to the preset rendering rule to obtain incremental rendering data.

[0076] 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.

[0077] 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.

[0078] 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.

[0079] 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.

[0080] 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.

[0081] In an optional embodiment, the multiple element data include: text data, visual effect data, audio data and / or video data.

[0082] 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.

[0083] 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.

[0084] 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.

[0085] 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.

[0086] 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.

[0087] 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.

[0088] Correspondingly, if Figure 4 As shown, step S204 includes: Step S400: If the second text data is changed in character position, character content and / or character style compared with the first text data, obtain the text data change of the second text data relative to the first text data.

[0089] Step S402: acquiring the differentiated target element data according to the change of the text data.

[0090] 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.

[0091] 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.

[0092] 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.

[0093] In an optional embodiment, if Figure 5 As shown, step S300 includes: Step S500: acquiring a changed character according to a text data change of the second text data relative to the first text data.

[0094] Step S502, performing rasterization processing on the changed character to obtain the incremental rendering data; wherein the incremental rendering data includes texture data of the changed character.

[0095] 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".

[0096] 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.

[0097] 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.

[0098] 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 6 As shown, step S204 includes: Step S600: If the audio file path and / or audio attribute of the second audio data is changed compared with the first audio data, obtain the audio data change of the second audio data relative to the first audio data.

[0099] Step S602: acquiring the differentiated target element data according to the change of the audio data.

[0100] 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.

[0101] 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.

[0102] 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.

[0103] In an optional embodiment, step S300 includes: An audio track is synthesized according to the second audio data to obtain incremental rendering data including the audio track.

[0104] 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.

[0105] 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.

[0106] 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.

[0107] 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 section 0:00-1:00 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 initial rendering data 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.

[0108] 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.

[0109] 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 7 As shown, step S204 includes: Step S700, 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.

[0110] Step S702: acquiring the differentiated target element data according to the change of the visual effect data.

[0111] 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.

[0112] 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.

[0113] 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.

[0114] 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.

[0115] In an optional embodiment, if Figure 8 As shown, step S300 includes: Step S800: Acquire multiple video frames of the second video file.

[0116] Step S802, obtaining a target video frame associated with the change of the visual effect data from among the multiple video frames.

[0117] Step S804: 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.

[0118] 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.

[0119] 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.

[0120] 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.

[0121] 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.

[0122] 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. 9 As shown, step S204 includes: Step S900: 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.

[0123] Step S902: acquiring the differentiated target element data according to the change of the video data.

[0124] 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.

[0125] 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.

[0126] 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.

[0127] 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.

[0128] In an optional embodiment, if Fig.10 As shown, step S300 includes: Step S1000, when the video data changes to increase the video length, obtain a newly added video segment.

[0129] Step S1002: Render the newly added video segment to obtain incremental rendering data including rendering data of the newly added video segment.

[0130] 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.

[0131] 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.

[0132] 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.

[0133] In order to make this application easier to understand, the following Fig.11 An exemplary application is provided.

[0134] S11, editing the first video file by video editing software to obtain a second video file.

[0135] S12: Obtain initial rendering data corresponding to the first video file.

[0136] S13, exporting the timeline data of the first video file and the second video file from the editing software. The timeline data includes information such as the start time, end time, and attributes of all elements such as video, audio, text, filters, and transitions.

[0137] S14, identifying 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 in the text content, position, style and other attributes compared to 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.

[0138] S15, 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 initial rendering data 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 initial rendering data is reused and merged with the rendering result of the newly added video segment.

[0139] S16, after acquiring the newly added rendering data corresponding to the modified part, merge the newly added rendering data with the initial rendering data corresponding to the unmodified part, encapsulate the audio and video files, and generate a final video file.

[0140] S17, outputting and saving the final video file to a specified location.

[0141] In this exemplary application, by reusing the initial rendering results, only the modified parts are rendered, thus avoiding the need for full rendering after video editing. In the editing scenarios of long videos or high-resolution videos, it can effectively reduce video rendering time, reduce computing and storage requirements, improve video editing efficiency and response speed, and thus improve user experience.

[0142] Embodiment 2 Fig.12The 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.12 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: An acquisition module 1610 is used to acquire initial rendering data of a first video file; The editing module 1620 is used to edit the first video file to obtain a second video file; correspondingly, the obtaining module 1610 is also used to obtain modification information of the second video file relative to the first video file; 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 initial rendering data and the incremental rendering data.

[0143] As an optional embodiment, the device 1600 is further used for: Acquire first timeline data of the first video file, where the first timeline data includes multiple element data describing the first video file; Acquire second timeline data of the second video file, where the second timeline data includes multiple element data describing the second video file; 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.

[0144] 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.

[0145] As an optional embodiment, the multiple element data include: text data, visual effect data, audio data and / or video data.

[0146] As 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; the device 1600 is further used for: If the second character data is changed in character position, character content and / or character style compared with the first character data, obtaining a character data change of the second character data relative to the first character data; According to the change of the text data, the differentiated target element data is obtained.

[0147] As an optional embodiment, the device 1600 is further used for: acquiring a changed character according to a change in the character data of the second character data relative to the first character data; Performing rasterization processing on the changed characters to obtain the incremental rendering data; Wherein, the incremental rendering data includes texture data of the changed characters.

[0148] As 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; the device 1600 is further used for: If the second audio data is changed in the audio file path and / or the audio attribute compared with the first audio data, obtaining the audio data change of the second audio data relative to the first audio data; According to the change of the audio data, the differentiated target element data is obtained.

[0149] As an optional embodiment, the device 1600 is further used for: According to the change of the audio data, the audio track is synthesized to obtain incremental rendering data including the audio track.

[0150] As 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; the device 1600 is further used to: If the second visual effect data is changed in filter effect start and end time, transition effect start and end time, filter effect parameter and / or transition effect parameter compared with the first visual effect data, obtaining a visual effect data change of the second visual effect data relative to the first visual effect data; According to the change of the visual effect data, the differentiated target element data is obtained.

[0151] As an optional embodiment, the device 1600 is further used for: Acquire multiple video frames of the second video file; Acquire a target video frame associated with the change of the visual effect data from the plurality of video frames; According to the change of the visual effect data, the target video frame is rendered to obtain the incremental rendering data including the rendering data of the target video frame.

[0152] As 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; the apparatus 1600 is further configured to: If the second video data has a different video duration than the first video data, obtaining a video data change of the second video data relative to the first video data; According to the change of the video data, the differentiated target element data is obtained.

[0153] As an optional embodiment, the device 1600 is further used for: When the video data changes to an increase in video duration, obtaining a newly added video segment; The newly added video segment is rendered to obtain incremental rendering data including rendering data of the newly added video segment.

[0154] Embodiment 3 Fig.13 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.13 As 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.

[0155] 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.

[0156] 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.

[0157] It should be pointed out that Fig.13 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.

[0158] 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.

[0159] 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.

[0160] 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.

[0161] 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.

[0162] 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.

[0163] 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: The method comprises: Obtaining initial rendering data of a first video file; Editing the first video file to obtain a second video file; Acquire modification information of the second video file relative to the first video file; generating incremental rendering data based on the modification information; The target rendering data of the second video file is synthesized according to the initial rendering data and the incremental rendering data.

2. The method according to claim 1, characterized in that Acquiring modification information of the second video file relative to the first video file, including: Acquire first timeline data of the first video file, where the first timeline data includes multiple element data describing the first video file; Acquire second timeline data of the second video file, where the second timeline data includes multiple element data describing the second video file; 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.

3. The method according to claim 2, 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.

4. The method according to claim 3, characterized in that The various element data include: text data, visual effect data, audio data and / or video data.

5. The method according to claim 4, characterized in that 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; and determining differentiated target element data according to the first timeline data and the second timeline data includes: If the second character data is changed in character position, character content and / or character style compared with the first character data, obtaining a character data change of the second character data relative to the first character data; According to the change of the text data, the differentiated target element data is obtained.

6. The method according to claim 5, characterized in that Based on the differentiated target element data, determining a corresponding preset rendering rule includes: acquiring a changed character according to a change in the character data of the second character data relative to the first character data; Performing rasterization processing on the changed characters to obtain the incremental rendering data; Wherein, the incremental rendering data includes texture data of the changed characters.

7. The method according to claim 4, characterized in that 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; and determining differentiated target element data according to the first timeline data and the second timeline data includes: If the second audio data is changed in the audio file path and / or the audio attribute compared with the first audio data, obtaining the audio data change of the second audio data relative to the first audio data; According to the change of the audio data, the differentiated target element data is obtained.

8. The method according to claim 7, characterized in that Based on the differentiated target element data, determining a corresponding preset rendering rule includes: According to the change of the audio data, the audio track is synthesized to obtain incremental rendering data including the audio track.

9. The method according to claim 4, characterized in that 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; Determining differentiated target element data according to the first timeline data and the second timeline data includes: If the second visual effect data is changed in filter effect start and end time, transition effect start and end time, filter effect parameter and / or transition effect parameter compared with the first visual effect data, obtaining a visual effect data change of the second visual effect data relative to the first visual effect data; According to the change of the visual effect data, the differentiated target element data is obtained.

10. The method according to claim 9, characterized in that Based on the differentiated target element data, determining a corresponding preset rendering rule includes: Acquire multiple video frames of the second video file; Acquire a target video frame associated with the change of the visual effect data from the plurality of video frames; According to the change of the visual effect data, the target video frame is rendered to obtain the incremental rendering data including the rendering data of the target video frame.

11. The method according to claim 4, characterized in that The video data includes video duration, the first timeline data includes first video data, and the second timeline data includes second video data; and according to the first timeline data and the second timeline data, determining differentiated target element data includes: If the second video data has a different video duration than the first video data, obtaining a video data change of the second video data relative to the first video data; According to the change of the video data, the differentiated target element data is obtained.

12. The method according to claim 11, characterized in that Based on the differentiated target element data, determining a corresponding preset rendering rule includes: When the video data changes to increase the video duration, obtaining a newly added video segment; The newly added video segment is rendered to obtain incremental rendering data including rendering data of the newly added video segment.

13. A video generating device, characterized in that: The device comprises: An acquisition module, used for acquiring initial rendering data of a first video file; An editing module, used for editing the first video file to obtain a second video file; correspondingly, the acquisition module is also used for acquiring modification information of the second video file relative to the first video file; A rendering module, used to generate incremental rendering data based on the modification information; A synthesis module is used to synthesize target rendering data of the second video file according to the initial rendering data and the incremental rendering data.

14. 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 12.

15. 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 12 is implemented.

16. 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 12 are implemented.