PAG-based dynamic surround effect development method, apparatus and device, and medium

Through the dynamic surround special effects development method based on PAG, dynamic surround special effects are directly added to the original video file, which solves the problems of low development efficiency and high communication costs in the existing technology, and achieves more efficient special effects development and effect improvement.

CN119094671APending Publication Date: 2024-12-06杭州宇神五号科技有限公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411582672.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing dynamic surround special effects development methods have different concerns between designers and developers, coupled with communication and platform restrictions, resulting in long development cycles, high communication costs, poor display effects and low efficiency.

Method used

Using a dynamic surround special effects development method based on PAG, by obtaining the original video file and PAG special effects files, image segmentation and layer merging are performed, and video files are generated after special effects processing are reduced to the communication needs between designers and developers, and directly in the original video file. Add dynamic wraparound effects.

Benefits of technology

It effectively reduces the communication cost of dynamic surrounding special effects development, improves development efficiency and effect, simplifies the special effects development process, and reduces the editing and processing needs of the original video file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094671A_ABST
    Figure CN119094671A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a PAG-based dynamic surround special effect development method, device and equipment and a medium, and the method comprises the steps: obtaining an original video file and a PAG special effect file when a dynamic surround special effect development instruction is detected; wherein the PAG special effect file comprises an editable special effect layer; obtaining at least one key frame from the original video file according to a preset key frame; performing image segmentation on each key frame to obtain a corresponding segmented image group; wherein each segmented image group comprises a portrait MASK image layer and a segmented key frame; replacing an original human image layer in the editable special effect layer with a human image MASK layer to obtain a corresponding PAG layer; performing layer merging on the PAG layer and the corresponding segmented key frame to obtain a corresponding key frame after special effect processing; and generating a video file after special effect processing based on each key frame after special effect processing. The embodiment of the invention can effectively improve the development efficiency and the implementation effect of the dynamic surround special effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing technology, and in particular to a method, device, equipment and medium for developing dynamic surround special effects based on PAG. Background Art

[0002] The dynamic surround effect is a common video effect. It is used to add human body materials in the video to enhance the expressiveness and viewing experience of the video. It is a common and important visual effect function in video editors.

[0003] The common dynamic surround special effects development process includes effect design, special effects development and effect verification; among them, effect design is the first step in the dynamic surround special effects development process, and designers design corresponding dynamic surround special effects based on user needs, market demands and competitive product analysis; special effects development is the second step in the dynamic surround special effects development process, and developers write code based on the dynamic surround special effects designed by designers to add dynamic surround special effects to the portraits in the video; finally, repeated tests are performed in the test software to verify whether the written special effects code meets the expected effect.

[0004] During the development of dynamic surround special effects, due to the different focuses and restoration capabilities of designers and developers, as well as communication and platform limitations, the obtained effects may not meet expectations. Therefore, during the entire development process, designers and developers need to communicate and verify repeatedly until the written special effects code meets the expected effect. Therefore, the existing dynamic surround special effects development method has the following disadvantages: 1. Long development cycle; 2. High communication cost; 3. Poor display effect.

[0005] In summary, the existing dynamic surround special effects development method has the problem of low efficiency in dynamic surround special effects development. Summary of the invention

[0006] The embodiments of the present invention provide a PAG-based dynamic surround special effect development method, device, equipment and medium, aiming to solve the problem of low efficiency of dynamic surround special effect development in existing dynamic surround special effect development methods.

[0007] In a first aspect, an embodiment of the present invention provides a method for developing dynamic surround special effects based on PAG, the method comprising: When a dynamic surround special effect development instruction is detected, the original video file and the PAG special effect file are obtained; wherein the PAG special effect file includes an editable special effect layer; Acquire at least one key frame from the original video file according to a preset key frame; Perform image segmentation on each of the key frames to obtain a corresponding segmentation map group; wherein the segmentation map group includes a portrait MASK layer and a segmented key frame; Replace the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain a corresponding PAG layer; Merge the PAG layer with the corresponding segmented key frame to obtain the corresponding special effect processed key frame; A video file after special effect processing is generated based on each of the key frames after special effect processing.

