Special effect video generation method and device
By obtaining non-repetitive material-special effects combinations and creating special effects processing tasks, the problem of inefficient special effects processing in the existing technology is solved, efficient special effects processing and video generation are achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510015304.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-25
AI Technical Summary
The existing UGC template application technology is inefficient when dealing with the special effects of multi-pit material, resulting in excessive time consumption and waste of resources, affecting the user experience.
By determining multiple initial materials and their corresponding special effects combinations, obtaining non-repetitive material-special effects combinations, and creating special effects processing tasks, applying the special effects combinations to the initial materials to generate special effects materials, and ultimately used to generate the target special effects video.
It avoids repeated execution of the same special effect processing tasks, improves the work efficiency of special effect processing, saves computing resources and video production time, and improves user experience.
Smart Images

Figure CN119893232A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for generating special effects videos. Background Art
[0002] With the rapid development of digital media and social networks, user-generated content (UGC) has become an important part of Internet culture. In UGC production, template application is a popular way of content creation, which allows users to quickly generate personalized videos or images by replacing specific materials (i.e. "pits") in the template.
[0003] However, the existing UGC template application technology is inefficient when processing multi-pit material special effects, and is prone to problems such as excessive time consumption and waste of resources, affecting 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 special effects video generation method, apparatus, computer equipment, 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 special effect video generation method for a user terminal, the method comprising: Determine a plurality of initial materials, each of the initial materials corresponding to a special effect combination; Acquire multiple non-repetitive material-special effect combinations according to the multiple initial materials and the corresponding multiple special effect combinations; According to the plurality of material-special effect combinations, a corresponding number of special effect processing tasks are created; the special effect processing tasks are used to: apply the special effect combination in the corresponding material-special effect combination to the corresponding initial material to obtain the special effect material; and The special effect materials obtained by each of the multiple special effect processing tasks are obtained to generate a target special effect video.
[0007] Optionally, multiple non-repetitive material-effect combinations are obtained, including: Determining material identifiers corresponding to each of the plurality of initial materials; According to the multiple material identifiers, acquiring at least two of the initial materials having the same material identifier; When the special effect combinations corresponding to at least two of the initial materials are the same, deduplication of the at least two initial materials; According to the multiple initial materials and corresponding special effect combinations after deduplication, multiple non-repetitive material-special effect combinations are obtained.
[0008] Optionally, obtaining the special effect materials obtained by each of the plurality of special effect processing tasks includes: Determine whether a target special effect material obtained by a target special effect processing task is stored in a local cache, where the target special effect task is any one of the multiple special effect processing tasks; In a case where the target special effect material is stored in the local cache, the target special effect material is acquired from the local cache.
[0009] Optionally, obtaining the special effect materials obtained by each of the plurality of special effect processing tasks includes: The multiple special effect processing tasks are sent to the server so that the server returns the special effect materials obtained by each special effect processing task.
[0010] Optionally, sending the multiple special effect processing tasks to a server so that the server returns the special effect materials obtained by each special effect processing task, includes: Determining a plurality of target special effect processing tasks from the plurality of special effect processing tasks; wherein the plurality of target special effect processing tasks all correspond to the same initial material, and the special effect combination in each of the target special effect processing tasks includes one special effect; Generating a special effect processing request according to the plurality of target special effect processing tasks; The special effect processing request is sent to the server so that the server returns the special effect materials obtained by each of the target special effect processing tasks.
[0011] Another aspect of an embodiment of the present application provides a special effect video generation method for a server, the method comprising: Receive multiple non-repetitive special effect processing tasks sent by the target user end; wherein each of the special effect processing tasks corresponds to a material-special effect combination, and each of the material-special effect combination includes an initial material and a special effect combination; Executing a plurality of the special effect processing tasks, applying the special effect combinations in each of the material-special effect combinations to the corresponding initial materials to obtain a plurality of different special effect materials; The multiple different special effect materials are returned to the target user terminal so that the target user terminal generates a target special effect video according to the multiple different special effect materials.
[0012] Optionally, executing a plurality of special effect processing tasks includes: confirming whether a target special effect material obtained by a target special effect processing task is stored in the cache, wherein the target special effect processing task is any one of the multiple special effect processing tasks; When the target special effect material is not stored in the cache, executing the target special effect processing task; Wherein, in the case where the target special effect material is stored in the cache, the target special effect material stored in the cache is returned to the target user terminal.
[0013] Another aspect of an embodiment of the present application provides a special effect video generation device for a user terminal, the device comprising: A determination module, used to determine a plurality of initial materials, wherein one initial material corresponds to one special effect combination; A first acquisition module, configured to acquire a plurality of non-repetitive material-special effect combinations according to a plurality of the initial materials and a corresponding plurality of special effects; A creation module, used to create a corresponding number of multiple special effect processing tasks according to the multiple material-special effect combinations; the special effect processing tasks are used to: apply the special effect combination in the corresponding material-special effect combination to the corresponding initial material to obtain the special effect material; and The second acquisition module is used to acquire the special effect materials obtained by each of the multiple special effect processing tasks to generate a target special effect video.
[0014] Another aspect of an embodiment of the present application provides a special effect video generation device for a server, the device comprising: A receiving module, used for receiving a plurality of non-repetitive special effect processing tasks sent by a target user terminal; wherein each of the special effect processing tasks corresponds to a material-special effect combination, and each of the material-special effect combination includes an initial material and a special effect combination; An execution module, used for executing a plurality of the special effect processing tasks, applying the special effect combination in each of the material-special effect combinations to the corresponding initial material to obtain a plurality of different special effect materials; The return module is used to return the multiple different special effect materials to the target user terminal, so that the target user terminal generates a target special effect video according to the multiple different special effect materials.
[0015] 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.
[0016] 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.
[0017] 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.
[0018] The embodiment of the present application adopts the above technical solution to have the following advantages: removing repeated material-special effect combinations, and creating a corresponding number of special effect processing tasks based on the removed repeated material-special effect combinations. Thus, it is possible to avoid repeatedly executing the same special effect processing tasks, improve the efficiency of special effect processing, and save computing resources and video production time. BRIEF DESCRIPTION OF THE DRAWINGS 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.
[0019] Figure 1 The operating environment diagram of the special effect video generation method according to the first embodiment of the present application is schematically shown; Figure 2 The flowchart of the special effects video generation method according to the first embodiment of the present application is schematically shown; Figure 3 Schematically shows Figure 2 Flow chart of sub-steps of step S202; Figure 4 Schematically shows Figure 2 Flow chart of sub-steps of step S206; Figure 5 Schematically shows Figure 2 Another sub-step flow chart of step S206; Figure 6 The flowchart of the special effects video generation method according to the second embodiment of the present application is schematically shown; Figure 7 Schematically shows Figure 6 Flow chart of sub-steps of step S602; Figure 8 A diagram schematically shows an application example of the special effect video generation method according to an embodiment of the present application; Fig. 9 A block diagram of a special effects video generating device according to Embodiment 3 of the present application is schematically shown; Fig.10A block diagram schematically shows a special effects video generating device according to Embodiment 4 of the present application; and Fig.11 The hardware architecture diagram of the computer device according to the fifth embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0020] 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.
[0021] 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.
[0022] 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.
[0023] First, the following terms are explained: UGC: User Generated Content refers to content created by users, which can include text, images, videos, comments, etc.
[0024] Special effects video template: refers to a pre-designed video framework that contains specific visual effects, animations, transitions, sound effects and other elements. Users can apply these templates to video production according to their needs to quickly generate video content with professional visual effects.
[0025] Position: A preset position in a video template for inserting other custom elements. These positions can be static images or dynamic elements in the video.
[0026] Special effects: refers to the techniques used in film, television, video games, animation and other visual media to create visual effects that are difficult or impossible to achieve in reality.
[0027] Filter: An image processing technique used to change the visual effects of an image, enhance the beauty of the image, or express a specific artistic effect.
[0028] AI comic style: refers to comic-style images generated using artificial intelligence technology, imitating the visual effects in traditional comics.
[0029] Smart Cutout: It is an image processing function based on artificial intelligence technology that can automatically identify and separate the main object and background in a picture or video.
[0030] Hash algorithm: An algorithm that converts an input of arbitrary length (usually called a "message") into an output of fixed length (usually called a "hash value" or "hash code") through a hash function.
[0031] MD5: Message-Digest Algorithm 5, the fifth version of the message digest algorithm, is a cryptographic hash function that can generate a 128-bit (16-byte) hash value.
[0032] SHA-256: Secure Hash Algorithm 256 bit, is a cryptographic hash function that can generate a 256-bit (32-byte) hash value.
[0033] Concurrency: refers to the concept of multiple computing tasks (such as programs, threads, or processes) being processed simultaneously in the same time period.
[0034] Asynchronous: A method of concurrent execution that allows a program to continue executing other tasks while waiting for an operation (such as I / O operation, network request, etc.) to complete.
[0035] Caching: is a technique for temporarily storing data that can reduce data retrieval time, improve system performance, and reduce the load on the original data source.
[0036] Asyncio: It is a standard library of Python for writing single-threaded concurrent code using async / await syntax. It provides an event loop to handle asynchronous operations, allowing multiple tasks to be executed in a single thread without the need for multithreading or multiprocessing.
[0037] Promise.all: is a method in JavaScript that is used to handle multiple Promise objects, especially when there are multiple asynchronous operations and you want to continue to perform certain operations only when all these asynchronous operations are successfully completed.
[0038] 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: When making a user-generated content (UGC) template, the template maker will select some specific materials, which play replaceable roles in the template, called "pits". Each pit not only represents a position to be replaced, but also contains the special effect information preset by the designer for the material used in the pit.
[0039] After the user selects a template and replaces the material in it, a new video can be generated. In this process, if the replaced material comes with some special effects, these special effects will be automatically applied to the user's own material.
[0040] However, during the application of the template, if there are multiple slots in a template that use the same material and have special effects applied to each slot, a separate request will be made to the server for each slot to process the special effects. This practice not only leads to repeated processing of resources, but also significantly increases processing time, ultimately affecting the user experience.
[0041] To this end, the embodiment of the present application provides a special effects video generation technology solution. In this technical solution, the following effects can be achieved: (1) uniquely identify the material, and based on the material and its associated special effects requirements, group the repeated materials by special effects combination, thereby improving processing efficiency and reducing the number of special effects processing requests; (2) design special effects compatibility evaluation rules, merge low-dependency and high-compatibility special effects into one processing request, and use the server interface's ability to batch process special effects to simultaneously process multiple special effects combinations of the same material, thereby reducing the number of transmissions and computing overhead and improving computing efficiency; (3) use the user-side asynchronous task scheduling mechanism to simultaneously initiate multiple material special effects processing requests, and use the server's parallel processor (4) Use the server's cache system and the client's local cache to detect whether the generated special effect materials are reusable, avoid repeated requests and calculations, optimize resource utilization, and reduce processing burden; (5) Through deduplication, grouping, special effect merging, concurrent asynchronous processing and cache reuse technology for special effect processing and video generation, the overall acceleration and resource optimization of UGC template video generation can be achieved; (6) It is suitable for efficient processing of multiple slots and multiple special effects scenes, including short video production, special effect template application, and other scenes that require batch material processing, with high applicability and scalability. See below for details.
[0042] Finally, for ease of understanding, an exemplary operating environment is provided below.
[0043] like Figure 1As shown, the operating environment diagram includes: server 2, network 4, and client 6, wherein: Server 2 may be comprised of a single or multiple computing devices. The multiple computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, and the like. A computing device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., operating system, dedicated application, server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices. A hypervisor may be implemented to manage the use of different virtual machines on the same computing device.
[0044] The server 2 may be configured to communicate with a client 6 or the like via a network 4. The network 4 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 4 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, or wireless links, such as cellular links, satellite links, Wi-Fi links, and the like.
[0045] Server 2 can provide storage, reading, writing, querying, deleting and other services, such as providing material storage, special effects processing, video generation and other services for the client.
[0046] The user terminal 6 may be an electronic device running an operating system such as Windows, Android™ or iOS, such as a smart phone, a tablet device, a laptop computer, a virtual reality device, a gaming device, a set-top box, a vehicle terminal, or a smart TV. Based on the above operating system, various application programs may be run, such as a special effects processing program, a video editing program, etc.
[0047] The client 6 can provide / configure a user access page for manipulating the server 2 or uploading an object, etc.
[0048] It should be noted that the above devices are exemplary, and the number and type of devices are adjustable in different scenarios or according to different needs.
[0049] The following describes the technical solution of the present application through multiple embodiments, taking the user terminal 6 or the server 2 as the execution subject. It should be noted that these embodiments can be implemented in a variety of different forms and should not be interpreted as being limited to the embodiments described here.
[0050] Embodiment 1 This method embodiment may be executed in the user terminal 6 .
[0051] Figure 2The flowchart of the special effects video generation method according to the first embodiment of the present application is schematically shown.
[0052] like Figure 2 As shown, the special effect video generation method may include steps S200 to S206, wherein: Step S200, determining a plurality of initial materials, wherein one initial material corresponds to one special effect combination.
[0053] Step S202, obtaining a plurality of non-repetitive material-special effect combinations according to the plurality of initial materials and the corresponding plurality of special effect combinations.
[0054] Step S204, creating a corresponding number of multiple special effect processing tasks according to the multiple material-special effect combinations; the special effect processing tasks are used to: apply the special effect combination in the corresponding material-special effect combination to the corresponding initial material to obtain the special effect material.
[0055] Step S206, obtaining the special effect materials obtained by each of the multiple special effect processing tasks to generate a target special effect video.
[0056] The special effects video generation method provided in this embodiment can avoid repeated execution of the same special effects processing task, improve the work efficiency of special effects processing, and save computing resources and video production time. It can be imagined that the special effects video generation method of this embodiment can be applied to the efficient processing of multiple slots and multiple special effects scenes, including short video production, special effects template application, and other scenes that require batch material processing, and has high applicability and scalability.
[0057] The following combination Figure 2 , each step in steps S200~S206 and other optional steps are described in detail.
[0058] Step S200 , determine multiple initial materials, each of the initial materials corresponds to a special effect combination.
[0059] The initial material can be a static picture, a dynamic picture or a video clip, etc., and the special effects combination can be a combination of one or more special effects such as applying an AI comic-style filter to the material, performing intelligent matting processing on the material, or applying a 3D effect to the material.
[0060] Step S202 , based on the multiple initial materials and the corresponding multiple special effect combinations, multiple non-repetitive material-special effect combinations are obtained.
[0061] In this embodiment, deduplication processing is performed on multiple identical materials with the same special effect combination to avoid repeated special effect processing on the same material-special effect combination, thereby optimizing the special effect processing flow and improving the efficiency of special effect processing and video generation.
[0062] For example: Pit 1: Material A1, special effect B1+special effect B2; corresponding to material-special effect combination X1.
[0063] Pit 2: Material A1, special effect B1; corresponding to material-special effect combination X2.
[0064] Pit 3: Material A3, special effects B1+special effects B4; corresponding to material-special effects combination X3.
[0065] Pit 4: Material A1, special effect B1+special effect B2; corresponding to material-special effect combination X1.
[0066] Pit 5: Material A1, special effect B1+special effect B6; corresponding to material-special effect combination X4.
[0067] Pit 1 and Pit 4 have the same material-effect combination, so the two groups can be merged and only one of them can be retained.
[0068] In an optional embodiment, if Figure 3 As shown, step S202 may include: S300: Determine material identifiers corresponding to each of the plurality of initial materials.
[0069] S302: Acquire at least two of the initial materials having the same material identifier according to the multiple material identifiers.
[0070] S304: When the special effect combinations corresponding to at least two of the initial materials are the same, deduplicate the at least two initial materials.
[0071] S306, acquiring a plurality of non-repetitive material-special effect combinations according to the plurality of initial materials and corresponding special effect combinations after deduplication.
[0072] The material identification can be obtained by calculating the initial material through a hash algorithm (such as MD5 or SHA-256) etc. According to actual needs, other unique identifications of the initial material can also be obtained or customized in other ways as the material identification.
[0073] In this embodiment, the material identifier is used to determine whether the initial materials are the same, so that repeated material-special effect combinations can be accurately removed, while the automation level of special effect processing is improved, and the work efficiency of special effect processing is improved.
[0074] Step S204 , according to the multiple material-special effect combinations, create a corresponding number of multiple special effect processing tasks; the special effect processing tasks are used to: apply the special effect combination in the corresponding material-special effect combination to the corresponding initial material to obtain the special effect material.
[0075] In this embodiment, a corresponding task is created for each material-special effect combination to perform special effect processing, which can ensure that each task can be executed independently and efficiently, thereby optimizing the overall processing flow and improving the efficiency of special effect processing and video generation.
[0076] Taking the material-special effect combination X1, X2, X3, X4 as an example, special effect processing tasks Y1, Y2, Y3, Y4 are created one by one.
[0077] Special effect processing tasks Y1, Y2, Y3, and Y4 can be executed in parallel or in sequence according to priorities.
[0078] Step S206 , obtain the special effect materials obtained by each of the multiple special effect processing tasks to generate a target special effect video.
[0079] The acquired special effects material can be applied to the pre-acquired template to generate a target special effects video.
[0080] For example: special effect processing tasks Y1, Y2, Y3, Y4, one-to-one correspondence to obtain special effect materials Z1, Z2, Z3, Z4.
[0081] At this time, special effects material Z1 can be applied to pits 1 and 4, special effects material Z2 can be applied to pit 2, special effects material Z3 can be applied to pit 3, and special effects material Z4 can be applied to pit 5, thereby generating a target special effects video with these special effects materials.
[0082] In some embodiments, multiple special effect processing tasks can be processed in parallel to maximize the use of the concurrent capabilities of the user end, shorten the processing time, and further improve the processing efficiency. Parallel processing may also be avoided according to actual conditions.
[0083] In this embodiment, special effects videos are produced based on special effects materials obtained from multiple special effects processing tasks, which can improve the personalization level of video production, while achieving more efficient video content creation and enhancing the user experience.
[0084] It should be noted that the special effect processing task can be used to process and obtain special effect materials on the local side, and can also be used to instruct the server to process and generate special effect materials. Two exemplary methods of obtaining special effect materials are provided below.
[0085] Method 1 The user end performs local operations according to the special effect processing task, and processes and generates at least part of the special effect materials locally.
[0086] Method 2: The user end may have some special effect materials cached, which can be reused directly. Figure 4 As shown, step S206 includes: S400, determining whether a target special effect material obtained by a target special effect processing task is stored in a local cache, wherein the target special effect task is any one of the multiple special effect processing tasks.
[0087] S402: When the target special effect material is stored in the local cache, obtain the target special effect material from the local cache.
[0088] During specific implementation, an expiration time and validity verification mechanism can be set for the local cache to ensure the real-time and accuracy of the special effects processing results, thereby ensuring efficient processing while avoiding expired data from affecting output quality.
[0089] In this embodiment, local caching logic of special effect materials is implemented on the user side to detect whether the generated special effect materials are reusable, thereby avoiding repeated processing of the same special effect materials, thereby optimizing the resource utilization of the user side.
[0090] In method three, the user terminal can obtain at least part of the material with the help of the server's capabilities, and step S206 includes: The multiple special effect processing tasks are sent to the server so that the server returns the special effect materials obtained by each special effect processing task.
[0091] In some embodiments, the asynchronous task scheduling mechanism (such as asyncio or Promise.all) of the user side can be used to simultaneously initiate multiple material special effect processing requests to send the special effect processing tasks to the server. The server can also use multi-threading, multi-process or GPU-based parallel processing to assign different material special effect processing tasks to independent computing units.
[0092] In this embodiment, using a server to process special effect processing tasks to obtain special effect materials can improve special effect processing efficiency, further reduce the total processing time, and thus improve user experience.
[0093] In an optional embodiment, when the user terminal obtains at least part of the material with the help of the server, in order to reduce the number of transmissions and computing overhead of the user terminal, such as Figure 5 As shown, the "sending the multiple special effect processing tasks to the server" in the third method includes: S500, determining a plurality of target special effect processing tasks from the plurality of special effect processing tasks; in the plurality of target special effect processing tasks, all correspond to the same initial material, and the special effect combination in each of the target special effect processing tasks includes one special effect.
[0094] S502: Generate a special effect processing request according to the plurality of target special effect processing tasks.
[0095] S504: Send the special effect processing request to the server, so that the server returns the special effect materials obtained by each of the target special effect processing tasks.
[0096] When executing some special effects processing tasks, you may need to superimpose two or more special effects on the material. There is a kind of front-to-back dependency between these special effects: that is, the subsequent special effects need to be applied on the basis of the previous special effects that have been applied to the material. These special effects processing tasks with dependencies cannot be processed in parallel with other tasks.
[0097] In view of this, in this embodiment, the special effect processing tasks that only need to apply one special effect to the same initial material are packaged into the same special effect processing request, which can reduce the number of transmissions and computing overhead of the user end. On this basis, after receiving the special effect processing request, the server can also parse the request into multiple independent tasks, and use the batch processing capability of the interface to simultaneously process multiple special effect combinations of the same material. In this way, the number of independent special effect processing tasks can be reduced, and the computing efficiency of the server end can be improved.
[0098] It should be noted that in some embodiments, special effect processing tasks with a front-end dependency relationship can be split up, thereby separating the subtask of applying the first special effect to the initial material. This subtask can be combined with other special effect processing tasks without a front-end dependency relationship into the same special effect processing request.
[0099] Embodiment 2 This method embodiment may be executed in the server 2 . Figure 6 The flowchart of the special effects video generation method according to the second embodiment of the present application is schematically shown. Figure 6 As shown, the special effect video generation method may include steps S600 to S604, wherein: S600, receiving a plurality of non-repetitive special effect processing tasks sent by a target user terminal; wherein each of the special effect processing tasks corresponds to a material-special effect combination, and each of the material-special effect combination includes an initial material and a special effect combination.
[0100] S602, executing a plurality of the special effect processing tasks, applying the special effect combinations in each of the material-special effect combinations to the corresponding initial materials to obtain a plurality of different special effect materials.
[0101] S604: Return the plurality of different special effect materials to the target user terminal, so that the target user terminal generates a target special effect video according to the plurality of different special effect materials.
[0102] In this embodiment, non-repetitive special effect processing tasks are executed to obtain special effect materials, which can improve the work efficiency of special effect processing and save computing resources and video production time.
[0103] In an optional embodiment, if Figure 7 As shown, step S602 includes: S700, confirming whether a target special effect material obtained by a target special effect processing task is stored in the cache, wherein the target special effect processing task is any one of the multiple special effect processing tasks; S702, when the target special effect material is not stored in the cache, execute the target special effect processing task; wherein, when the target special effect material is stored in the cache, return the target special effect material stored in the cache to the target user terminal.
[0104] During specific implementation, an expiration time and validity verification mechanism can be set for the cache to ensure the real-time and accuracy of the special effect processing results, thereby ensuring efficient processing while avoiding expired data from affecting output quality.
[0105] In some embodiments, when the server generates target special effect materials that are not stored in the cache, the server may also store the generated target special effect materials in the cache for next use.
[0106] The server introduces a cache system (such as Redis or Memcached) to store the processing results of a specific "material-effect combination" and directly returns the data in the cache for repeated requests. This can avoid repeated calculations and reduce the processing burden on the server.
[0107] In order to make this application easier to understand, the following Figure 8 An exemplary application is provided. S11, the user terminal 6 selects a UGC template M for video production, and sends five pictures 1, 2, 3, 4, 5 (i.e., initial materials) applied to the pits x1, x2, x3, x4, and x5 respectively to the server 2.
[0108] S12, server 2 calculates using the MD5 algorithm and returns the hash values (i.e., material identifiers) of the five images.
[0109] S13, the user terminal 6 obtains the hash values of the five pictures, all of which are hash1, and determines that the five pictures are the same pictures.
[0110] S14, the user terminal 6 combines the special effects processing on pictures 1 and 3 into special effects processing task A according to the special effects corresponding to pictures 1 and 3 being "AI comic style"; combines the special effects processing on pictures 2 and 4 into special effects processing task B according to the special effects corresponding to pictures 2 and 4 being "intelligent matting"; and combines the special effects processing on picture 5 into special effects processing task C according to the special effects corresponding to picture 5 being "3D effect".
[0111] S15, the user terminal 6 queries the local cache and obtains the special effect material c obtained by the special effect processing task C stored in the local cache.
[0112] S16, the user terminal 6 packages the special effect processing task A and the special effect processing task B into a special effect processing request O, and sends it to the server 2.
[0113] S17, server 2 parses special effect processing request O and obtains special effect processing task A and special effect processing task B.
[0114] S18, the server 2 queries the cache and finds that the cache does not store the special effect material a and the special effect material b obtained by the special effect processing task A and the special effect processing task B respectively.
[0115] S19, server 2 executes special effect processing task A and special effect processing task B in parallel, obtains special effect material a and special effect material b, and stores special effect material a and special effect material b in the cache.
[0116] S20, the server 2 returns the packaged special effect material a and special effect material b, as well as their respective file paths, to the user terminal 6.
[0117] S21, the user terminal 6 parses the packaged file, and obtains the special effect material a and the special effect material b according to the file paths of the received special effect material a and the special effect material b.
[0118] S22, the user terminal 6 fills the special effect material a into the pits x1 and x3 of the UGC template M respectively, fills the special effect material b into the pits x2 and x4 of the UGC template M respectively, and fills the special effect material c stored in the local cache into the pit x5 of the UGC template M to generate a special effect video.
[0119] In this exemplary application, the special effects processing process can be accelerated by grouping materials, deduplicating the same material-special effects combination, merging some special effects processing tasks, concurrently processing multiple special effects processing tasks, and caching and reusing special effects materials, thereby achieving overall acceleration and resource optimization of UGC template video generation.
[0120] Embodiment 3 Fig. 9The block diagram of the special effects video generation device according to the third embodiment of the present application is schematically shown. The device is used on the user side. The device can be divided into one or more program modules. One or more program modules are stored in a storage medium and 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. 9 As shown, the apparatus 1000 may include: a determination module 1100, a first acquisition module 1200, a creation module 1300, and a second acquisition module 1400, wherein: A determination module 1100 is used to determine a plurality of initial materials, where each initial material corresponds to a special effect combination; The first acquisition module 1200 is used to acquire a plurality of non-repetitive material-special effect combinations according to a plurality of the initial materials and the corresponding plurality of special effects; The creation module 1300 is used to create a corresponding number of multiple special effect processing tasks according to the multiple material-special effect combinations; the special effect processing tasks are used to: apply the special effect combination in the corresponding material-special effect combination to the corresponding initial material to obtain the special effect material; and The second acquisition module 1400 is used to acquire the special effect materials obtained by each of the multiple special effect processing tasks to generate a target special effect video.
[0121] As an optional embodiment, the first acquisition module 1200 is further configured to: Determining material identifiers corresponding to each of the plurality of initial materials; According to the multiple material identifiers, acquiring at least two of the initial materials having the same material identifier; When the special effect combinations corresponding to at least two of the initial materials are the same, deduplication of the at least two initial materials; According to the multiple initial materials and corresponding special effect combinations after deduplication, multiple non-repetitive material-special effect combinations are obtained.
[0122] As an optional embodiment, the second acquisition module 1400 is further configured to: Determine whether a target special effect material obtained by a target special effect processing task is stored in a local cache, where the target special effect task is any one of the multiple special effect processing tasks; In a case where the target special effect material is stored in the local cache, the target special effect material is acquired from the local cache.
[0123] As an optional embodiment, the second acquisition module 1400 is further configured to: The multiple special effect processing tasks are sent to the server, so that the server returns the special effect materials obtained by each special effect processing task.
[0124] As an optional embodiment, the second acquisition module 1400 is further configured to: Determining a plurality of target special effect processing tasks from the plurality of special effect processing tasks; wherein the plurality of target special effect processing tasks all correspond to the same initial material, and the special effect combination in each of the target special effect processing tasks includes one special effect; Generating a special effect processing request according to the plurality of target special effect processing tasks; The special effect processing request is sent to the server so that the server returns the special effect materials obtained by each of the target special effect processing tasks.
[0125] Embodiment 4 Fig.10 The block diagram of the special effects video generation device according to the fourth embodiment of the present application is schematically shown, which is used in a server. 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.10 As shown, the apparatus 2000 may include: a receiving module 2100, an execution module 2200, and a return module 2300, wherein: The receiving module 2100 is used to receive a plurality of non-repetitive special effect processing tasks sent by the target user end; wherein each of the special effect processing tasks corresponds to a material-special effect combination, and each of the material-special effect combination includes an initial material and a special effect combination; An execution module 2200 is used to execute a plurality of the special effect processing tasks, and apply the special effects in each of the material-special effect combinations to the corresponding initial materials to obtain a plurality of different special effect materials; The return module 2300 is used to return the multiple different special effect materials to the target user terminal, so that the target user terminal generates a target special effect video according to the multiple different special effect materials.
[0126] As an optional embodiment, the execution module 2200 is further configured to: confirming whether a target special effect material obtained by a target special effect processing task is stored in the cache, wherein the target special effect processing task is any one of the multiple special effect processing tasks; When the target special effect material is not stored in the cache, executing the target special effect processing task; Wherein, in the case where the target special effect material is stored in the cache, the target special effect material stored in the cache is returned to the target user terminal.
[0127] Embodiment 5 Fig.11 The hardware architecture diagram of a computer device 10000 suitable for implementing a special effect video generation method according to the fifth 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.11 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 the operating system and various application software installed in the computer device 10000, such as the program code of the special effect video generation method, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or will be output.
[0128] 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.
[0129] 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.
[0130] It should be pointed out that Fig.11 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.
[0131] In this embodiment, the special effects 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.
[0132] Embodiment 6 An embodiment of the present application also 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 special effects video generation method in the embodiment are implemented.
[0133] 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 may 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 may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Of course, the computer-readable storage medium may also include both an internal storage unit of a computer device and an external storage device thereof. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on a computer device, such as the program code of the special effects video generation method in the embodiment, etc. In addition, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
[0134] Embodiment 7 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.
[0135] 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.
[0136] 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 special effects video generation method, characterized in that: For a user terminal, the method includes: Determine a plurality of initial materials, each of the initial materials corresponding to a special effect combination; Acquire multiple non-repetitive material-special effect combinations according to the multiple initial materials and the corresponding multiple special effect combinations; According to the plurality of material-special effect combinations, a corresponding number of special effect processing tasks are created; the special effect processing tasks are used to: apply the special effect combination in the corresponding material-special effect combination to the corresponding initial material to obtain the special effect material; and The special effect materials obtained by each of the multiple special effect processing tasks are obtained to generate a target special effect video.
2. The method according to claim 1, characterized in that Get multiple non-repetitive material-effect combinations, including: Determining material identifiers corresponding to each of the plurality of initial materials; According to the multiple material identifiers, acquiring at least two of the initial materials having the same material identifier; When the special effect combinations corresponding to at least two of the initial materials are the same, deduplication of the at least two initial materials; According to the multiple initial materials and corresponding special effect combinations after deduplication, multiple non-repetitive material-special effect combinations are obtained.
3. The method according to claim 1, characterized in that Acquiring the special effect materials obtained by each of the plurality of special effect processing tasks, including: Determine whether a target special effect material obtained by a target special effect processing task is stored in a local cache, where the target special effect task is any one of the multiple special effect processing tasks; In a case where the target special effect material is stored in the local cache, the target special effect material is acquired from the local cache.
4. The method according to claim 1, characterized in that: Acquiring the special effect materials obtained by each of the plurality of special effect processing tasks, including: The multiple special effect processing tasks are sent to the server so that the server returns the special effect materials obtained by each special effect processing task.
5. The method according to claim 4, characterized in that Sending the plurality of special effect processing tasks to the server so that the server returns the special effect materials obtained by each special effect processing task, including: Determining a plurality of target special effect processing tasks from the plurality of special effect processing tasks; wherein the plurality of target special effect processing tasks all correspond to the same initial material, and the special effect combination in each of the target special effect processing tasks includes one special effect; Generating a special effect processing request according to the plurality of target special effect processing tasks; The special effect processing request is sent to the server so that the server returns the special effect materials obtained by each of the target special effect processing tasks.
6. A special effects video generation method, characterized in that: For a server, the method comprises: Receive multiple non-repetitive special effect processing tasks sent by the target user end; wherein each of the special effect processing tasks corresponds to a material-special effect combination, and each of the material-special effect combination includes an initial material and a special effect combination; Executing a plurality of the special effect processing tasks, applying the special effect combinations in each of the material-special effect combinations to the corresponding initial materials to obtain a plurality of different special effect materials; The multiple different special effect materials are returned to the target user terminal so that the target user terminal generates a target special effect video according to the multiple different special effect materials.
7. The method according to claim 6, characterized in that Execute multiple special effect processing tasks, including: confirming whether a target special effect material obtained by a target special effect processing task is stored in the cache, wherein the target special effect processing task is any one of the multiple special effect processing tasks; When the target special effect material is not stored in the cache, executing the target special effect processing task; Wherein, in the case where the target special effect material is stored in the cache, the target special effect material stored in the cache is returned to the target user terminal.
8. A special effects video generation device, characterized in that: For a user terminal, the device comprises: A determination module, used to determine a plurality of initial materials, wherein one initial material corresponds to one special effect combination; A first acquisition module, configured to acquire a plurality of non-repetitive material-special effect combinations according to a plurality of the initial materials and a plurality of corresponding special effects; A creation module, used to create a corresponding number of multiple special effect processing tasks according to the multiple material-special effect combinations; the special effect processing tasks are used to: apply the special effect combination in the corresponding material-special effect combination to the corresponding initial material to obtain the special effect material; and The second acquisition module is used to acquire the special effect materials obtained by each of the multiple special effect processing tasks to generate a target special effect video.
9. A special effects video generation device, characterized in that: For a server, the device comprises: A receiving module, used for receiving a plurality of non-repetitive special effect processing tasks sent by a target user terminal; wherein each of the special effect processing tasks corresponds to a material-special effect combination, and each of the material-special effect combination includes an initial material and a special effect combination; An execution module, used for executing a plurality of the special effect processing tasks, applying the special effect combination in each of the material-special effect combinations to the corresponding initial material to obtain a plurality of different special effect materials; The return module is used to return the multiple different special effect materials to the target user terminal, so that the target user terminal generates a target special effect video according to the multiple different special effect materials.
10. 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 7.
11. 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 7 is implemented.
12. 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 any one of claims 1 to 7 are implemented.