Video generation method and apparatus
By obtaining video element information and generating target videos, the problem of high development cost and limited diversity of video generation systems in the existing technology is solved, the efficiency of video generation is improved and the styles are enriched, and a convenient and efficient video creative generation solution is provided. .
Patent Information
- Application Number
- PCT/CN2024/082201
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-24
- Filing Date
- 2024-03-18
- Publication Date
- 2024-10-03
AI Technical Summary
In the existing technology, template-based video generation systems suffer from high development costs and limited video diversity, making it difficult to provide convenient and efficient video creative generation solutions, affecting advertisers' product promotion and marketing effects.
By obtaining the video generation request, the video element information is obtained, the target animation is generated based on the animation description file and animation template file, and the ordered image sequence is obtained through the screenshot operation, and finally the target video is generated, and the resource pool is used to manage browser resources to reduce resource consumption. Run multiple child processes in parallel for rendering and screenshots to speed up video generation.
It improves the efficiency of video generation, enriches video styles, reduces development costs, overcomes the problems of limited video diversity and high development costs in video generation systems, and provides a convenient and efficient video creative generation solution.
Smart Images

Figure CN2024082201_03102024_PF_FP_ABST
Abstract
Description
Video generation method and device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This patent application claims priority to the Chinese patent application filed on March 24, 2023, with application number 202310298310.5 and invention name “Video Generation Method and Device”, the full text of which is incorporated by reference into this application. Technical Field
[0003] The present disclosure relates to the field of computer technology, specifically to the field of video processing technology, and more particularly to a video generation method and device. Background Art
[0004] In the e-commerce sector, advertising creatives in various forms, such as copy, images, and videos, can effectively increase user engagement and enhance overall marketing effectiveness by visually presenting key information such as product features and selling points. Video creatives, in particular, integrate video, audio, images, and text, creating a more vivid and expressive experience. They are the most effective way to foster user awareness, preference, and purchase intention. Therefore, it is crucial to provide a convenient and efficient video creative generation solution to assist advertisers in product promotion and marketing.
[0005] Summary of the Invention
[0006] Embodiments of the present disclosure provide a video generation method, apparatus, device, and storage medium.
[0007] According to the first aspect, an embodiment of the present disclosure provides a video generation method, which includes: in response to obtaining a video generation request, obtaining video element information based on the video generation request; obtaining a target animation based on a new animation description file and the animation template file; performing a screenshot operation based on the target animation to obtain an ordered image sequence; and generating a target video based on the ordered image sequence.
[0008] According to the second aspect, an embodiment of the present disclosure provides a video generation device, which includes: an acquisition module, configured to obtain video element information based on the video generation request in response to obtaining the video generation request; a replacement module, configured to obtain the target animation based on the new animation description file and the animation template file; a screenshot module, configured to perform a screenshot operation based on the target animation to obtain an ordered picture sequence; and a generation module, configured to generate a target video based on the ordered picture sequence.
[0009] According to the third aspect, an embodiment of the present disclosure provides an electronic device, which includes one or more processors; a storage device on which one or more computer programs are stored, and when the one or more computer programs are executed by the one or more processors, the one or more processors implement a video generation method as in any embodiment of the first aspect.
[0010] According to a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable medium having computer instructions stored thereon, which, when executed by a computer, implements the video generation method of any embodiment of the first aspect.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] FIG1 is a diagram of an exemplary system architecture in which the present disclosure may be applied;
[0013] FIG2 is a flow chart of an embodiment of a video generation method according to the present disclosure;
[0014] FIG3 is a schematic diagram of an application scenario of the video generation method according to the present disclosure;
[0015] FIG4 is a flow chart of another embodiment of a video generation method according to the present disclosure;
[0016] FIG5 is a schematic diagram of an embodiment of a video generating apparatus according to the present disclosure;
[0017] FIG6 is a schematic diagram of one embodiment of a video generation system according to the present disclosure;
[0018] FIG7 is a schematic diagram of the structure of a computer system suitable for implementing a server according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0020] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0021] FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the video generation method of the present disclosure may be applied.
[0022] As shown in Figure 1, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 is a medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0023] The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications, such as video playback applications, communication applications, etc., may be installed on the terminal devices 101, 102, 103.
[0024] Terminal devices 101, 102, and 103 can be hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with display screens, including but not limited to mobile phones and laptop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, to provide video generation services), or as a single software or software module. No specific limitations are given here.
[0025] Server 105 can be a server that provides various services, for example, in response to obtaining a video generation request, obtaining video element information based on the video generation request; obtaining a target animation based on a new animation description file and the animation template file; performing a screenshot operation based on the target animation to obtain an ordered image sequence; and generating a target video based on the ordered image sequence.
[0026] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, for providing video generation services), or it can be implemented as a single software or software module. No specific limitations are given here.
[0027] It should be noted that the video generation method provided in the embodiments of the present disclosure can be executed by the server 105, or by the terminal devices 101, 102, 103, or by the server 105 and the terminal devices 101, 102, 103 in cooperation with each other. Accordingly, the various parts (e.g., various units, sub-units, modules, sub-modules) included in the video generation device can be all set in the server 105, or all set in the terminal devices 101, 102, 103, or can be set separately in the server 105 and the terminal devices 101, 102, 103.
[0028] It should be understood that the number of terminal devices, networks, and servers in Figure 1 is merely illustrative and any number of terminal devices, networks, and servers may be provided as required.
[0029] FIG2 shows a process 200 of an embodiment of a video generation method that can be applied to the present disclosure. In this embodiment, the video generation method includes the following steps:
[0030] Step 201: In response to receiving a video generation request, obtain video element information based on the video generation request.
[0031] In this embodiment, the execution entity (such as the server 105 or the terminal devices 101, 102, 103 shown in FIG1) can obtain the video generation request in a wired or wireless manner, and obtain the video element information based on the video generation request.
[0032] The video element information may include: animation template file, animation description file, and target material.
[0033] Here, the video generation request may directly include information such as the animation template file, animation description file, target material, etc., or it may only include information such as the animation template file storage path, animation description file storage path, target material storage path, etc. After the execution entity obtains the video generation request, it may obtain the animation template file, animation description file and target material according to the animation template file storage path, animation description file storage path and target material storage path respectively.
[0034] Animation template files are JSON files used to describe animations and are stored in the animation template database. Animations are created by animators using the animation software AE (Adobe After Effects) and, in conjunction with the Bodymovin plug-in, exported as JSON files for rendering and playback on web, Android, and iOS platforms. This JSON file, called an animation template file, includes basic animation information such as image collections, layer collections, view width and height, start and end keyframes, and frame rate.
[0035] Animation description files use scripts to extract animation information from animation template files, which is essential for backend video generation. Each animation template file has a corresponding animation description file. This file includes animation duration and animation asset information. Animation asset information is divided into two categories: image assets and text assets, distinguished by the type field. Image assets include the image URL, local file name, width, height, and layer subscript. Text assets include the content, minimum and maximum lengths, and layer subscript.
[0036] It should be noted that the video element information may also include information such as the width, height, frame rate, and duration of the target video.
[0037] The wireless connection methods may include but are not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0038] In some optional methods, based on the video generation request, video element information is obtained, including: obtaining the animation template file, animation description file and target material according to the animation template file storage path, animation description file storage path and target material storage path.
[0039] In this implementation, the video generation request may include the animation template file storage path, the animation description file storage path, and the target material storage path. The execution entity may obtain the animation template file, animation description file, and target material based on the animation template file storage path, the animation description file storage path, and the target material storage path.
[0040] This implementation method reduces the amount of data transmission, improves information transmission efficiency, and thus improves video generation efficiency by obtaining animation template files, animation description files, and target materials according to the storage path of the drawing template file, the storage path of the animation description file, and the storage path of the target material.
[0041] Step 202: Obtain target animation based on the new animation description file and the animation template file.
[0042] In this embodiment, the execution entity can replace the material in the animation description file according to the target material to obtain a new animation description file, read the contents of the animation template file and the new animation description file, and fill the read content into the HTML page of the Lottie code to obtain the target animation.
[0043] Step 203: Based on the target animation, a screenshot operation is performed to obtain an ordered image sequence.
[0044] In this embodiment, the execution subject may perform a screenshot operation on the target animation, that is, render, play and screenshot the target animation to obtain an ordered image sequence.
[0045] Specifically, the execution subject can first create a Chrome browser and open an HTML page in an interface-less manner through Puppeteer, jump to a specified frame through the Lottie animation library, and then use Puppeteer to take a screenshot of the specified frame and save it to a storage medium cluster.
[0046] In some optional embodiments, the method further includes: managing the browser using a resource pool, specifically including at least one of the following: initializing the browser before obtaining a video generation request; and recycling the used browser after the browser is used.
[0047] In this embodiment, since the screenshot operation includes creating a browser for taking screenshots, such as using Puppeteer to create a Chrome browser, if a browser needs to be created after each request arrives, a high creation process overhead will be generated. In order to reduce the process overhead generated by repeated browser creation and reduce resource consumption, the execution entity can use a resource pool to uniformly manage browser resources.
[0048] Specifically, the execution entity can initialize some browsers from the resource pool before the video generation request arrives, and can directly obtain the browser from the resource pool each time the video generation request arrives. After use, the resource pool is responsible for recycling the used browser resources.
[0049] This implementation method achieves unified management of browser resources by initializing the browser before obtaining a video generation request and recycling the used browser after the browser is used. This avoids the repeated operation of creating a browser for each request and effectively reduces resource consumption.
[0050] Step 204: Generate a target video based on the ordered image sequence.
[0051] In this embodiment, the execution entity can directly generate the target video by encoding the ordered image sequence through a video encoding tool, or it can generate the target video by encoding the ordered image sequence and video generation command through a video encoding tool. This disclosure does not limit this.
[0052] Among them, the video generation command can be included in the above-mentioned video generation request, and the video generation command can include at least one of the following: specifying the image sequence path, truncating or repeating the music according to the duration specified in the animation template, and superimposing barrage and special effects.
[0053] In some optional manners, generating a target video based on an ordered image sequence includes generating a target video based on an ordered image sequence and a video generation command.
[0054] In this implementation, the video element information also includes: a video generation command, which includes at least one of the following: specifying a picture sequence path, truncating or repeating the music according to the duration specified in the animation template, and superimposing barrage and special effects.
[0055] After obtaining the ordered image sequence, the execution subject can encode the ordered image sequence and the video generation command through the video encoding tool to generate the target video, and synchronize the video file and the video MD5 checksum file to the storage medium cluster.
[0056] This implementation method generates a target video based on an ordered image sequence and a video generation command, thereby effectively improving the effectiveness of the generated target video.
[0057] Continuing to refer to FIG3 , FIG3 is a schematic diagram of an application scenario of the video generation method according to this embodiment.
[0058] In the application scenario of Figure 3, the execution entity 301 can monitor the video generation request 302 in real time or periodically in a wired or wireless manner, and in response to obtaining the video generation request 302, obtain video element information based on the video generation request, wherein the video element information includes: animation template file 303, animation description file 304 and target material 305; based on the new animation description file 306 and the animation template file 303, obtain the target animation 307, wherein the new animation description file is obtained by replacing the material in the animation description file with the target material; based on the target animation 307, perform a screenshot operation 308 to obtain an ordered image sequence 309; based on the ordered image sequence 309, generate a target video 310.
[0059] The video generation method disclosed in the present invention obtains video element information based on the video generation request in response to a video generation request; obtains a target animation based on a new animation description file and an animation template file; performs a screenshot operation based on the target animation to obtain an ordered image sequence; and generates a target video based on the ordered image sequence. This method fully utilizes the extensibility and reusability of animation templates, enriches video styles, and reduces development costs, effectively overcoming the problems of limited video diversity and high development costs in template-based video generation systems in related technologies.
[0060] Further referring to Figure 4, it shows a process 400 of another embodiment of the video generation method shown in Figure 2. In this embodiment, the process 400 of the video generation method may include the following steps:
[0061] Step 401: In response to receiving a video generation request, obtain video element information based on the video generation request.
[0062] In this embodiment, the implementation details and technical effects of step 401 can be found in the description of step 201 and will not be repeated here.
[0063] Step 402: Obtain target animation based on the new animation description file and the animation template file.
[0064] In this embodiment, the implementation details and technical effects of step 402 can be found in the description of step 202 and will not be repeated here.
[0065] Step 403: Divide the target animation into a preset number of sub-segments.
[0066] In this embodiment, since rendering, playback, and screenshots are operations that consume a large amount of CPU and memory resources, for a single video generation request on a single machine, in order to utilize multi-core performance and improve CPU utilization, rendering, playback, and screenshots will be split into multiple different processes and performed simultaneously.
[0067] To this end, the execution entity may divide the target animation into a preset number of sub-segments, wherein the preset number may be set according to actual needs, for example, 5, 7, etc., and the present disclosure does not limit this.
[0068] Step 404 : Running a preset number of sub-processes in parallel to perform screenshot operations on a preset number of sub-segments to obtain a preset number of sub-picture sequences.
[0069] In this embodiment, the execution entity may run a preset number of sub-processes in parallel to perform screenshot operations on a preset number of sub-segments to obtain a preset number of sub-picture sequences.
[0070] Among them, the number of sub-processes running in parallel is the same as the number of sub-segments, for example, the preset number is 6. Each sub-process performs a screenshot operation on a sub-segment to obtain a sub-image sequence. The sub-segments corresponding to each sub-process are different, that is, each animation is screenshoted in parallel by multiple sub-processes, and each sub-process is responsible for capturing a part of the animation. The captured image ranges between sub-processes do not overlap.
[0071] Step 405: Generate an ordered picture sequence based on a preset number of sub-picture sequences.
[0072] In this embodiment, the execution entity may sort the sub-picture sequence according to the range of the interception operation executed by each sub-process and the position of the image frame to obtain an ordered picture sequence.
[0073] Specifically, the range of interception operations performed by each child process can be calculated using the following formula:
[0074] Set the number of child processes to n, the frame rate to fps (frames / s), the total duration of the animation to total_duration (s), and i to be the number of pictures before the sub-segment corresponding to the current child process in the animation. Then the index-th child process performs the interception operation on the corresponding segment, and the duration range of the subsequence is: (i+index*m index )*msTimeStep,0≤i <m index (1)
[0075] Among them, m index The number of pictures that need to be captured for the index-th child process:
[0076] msTimeStep is the millisecond step size: msTimeStep = 1000 / fps (3)
[0077] k is the total number of frames: k = fps * total_duration (4)
[0078] Step 406: Generate a target video based on the ordered image sequence.
[0079] In this embodiment, the implementation details and technical effects of step 406 can be found in the description of step 204 and will not be repeated here.
[0080] As can be seen from Figure 4, compared with the embodiment corresponding to Figure 2, the process 400 of the video generation method in this embodiment embodies dividing the target animation into a preset number of sub-segments, running a preset number of sub-processes in parallel to perform screenshot operations on the preset number of sub-segments, obtaining a preset number of sub-picture sequences, generating an ordered picture sequence based on the preset number of sub-picture sequences, and generating a target video based on the ordered picture sequence. This method speeds up the picture capture speed by creating multiple sub-processes for rendering, playback and screenshots in parallel, thereby effectively speeding up the video generation speed.
[0081] With further reference to FIG5 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a video generating device. This device embodiment corresponds to the method embodiment shown in FIG2 , and the device can be specifically applied to various electronic devices.
[0082] As shown in FIG5 , the video generating apparatus 500 of this embodiment includes an acquiring module 501 , a replacing module 502 , a screenshot module 503 and a generating module 504 .
[0083] The acquisition module 501 may be configured to acquire video element information based on the video generation request in response to the video generation request.
[0084] The replacement module 502 may be configured to obtain a target animation based on a new animation description file and the animation template file.
[0085] The screenshot module 503 may be configured to perform a screenshot operation based on the target animation to obtain an ordered sequence of images.
[0086] The generating module 504 may be configured to generate a target video based on the ordered picture sequence.
[0087] In some optional embodiments of this embodiment, the screenshot module is further configured to: divide the target animation into a preset number of sub-segments; run a preset number of sub-processes in parallel to perform screenshot operations on a preset number of sub-segments to obtain a preset number of sub-image sequences; and generate an ordered image sequence based on the preset number of sub-image sequences.
[0088] In some optional aspects of this embodiment, the acquisition module is further configured to: acquire the animation template file, the animation description file and the target material according to the animation template file storage path, the animation description file storage path and the target material storage path.
[0089] In some optional aspects of this embodiment, the generation module is further configured to generate a target video based on the ordered image sequence and the video generation command.
[0090] In some optional aspects of this embodiment, the video generation command includes at least one of the following: specifying a picture sequence path, truncating or repeating the music according to the duration specified in the animation template, and superimposing barrage and special effects.
[0091] In some optional embodiments of this embodiment, the screenshot operation includes creating a browser to take the screenshot.
[0092] In some optional embodiments of this embodiment, the device also includes a management module, which is configured to use a resource pool to manage the browser, specifically including at least one of the following: initializing the browser before obtaining a video generation request; and recycling the used browser after the browser is used.
[0093] With further reference to FIG6 , the present disclosure provides an embodiment of a video generation system.
[0094] In this embodiment, the system includes a request server 601 and a video generation sub-server 602.
[0095] The request server 601 may be a server that provides various services. For example, based on user input information, it generates multiple video generation requests and sends the multiple video generation requests to one or more video generation sub-servers in the video generation sub-server cluster.
[0096] The video generation sub-server 602 is configured to execute the video generation method described in any one of the above embodiments.
[0097] The process of generating multiple video generation requests based on user input information and sending the multiple video generation requests to one or more video generation sub-servers in the video generation sub-server cluster may specifically include the following four steps:
[0098] Step 6011: Preprocessing the video production request. The request server first receives the video generation information selected by the advertiser through the front-end display page, such as the item ID, template ID, and ad slot ID. It then parses the request and determines whether it is valid and whether it contains the necessary information, such as the item ID, template ID, and ad slot ID. If not, the request is considered invalid, a failure message is returned, and the video generation progress is set to invalid. If it is valid, the process proceeds to step 6012.
[0099] Step 6012, material acquisition. The relevant materials that video production relies on include text materials, picture materials, music materials, template materials, etc. If the advertiser uploads local materials on his own, go to step 6014. Otherwise, go to step 6013 by obtaining materials from local files or remote material databases. For example, text materials can be obtained by accessing the text information database, which stores the mined or processed article text information, including product descriptions, brand names, and other information. Picture materials can be obtained by accessing the article basic database, which stores the basic attribute information of the main picture information of the article, the article details page, the carousel picture, and other pictures, as well as image detection result information, such as face detection, text detection, etc., for use in video generation.
[0100] Step 6013, material screening. The material screening stage is mainly responsible for selecting a set of qualified material candidates from multiple images and multiple texts. After obtaining information such as the basic attributes of the image and the image detection results, the image is first filtered according to rules such as image face detection, text detection, and image similarity to obtain a set of qualified image candidates. Combined with the number of images supported by the animation template, multiple images are randomly selected from the candidate set. Texts are randomly screened. Based on the number of texts supported by the animation template, multiple texts are randomly selected from the text candidate set.
[0101] Step 6014: Material processing. The material processing stage usually processes the image material, scales the image file according to the width and height of the template, and generates an image file that meets the specifications.
[0102] Step 6015: Distributed video generation: Generate one or more video generation requests based on the processed material and animation template information, and send the multiple video generation requests to one or more video generation sub-servers in the video generation sub-server cluster in a round-robin manner.
[0103] By providing a video generation system including a request server and a video generation sub-server, while improving the diversity of generated videos, it effectively overcomes the problem in the template-based video generation system in related technologies that the video generation stage and material acquisition, screening, processing and other functions are tightly coupled, and can only be upgraded or optimized as a whole, which is not conducive to system maintenance.
[0104] In some optional manners, the request server is further configured to obtain the target video generated by the video generation sub-server and store the target video.
[0105] In this implementation, the requesting server can obtain the target video generated by the video generation sub-server, upload the target video to the remote file storage system, and store the basic information of the target video, such as URL, width, height, template ID, etc., to the video creative library.
[0106] Furthermore, during the target video generation process, the target video generation progress will be updated in real time over time and written into the progress database. After the target video storage is completed, the target video generation progress is 100%, and the video production request for the item has been processed.
[0107] It should be understood that the number of request servers 601 and video generation sub-servers 602 in Figure 6 is merely illustrative and any number of request servers and video generation sub-servers may be provided as required.
[0108] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0109] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0110] FIG7 is a block diagram of an electronic device according to a video generating method according to an embodiment of the present disclosure.
[0111] 700 is a block diagram of an electronic device for a video generation method according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided for example only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0112] As shown in Figure 7, the electronic device includes: one or more processors 701, a memory 702, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). In Figure 7, a processor 701 is taken as an example.
[0113] Memory 702 is a non-transitory computer-readable storage medium provided in the present disclosure. The memory stores instructions executable by at least one processor, causing the at least one processor to perform the video generation method provided in the present disclosure. The non-transitory computer-readable storage medium of the present disclosure stores computer instructions for causing a computer to perform the video generation method provided in the present disclosure.
[0114] The memory 702, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as the program instructions / modules corresponding to the video generation method in the embodiments of the present disclosure (e.g., the acquisition module 501, the replacement module 502, the screenshot module 503, and the generation module 504 shown in FIG. 5 ). The processor 701 executes the non-transitory software programs, instructions, and modules stored in the memory 702 to execute various functional applications and data processing of the server, thereby implementing the video generation method in the above-mentioned method embodiment.
[0115] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created by the use of the video-generating electronic device, etc. In addition, the memory 702 may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 702 may optionally include a memory remotely located relative to the processor 701, and these remote memories may be connected to the video-generating electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0116] The electronic device of the video generation method may further include an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected via a bus or other means, and FIG7 shows a bus connection as an example.
[0117] The input device 703 can receive input digital or character information, such as an input device such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, a pointer, one or more mouse buttons, a trackball, a joystick, etc. The output device 704 can include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The display device can include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device can be a touch screen.
[0118] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0119] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., a magnetic disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0120] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0121] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0122] Computer systems may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The client and server relationship arises through computer programs running on the respective computers and having a client-server relationship to each other.
[0123] According to the technical solution of the embodiment of the present disclosure, the generated video styles are effectively enriched and the development costs are reduced.
[0124] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0125] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A video generation method, the method comprising: In response to obtaining a video generation request, obtaining video element information based on the video generation request, the video element information including: an animation template file, an animation description file, and a target material; Based on a new animation description file and the animation template file, a target animation is obtained, wherein the new animation description file is obtained by replacing a material in the animation description file with the target material; Based on the target animation, a screenshot operation is performed to obtain an ordered sequence of pictures; Based on the ordered picture sequence, a target video is generated.
2. The method according to claim 1, wherein: The step of performing a screenshot operation based on the target animation to obtain an ordered sequence of pictures includes: Dividing the target animation into a preset number of sub-segments; Running a preset number of sub-processes in parallel to perform a screenshot operation on the preset number of sub-segments to obtain a preset number of sub-image sequences, wherein each sub-process performs a screenshot operation on a sub-segment to obtain a sub-image sequence, and the sub-segments corresponding to the sub-processes are different; Based on the preset number of sub-picture sequences, an ordered picture sequence is generated.
3. The method according to claim 1, wherein: The video generation request includes: an animation template file storage path, an animation description file storage path and a target material storage path, and the acquisition of video element information based on the video generation request includes: According to the animation template file storage path, the animation description file storage path and the target material storage path, the animation template file, the animation description file and the target material are acquired.
4. The method according to claim 1, wherein: The video element information also includes: a video generation command, and the generating of a target video based on the ordered picture sequence includes: A target video is generated based on the ordered image sequence and a video generation command, wherein the video generation command includes at least one of the following: specifying an image sequence path, truncating or repeating music according to a duration defined in an animation template, and superimposing barrage and special effects.
5. The method according to any one of claims 1 to 4, wherein: The screenshot operation includes creating a browser to take a screenshot, and the method further includes: The browser is managed by using a resource pool, specifically including at least one of the following: initializing the browser before obtaining a video generation request; and recycling the used browser after the browser is used.
6. A video generation device, the device comprising: An acquisition module is configured to acquire video element information in response to acquiring a video generation request and based on the video generation request, wherein the video element information includes: an animation template file, an animation description file, and a target material; A replacement module is configured to obtain a target animation based on a new animation description file and the animation template file, wherein the new animation description file is obtained by replacing a material in the animation description file with the target material; A screenshot module is configured to perform a screenshot operation based on the target animation to obtain an ordered sequence of pictures; The generating module is configured to generate a target video based on the ordered picture sequence.
7. The device according to claim 6, wherein: The screenshot module is further configured to: Dividing the target animation into a preset number of sub-segments; Running a preset number of sub-processes in parallel to perform a screenshot operation on the preset number of sub-segments to obtain a preset number of sub-image sequences, wherein each sub-process performs a screenshot operation on a sub-segment to obtain a sub-image sequence, and the sub-segments corresponding to the sub-processes are different; Based on the preset number of sub-picture sequences, an ordered picture sequence is generated.
8. The device according to claim 6, wherein: The acquisition module is further configured to: According to the animation template file storage path, the animation description file storage path and the target material storage path, the animation template file, the animation description file and the target material are acquired.
9. The device according to claim 6, wherein: The generation module is further configured to: A target video is generated based on the ordered image sequence and a video generation command, wherein the video generation command includes at least one of the following: specifying an image sequence path, truncating or repeating music according to a duration defined in an animation template, and superimposing barrage and special effects.
10. The device according to any one of claims 6 to 9, wherein: The screenshot operation includes creating a browser for taking screenshots, and the device also includes a management module, which is configured to use a resource pool to manage the browser, specifically including at least one of the following: initializing the browser before obtaining a video generation request; and recycling the used browser after the browser is used.
11. A video generation system, the system comprising: request server and video generation sub-server, The request server is used to generate multiple video generation requests based on user input information, and send the multiple video generation requests to one or more video generation sub-servers in the video generation sub-server cluster; The video generation sub-server is used to execute the method according to any one of claims 1-5.
12. The system according to claim 11, wherein: The request server is further configured to: The target video generated by the video generation sub-server is obtained, and the target video is stored.
13. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs, and when the one or more computer programs are executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 5.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Video generation method and device, electronic equipment and storage medium
CN109769141A
Video generation method and device, electronic equipment and readable storage medium
CN110708596A
Video generation method and device, electronic equipment and storage medium
CN112637675A
Video generation method and device
CN116248919A
Animation rendering method based on JSON data format
WO2022033131A1
Cited By
Video generation method and device, electronic equipment and storage medium
CN119484956A
Transaction backtracking method and device based on video stream and storage medium
CN119831741A
Sublimation AI processor-based digital human video generation method and related equipment
CN119967254A