[0008] In a second aspect, an embodiment of the present invention further provides a PAG-based dynamic surround special effect development device, the device comprising: A first acquisition unit is used to acquire an original video file and a PAG special effect file when a dynamic surround special effect development instruction is detected; wherein the PAG special effect file includes an editable special effect layer; A second acquisition unit, configured to acquire at least one key frame from the original video file according to a preset key frame; An image segmentation unit, used to perform image segmentation on each of the key frames to obtain a corresponding segmentation graph group; wherein the segmentation graph group includes a portrait MASK layer and a segmented key frame; A layer replacement unit, used to replace the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain a corresponding PAG layer; A layer merging unit, used for merging the PAG layer with the corresponding segmented key frame to obtain a corresponding special effect processed key frame; A generating unit is used to generate a special effect processed video file based on each of the special effect processed key frames.

[0009] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0010] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and wherein the program instructions, when executed by a processor, can implement the method described in the first aspect above.

[0011] The embodiment of the present invention provides a method, device, equipment and medium for developing dynamic surround special effects based on PAG, and the method includes: when a dynamic surround special effect development instruction is detected, obtaining an original video file and a PAG special effect file; wherein the PAG special effect file includes an editable special effect layer; obtaining at least one key frame from the original video file according to a preset key frame; performing image segmentation on each of the key frames to obtain a corresponding segmentation map group; wherein the segmentation map group includes a portrait MASK layer and a segmented key frame; replacing the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain a corresponding PAG layer; merging the PAG layer with the corresponding segmented key frame to obtain a corresponding special effect processed key frame; generating a special effect processed video file based on each of the special effect processed key frames. The PAG special effects file in the embodiment of the present invention is directly output by the designer in the video production software, and there is no need for the designer to communicate and verify repeatedly with the developer, which can effectively reduce the communication cost; in addition, the embodiment of the present invention can directly perform special effects processing on the original video file through the PAG special effects file, so that the present invention does not need to edit the original video file, and can add dynamic surround special effects to the portrait in the original video file to obtain the video file after special effects processing, which can effectively improve the development efficiency and implementation effect of the dynamic surround special effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0013] Figure 1 A schematic flow chart of a method for developing dynamic surround special effects based on PAG provided in an embodiment of the present invention; Figure 2 A schematic diagram of a sub-process of a method for developing dynamic surround special effects based on PAG provided in an embodiment of the present invention; Figure 3 A schematic block diagram of a PAG-based dynamic surround special effect development device provided in an embodiment of the present invention; Figure 4 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0014] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0015] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0016] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0017] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. The embodiment of the present invention provides a dynamic surround special effect development method, device, equipment and medium based on PAG. The dynamic surround special effect development method based on PAG can be found in Figure 1 , Figure 1A flow chart of a PAG-based dynamic surround special effect development method provided in an embodiment of the present invention. The method is applied to a server of a video processing system, wherein the video processing system includes multiple management terminals, and after the management terminal obtains the original video file and the PAG special effect file selected by the designer, the original video file and the PAG special effect file are sent to the server, so that the server performs special effect processing on the original video file according to the PAG-based dynamic surround special effect development method in the embodiment of the present application to generate a special effect processed video file, and the server sends the special effect processed video file to the corresponding management terminal, and the designer can view or share the special effect processed video file through the management terminal; wherein the management terminal includes but is not limited to personal computers (personal computers, PCs), mobile phones, mobile computers, tablet computers, media players, smart wearable devices, smart TVs, vehicle-mounted devices, personal digital assistants (personal digital assistants, PDAs) and other electronic devices, the management terminal is a terminal with video processing function, and the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers.

[0018] Figure 1 The following is a flow chart of a method for developing dynamic surround special effects based on PAG provided by an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S110-S160.

[0019] S110. When a dynamic surround special effect development instruction is detected, the original video file and the PAG special effect file are obtained; wherein the PAG special effect file includes an editable special effect layer.

[0020] In this embodiment, the designer can turn on the video processing module of the management terminal. Under the video processing module, the designer can select a video file from a plurality of pre-stored video files as the original video file, or shoot a video as the original video file, and then select a dynamic surround special effects template from a plurality of pre-stored dynamic surround special effects templates, each of the dynamic surround special effects templates is associated with a corresponding PAG special effects file; wherein the dynamic surround special effects template can specifically be preset as "dynamic flame", "dynamic light and shadow" or "dynamic props" of the surround video characters, and the management terminal generates a corresponding dynamic surround special effects development instruction according to the original video file and the PAG special effects file selected by the designer, and then sends the dynamic surround special effects development instruction to the server, and the server obtains the original video file and the PAG special effects file according to the received dynamic surround special effects development instruction, performs special effects processing on the original video file according to the PAG special effects file, thereby generating a corresponding special effects processed video file.

[0021] Furthermore, the PAG special effects file is a resource file in PAG (Portable Animated Graphics) format, which is directly output by the designer in the video production software of the management terminal; wherein the video production software may be AE (Adobe After Effects). Effects) and other video production software; specifically, the designer designs and produces dynamic surround special effects in the video production software, and then selects at least one PAG template from multiple preset PAG templates, combines the dynamic surround special effects with the selected PAG template to output a corresponding PAG special effects file, the PAG special effects file includes an editable special effects layer, the PAG template is used to define attribute parameters of the editable special effects layer, the attribute parameters may specifically be resolution parameters of the editable special effects layer, and the resolution parameters may be 1:1, 9:16, 4:3, etc.; for example, the designer selects two PAG templates, and the two PAG templates are respectively "resolution parameter is 1:1" and "resolution parameter is 9:16", therefore, the output PAG special effects file contains two editable special effects layers, and the resolution parameters of the two editable special effects layers are respectively 1:1 and 9:16.

[0022] In one embodiment, after step S110, the method further includes: acquiring a target portrait area preset in the editable special effect layer; and configuring the target portrait area as an original portrait layer of the editable special effect layer.

[0023] In this embodiment, a target portrait area preset in the editable special effect layer is obtained; wherein the target portrait area is set by a designer during the dynamic surround special effect production process; the target portrait area is configured as the original portrait layer of the editable special effect layer, and the editable special effect layer includes an original portrait layer and at least one dynamic surround special effect layer.

[0024] In one embodiment, after step S110, it also includes: determining whether the PAG special effect file contains multiple PAG templates to obtain a determination result; if the determination result is yes, generating a corresponding pop-up window according to the PAG template in the PAG special effect file and displaying it on the design interface; and determining an editable special effect layer corresponding to the template confirmation information based on the PAG template corresponding to the template confirmation information returned based on the pop-up window.

[0025] In this embodiment, it is determined whether the PAG special effect file contains multiple PAG templates to obtain a determination result; wherein the PAG template is used to define the attribute parameters of the editable special effect layer, and the attribute parameters may specifically be the resolution parameters of the editable special effect layer, etc., and the resolution parameters may be 1:1, 9:16, 4:3, etc., and one PAG template corresponds to one editable special effect layer; if the determination result is yes, a corresponding pop-up window is generated according to the PAG template in the PAG special effect file and displayed on the design interface; for example, if there are two PAG templates in the PAG special effect file, and the two PAG templates are "resolution parameter is 1:1" and "resolution parameter is 9:16", respectively, the designer can select the target PAG template in the generated pop-up window according to actual needs; according to the PAG template corresponding to the template confirmation information returned based on the pop-up window, the editable special effect layer corresponding to the template confirmation information is determined; for example, if the PAG template selected by the designer is "resolution parameter is 1:1", the resolution parameter of the corresponding editable special effect layer is 1:1.

[0026] Furthermore, if the judgment result is no, a step of acquiring at least one key frame from the original video file according to preset key frames is executed.

[0027] S120: Acquire at least one key frame from the original video file according to preset key frames.

[0028] In this embodiment, at least one key frame is obtained from the original video file according to preset key frames. The key frame can be customized by a designer in the management terminal, or obtained by calculating the motion trajectory of the original video file using the management terminal, or obtained by performing interpolation operations on the original video file using the management terminal.

[0029] S130, performing image segmentation on each of the key frames to obtain a corresponding segmentation map group; wherein the segmentation map group includes a portrait MASK layer and segmented key frames.

[0030] In this embodiment, image segmentation is performed on each of the key frames to obtain a corresponding segmentation map group; wherein the segmentation map group includes a portrait MASK layer and a segmented key frame; specifically, through a masking technique, the portrait in the key frame is isolated from the key frame, thereby obtaining the portrait MASK layer and the segmented key frame.

[0031] S140: Replace the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain a corresponding PAG layer.

[0032] In this embodiment, the original portrait layer in the editable special effect layer is replaced with the portrait MASK layer to obtain the corresponding PAG layer; specifically, in the editable special effect layer, the original portrait layer and the portrait MASK layer are dynamically replaced to add a dynamic surround special effect on the portrait MASK layer.

[0033] In one embodiment, before step S140, the method further includes: obtaining a layer adaptation property of the editable special effect layer; and center-scaling the original portrait layer and the portrait MASK layer according to the layer adaptation property.

[0034] In this embodiment, the layer adaptation properties of the editable special effect layer are obtained; the layer adaptation properties include attribute parameters such as the size of the editable special effect layer and the pixel coordinates of the editable special effect layer; the original portrait layer and the portrait MASK layer are centered and scaled according to the layer adaptation properties to ensure that the processing of the original portrait layer and the portrait MASK layer is consistent in logic and accuracy, otherwise the layers will be misaligned and the correct image cannot be obtained.

[0035] S150, merging the PAG layer with the corresponding segmented key frame to obtain the corresponding special effect processed key frame.

[0036] In this embodiment, the PAG layer is layer-merged with the corresponding segmented key frame to obtain the corresponding special effect processed key frame, so as to add a dynamic surround special effect to the portrait in the key frame.

[0037] More specifically, before merging the PAG layer with the corresponding segmented key frames, each segmented key frame needs to be scaled according to the layer adaptation properties of the editable special effect layer to prevent layer misalignment after the layer merging, which affects the video display effect.

[0038] S160: Generate a special effect processed video file based on each of the special effect processed key frames.

[0039] In this embodiment, a video file after special effect processing is generated according to the frame sequence of each key frame after special effect processing and the frame sequence of non-key frames in the original video, so as to achieve adding dynamic surround special effect in the video.

[0040] In one embodiment, before step S160, the method further includes: obtaining a canvas adaptation property of the target canvas; and adaptively modifying the size of the key frame after special effect processing and the non-key frame in the original video file according to the canvas adaptation property.

[0041] In this embodiment, the layer adaptation properties of the editable special effect layer are not necessarily consistent with the canvas adaptation properties of the target canvas. Therefore, it is also necessary to obtain the canvas adaptation properties of the target canvas. According to the canvas adaptation properties, the sizes of the key frames after special effect processing and the non-key frames in the original video file are adaptively modified to prevent image deformation and affect the video display effect.

[0042] In one embodiment, if Figure 2 As shown, step S160 includes steps S161-S162.

[0043] S161, when a special effect update instruction is detected, obtaining new special effect parameters according to the special effect update instruction; S162: Update the material layer in the editable special effect layer based on the new special effect parameter to generate a new PAG special effect file.

[0044] In this embodiment, the designer can modify the PAG special effects file in the video production software. For example, the dynamic surround special effects effect of the PAG special effects file is "dynamic flames" surrounding the video characters. The designer can modify the PAG special effects file in the video production software and modify the dynamic surround special effects effect of the PAG special effects file to "dynamic light and shadow"; when modifying the PAG special effects file, the designer only needs to replace the special effects material, or after replacing the special effects material, adjust its visual parameters according to the properties of the replaced special effects material to quickly produce a new special effect; specifically, the designer modifies the PAG special effects file in the video production software, for example, replaces special effects material A with special effects material B. After the design is completed, when the designer clicks "Export", the corresponding special effects update instruction will be triggered, and the server will obtain new special effects parameters according to the received special effects update instruction; based on the new special effects parameters, the material layer in the editable special effects layer is updated to generate a new PAG special effects file.

[0045] In one embodiment, after step S160, the method further includes: when a video playback signal is detected, rendering the image frames in the special effect processed video file frame by frame on the target canvas at a preset playback speed.

[0046] In this embodiment, the designer can play the special effects processed video file in the video playback software. When the designer selects the special effects processed video file and clicks "play", a corresponding video playback signal will be generated. When the server detects the video playback signal, the image frames in the special effects processed video file will be rendered frame by frame on the target canvas at a preset playback speed; wherein, the target canvas can be the playback interface of electronic devices such as mobile phones, mobile computers, tablet computers, media players, etc., and the designer can verify on the target canvas whether the added dynamic surround special effects meet the expected effects.

[0047] To sum up, the PAG special effects file in the embodiment of the present invention is directly output by the designer in the video production software, and there is no need for the designer to communicate and verify repeatedly with the developer, which can effectively improve the development efficiency of dynamic surround special effects and reduce development costs; in addition, the embodiment of the present invention can directly perform special effects processing on the original video file through the PAG special effects file, so that the present invention does not need to edit the original video file, and can add dynamic surround special effects to the portrait in the original video file to obtain the video file after special effects processing, which can effectively improve the development efficiency and implementation effect of dynamic surround special effects.

[0048] Figure 3 A schematic block diagram of a PAG-based dynamic surround special effects development device provided in an embodiment of the present invention. Figure 3 As shown, corresponding to the above PAG-based dynamic surround special effect development method, the present invention also provides a PAG-based dynamic surround special effect development device, which is configured in the server of the video processing system, and the video processing system includes multiple management terminals. After the management terminal obtains the original video file and the PAG special effect file selected by the designer, the original video file and the PAG special effect file are sent to the server, so that the server performs special effect processing on the original video file according to the PAG-based dynamic surround special effect development method in the embodiment of the present application to generate a special effect processed video file, and the server sends the special effect processed video file to the corresponding management terminal, and the designer can view or share the special effect processed video file through the management terminal; wherein the management terminal includes but is not limited to personal computers (personal computers, PCs), mobile phones, mobile computers, tablet computers, media players, smart wearable devices, smart TVs, vehicle-mounted devices, personal digital assistants (personal digital assistants, PDAs) and other electronic devices, the management terminal is a terminal with video processing function, and the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. Specifically, please refer to Figure 3 The PAG-based dynamic surround special effect development device 700 includes: The first acquisition unit 701 is used to acquire the original video file and the PAG special effect file when a dynamic surround special effect development instruction is detected; wherein the PAG special effect file includes an editable special effect layer; A second acquisition unit 702 is used to acquire at least one key frame from the original video file according to a preset key frame; The image segmentation unit 703 is used to perform image segmentation on each of the key frames to obtain a corresponding segmentation graph group; wherein the segmentation graph group includes a portrait MASK layer and a segmented key frame; A layer replacement unit 704 is used to replace the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain a corresponding PAG layer; A layer merging unit 705 is used to merge the PAG layer with the corresponding segmented key frame to obtain a corresponding special effect processed key frame; The generating unit 706 is used to generate a special effect processed video file based on each of the special effect processed key frames.

[0049] In some embodiments, before executing the step of replacing the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain the corresponding PAG layer, the layer replacement unit 704 is further used to: The layer adaptation attribute of the editable special effect layer is obtained; and the original portrait layer and the portrait MASK layer are centered and scaled according to the layer adaptation attribute.

[0050] In some embodiments, before executing the step of generating a special effect processed video file based on each of the special effect processed key frames, the generating unit 706 is further configured to: Acquire a canvas adaptation property of the target canvas; and adaptively modify the size of the key frame after the special effect processing and the non-key frame in the original video file according to the canvas adaptation property.

[0051] In some embodiments, after executing the step of acquiring the original video file and the PAG special effect file when the dynamic surround special effect development instruction is detected, the first acquisition unit 701 is further used to: Acquire a preset target portrait area in the editable special effect layer; and configure the target portrait area as an original portrait layer of the editable special effect layer.

[0052] In some embodiments, after executing the step of generating a special effect processed video file based on each of the special effect processed key frames, the generating unit 706 is further configured to: When a special effect update instruction is detected, new special effect parameters are obtained according to the special effect update instruction; and the material layer in the editable special effect layer is updated based on the new special effect parameters to generate a new PAG special effect file.

[0053] In some embodiments, after executing the step of generating a special effect processed video file based on each of the special effect processed key frames, the generating unit 706 is further configured to: When a video playback signal is detected, the image frames in the special effect processed video file are rendered frame by frame on the target canvas at a preset playback speed.

[0054] In some embodiments, after executing the step of acquiring the original video file and the PAG special effect file when the dynamic surround special effect development instruction is detected, the first acquisition unit 701 is further used to: Determine whether the PAG special effect file contains multiple PAG templates and obtain a judgment result; if the judgment result is yes, generate a corresponding pop-up window according to the PAG template in the PAG special effect file and display it on the design interface; based on the PAG template corresponding to the template confirmation information returned based on the pop-up window, determine the editable special effect layer corresponding to the template confirmation information.

[0055] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned PAG-based dynamic surround special effects development device and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.

[0056] The above-mentioned PAG-based dynamic surround special effect development device can be implemented in the form of a computer program, which can be used in Figure 4 Runs on the computer device shown.

[0057] See also Figure 4 , Figure 4 800 is a schematic block diagram of an electronic device provided by an embodiment of the present invention. The computer device 800 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.

[0058] See also Figure 4 The electronic device 800 includes a processor 802 , a memory and a network interface 805 connected via a system bus 801 , wherein the memory may include a non-volatile storage medium 803 and an internal memory 804 .

[0059] The non-volatile storage medium 803 can store an operating system 8031 ​​and a computer program 8032. The computer program 8032 includes program instructions, and when the program instructions are executed, the processor 802 can execute a dynamic surround special effect development method based on PAG.

[0060] The processor 802 is used to provide computing and control capabilities to support the operation of the entire electronic device 800 .

[0061] The internal memory 804 provides an environment for the operation of the computer program 8032 in the non-volatile storage medium 803. When the computer program 8032 is executed by the processor 802, the processor 802 can execute a dynamic surround special effect development method based on PAG.

[0062] The network interface 805 is used to communicate with other devices over the network. Figure 4 The structure shown in the figure is merely a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the electronic device 800 to which the solution of the present invention is applied. The specific electronic device 800 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0063] The processor 802 is used to run the computer program 8032 stored in the memory to implement the following steps: When a dynamic surround special effect development instruction is detected, the original video file and the PAG special effect file are obtained; wherein the PAG special effect file includes an editable special effect layer; at least one key frame is obtained from the original video file according to a preset key frame; image segmentation is performed on each of the key frames to obtain a corresponding segmentation map group; wherein the segmentation map group includes a portrait MASK layer and a segmented key frame; the original portrait layer in the editable special effect layer is replaced with the portrait MASK layer to obtain a corresponding PAG layer; the PAG layer and the corresponding segmented key frame are layer-merged to obtain a corresponding special effect processed key frame; and a special effect processed video file is generated based on each of the special effect processed key frames.

[0064] In some embodiments, before the processor 802 replaces the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain the corresponding PAG layer, it further implements the following steps: The layer adaptation attribute of the editable special effect layer is obtained; and the original portrait layer and the portrait MASK layer are centered and scaled according to the layer adaptation attribute.

[0065] In some embodiments, before implementing the step of generating a special effect processed video file based on each of the special effect processed key frames, the processor 802 further implements the following steps: Acquire a canvas adaptation property of the target canvas; and adaptively modify the size of the key frame after the special effect processing and the non-key frame in the original video file according to the canvas adaptation property.

[0066] In some embodiments, after the processor 802 implements the step of acquiring the original video file and the PAG special effect file when the dynamic surround special effect development instruction is detected, the processor 802 further implements the following steps: Acquire a preset target portrait area in the editable special effect layer; and configure the target portrait area as an original portrait layer of the editable special effect layer.

[0067] In some embodiments, after implementing the step of generating a special effect processed video file based on each of the special effect processed key frames, the processor 802 further implements the following steps: When a special effect update instruction is detected, new special effect parameters are obtained according to the special effect update instruction; and the material layer in the editable special effect layer is updated based on the new special effect parameters to generate a new PAG special effect file.

[0068] In some embodiments, after implementing the step of generating a special effect processed video file based on each of the special effect processed key frames, the processor 802 further implements the following steps: When a video playback signal is detected, the image frames in the special effect processed video file are rendered frame by frame on the target canvas at a preset playback speed.

[0069] In some embodiments, after implementing the step of generating a special effect processed video file based on each of the special effect processed key frames, the processor 802 further implements the following steps: Determine whether the PAG special effect file contains multiple PAG templates and obtain a judgment result; if the judgment result is yes, generate a corresponding pop-up window according to the PAG template in the PAG special effect file and display it on the design interface; based on the PAG template corresponding to the template confirmation information returned based on the pop-up window, determine the editable special effect layer corresponding to the template confirmation information.

[0070] It should be understood that in the embodiment of the present invention, the processor 802 may be a central processing unit (CPU), and the processor 802 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0071] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0072] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the following steps: When a dynamic surround special effect development instruction is detected, the original video file and the PAG special effect file are obtained; wherein the PAG special effect file includes an editable special effect layer; at least one key frame is obtained from the original video file according to a preset key frame; image segmentation is performed on each of the key frames to obtain a corresponding segmentation map group; wherein the segmentation map group includes a portrait MASK layer and a segmented key frame; the original portrait layer in the editable special effect layer is replaced with the portrait MASK layer to obtain a corresponding PAG layer; the PAG layer and the corresponding segmented key frame are layer-merged to obtain a corresponding special effect processed key frame; and a special effect processed video file is generated based on each of the special effect processed key frames.

[0073] In one embodiment, before the processor executes the program instructions to replace the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain the corresponding PAG layer, it further implements the following steps: The layer adaptation attribute of the editable special effect layer is obtained; and the original portrait layer and the portrait MASK layer are centered and scaled according to the layer adaptation attribute.

[0074] In one embodiment, before the processor executes the program instructions to implement the step of generating a special effect processed video file based on each of the special effect processed key frames, the processor further implements the following steps: Acquire a canvas adaptation property of the target canvas; and adaptively modify the size of the key frame after the special effect processing and the non-key frame in the original video file according to the canvas adaptation property.

[0075] In one embodiment, after the processor executes the program instructions to implement the step of acquiring the original video file and the PAG special effect file when the dynamic surround special effect development instruction is detected, the processor further implements the following steps: Acquire a preset target portrait area in the editable special effect layer; and configure the target portrait area as an original portrait layer of the editable special effect layer.

[0076] In one embodiment, after executing the program instructions to implement the step of generating a special effect processed video file based on each of the special effect processed key frames, the processor further implements the following steps: When a special effect update instruction is detected, new special effect parameters are obtained according to the special effect update instruction; and the material layer in the editable special effect layer is updated based on the new special effect parameters to generate a new PAG special effect file.

[0077] In one embodiment, after executing the program instructions to implement the step of generating a special effect processed video file based on each of the special effect processed key frames, the processor further implements the following steps: When a video playback signal is detected, the image frames in the special effect processed video file are rendered frame by frame on the target canvas at a preset playback speed.

[0078] In one embodiment, after executing the program instructions to implement the step of generating a special effect processed video file based on each of the special effect processed key frames, the processor further implements the following steps: Determine whether the PAG special effect file contains multiple PAG templates and obtain a judgment result; if the judgment result is yes, generate a corresponding pop-up window according to the PAG template in the PAG special effect file and display it on the design interface; based on the PAG template corresponding to the template confirmation information returned based on the pop-up window, determine the editable special effect layer corresponding to the template confirmation information.

[0079] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0080] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0081] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0082] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0083] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0084] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for developing dynamic surround special effects based on PAG, characterized in that: The method comprises: When a dynamic surround special effect development instruction is detected, the original video file and the PAG special effect file are obtained; wherein the PAG special effect file includes an editable special effect layer; Acquire at least one key frame from the original video file according to a preset key frame; Perform image segmentation on each of the key frames to obtain a corresponding segmentation map group; wherein the segmentation map group includes a portrait MASK layer and a segmented key frame; Replace the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain a corresponding PAG layer; Merge the PAG layer with the corresponding segmented key frame to obtain the corresponding special effect processed key frame; A video file after special effect processing is generated based on each of the key frames after special effect processing.

2. The method for developing dynamic surround special effects based on PAG according to claim 1, characterized in that: Before replacing the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain the corresponding PAG layer, the method further includes: Obtaining the layer adaptation properties of the editable special effect layer; The original portrait layer and the portrait MASK layer are centered and scaled according to the layer adaptation attribute.

3. The method for developing dynamic surround special effects based on PAG according to claim 1, characterized in that: Before generating the special effect processed video file based on each of the special effect processed key frames, the method further includes: Get the canvas adaptation properties of the target canvas; The sizes of the key frames after special effect processing and the non-key frames in the original video file are adaptively modified according to the canvas adaptation attribute.

4. The method for developing dynamic surround special effects based on PAG according to claim 1, characterized in that: When the dynamic surround special effect development instruction is detected, after obtaining the original video file and the PAG special effect file, the method further includes: Obtaining a preset target portrait area in the editable special effect layer; The target portrait area is configured as the original portrait layer of the editable special effect layer.

5. The method for developing dynamic surround special effects based on PAG according to claim 1, characterized in that: After generating the special effect processed video file based on each of the special effect processed key frames, the method further includes: When a special effect update instruction is detected, new special effect parameters are obtained according to the special effect update instruction; The material layer in the editable special effect layer is updated based on the new special effect parameter to generate a new PAG special effect file.

6. The method for developing dynamic surround special effects based on PAG according to claim 1, characterized in that: After generating the special effect processed video file based on each of the special effect processed key frames, the method further includes: When a video playback signal is detected, the image frames in the special effect processed video file are rendered frame by frame on the target canvas at a preset playback speed.

7. The method for developing dynamic surround special effects based on PAG according to claim 1, characterized in that: When the dynamic surround special effect development instruction is detected, after obtaining the original video file and the PAG special effect file, the method further includes: Determine whether the PAG special effect file contains multiple PAG templates, and obtain a determination result; If the judgment result is yes, a corresponding pop-up window is generated according to the PAG template in the PAG special effect file and displayed on the design interface; According to the PAG template corresponding to the template confirmation information returned based on the pop-up window, an editable special effect layer corresponding to the template confirmation information is determined.

8. A dynamic surround special effect development device based on PAG, characterized in that: The device comprises: A first acquisition unit is used to acquire an original video file and a PAG special effect file when a dynamic surround special effect development instruction is detected; wherein the PAG special effect file includes an editable special effect layer; A second acquisition unit, configured to acquire at least one key frame from the original video file according to a preset key frame; An image segmentation unit, used to perform image segmentation on each of the key frames to obtain a corresponding segmentation graph group; wherein the segmentation graph group includes a portrait MASK layer and a segmented key frame; A layer replacement unit, used to replace the original portrait layer in the editable special effect layer with the portrait MASK layer to obtain a corresponding PAG layer; A layer merging unit, used for merging the PAG layer with the corresponding segmented key frame to obtain a corresponding special effect processed key frame; A generating unit is used to generate a special effect processed video file based on each of the special effect processed key frames.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the PAG-based dynamic surround special effects development method as described in any one of claims 1-7 is implemented.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor executes the PAG-based dynamic surround special effects development method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Video processing method and device, computer equipment and storage medium

    CN111899155A

  • Game special effect processing method and device

    CN112138382A

  • Video processing method and device

    CN112544070A

  • Animation playing method and device, electronic equipment and computer readable storage medium

    CN113409427A

  • Video processing method and device, equipment and storage medium

    CN115250335A