Special effect design method and device and electronic equipment
By setting the special effect particle keyframes associated with real time in video editing, the problem of constant special effects in traditional video editing is solved, and dynamic rendering of video special effects and expansion of application scenarios is realized.
Patent Information
- Application Number
- CN202411744788.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
In traditional video editing, the application of special effects is based on a virtual timeline, which causes the video content to be constant and unchanged every time it plays, which cannot meet the needs of special scenes, and uploading videos multiple times increases complexity and unnaturality.
By setting the keyframes of the video's special effect particles and correlating these keyframes with real time, decoding and restoring the video frame set containing the special effect particles to achieve dynamic rendering and display of special effects.
The application scenarios of video special effects are expanded, allowing video special effects to change dynamically according to real time, enhance the variability and interactivity of video content, and reduce the complexity of multiple uploads.
Smart Images

Figure CN119697431A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of video processing technology, and more specifically, to a special effects design method, device, and electronic device. Background Art
[0002] With the rise of short video platforms, video editing technology has been widely used. However, in traditional video editing, the application of special effects is based on a virtual timeline, resulting in the same effect every time it is played, which limits the variability and interactivity of the video content. For videos edited with the concept of a timeline, the concept of the timeline is unified. Therefore, no matter when the video is played at a normal multiple, the time involved in the special effects, AI algorithms, etc. used in each frame is relative to the starting time of the video playback, which makes the effect of the video content constant every time it is played.
[0003] In special scenarios, such as when it is inconvenient to display the video at the moment due to some reasons, you can only get the results for that period of time instead of all the results in one playback, and you must wait until a specific time to display another effect for a specific period of time. The above concept based on virtual time cannot meet this requirement, and you must upload the video to the short video platform multiple times to achieve a similar effect. Multiple uploads not only increase the complexity, but also appear unnatural and reduce playability. Summary of the invention
[0004] In response to the problems existing in the above-mentioned prior art, the embodiments of the present application provide a special effects design method, device, and electronic device, which can expand the application scenarios of video special effects by combining the special effects rendering method in real time.
[0005] In a first aspect, an embodiment of the present application provides a special effects design method for editing a video, comprising the following steps:
[0006] Setting key frames of special effect particles of the video;
[0007] associating the keyframes with real time; and
[0008] According to the key frame, a frame set of the video containing the special effect particles is decoded and restored.
[0009] Furthermore, before setting the key frame of the special effect particles of the video, the method further includes:
[0010] An information storage field supporting the real time is added to the special effect particles of the video.
[0011] Furthermore, the information storage field is a set of real time points that increase in sequence.
[0012] Furthermore, before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes:
[0013] If the current frame of the video is not set with a corresponding real time, the playback sequence of the video will be composed based on the previous key frame.
[0014] Furthermore, before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes:
[0015] If the current frame of the video is not set with a corresponding real time, and there is no key frame before the current frame of the video, the current frame is played based on the simulated time.
[0016] Furthermore, after decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes:
[0017] According to the key frame, special effects rendering is performed on the frame set of the video.
[0018] Furthermore, before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes:
[0019] The special effect frames of the video supporting the real time are encoded and saved respectively according to the divided time periods, and recorded in a specific field of the video container.
[0020] In a second aspect, the embodiment of the present application further provides a special effect design device, including:
[0021] A key frame setting module, used to set the key frames of the special effect particles of the video;
[0022] A time association module, used to associate the key frame with real time; and
[0023] The decoding and restoring module is used to decode and restore a frame set of the video containing the special effect particles according to the key frame.
[0024] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to implement the special effects design method according to the first aspect when executing the program.
[0025] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, wherein the computer program is used to implement the special effects design method according to the first aspect above.
[0026] The embodiments of the present application bring the following beneficial effects:
[0027] In the special effects design method provided in the embodiment of the present application, the key frames of the special effects particles of the video are first set, and the key frames are associated with the real time. Finally, according to the key frames, the frame set of the video containing the special effects particles is decoded and restored. The special effects design method provided in the embodiment of the present application combines the special effects rendering method of real time, uses real time points to divide several special effects frames into multiple segments, and decodes and restores them according to specific key frames, rather than playing and displaying them according to a virtual timeline, so as to expand the application scenarios of video special effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0029] Figure 1 A schematic diagram of a flow chart of a special effect design method provided in an embodiment of the present application;
[0030] Figure 2 for Figure 1 Schematic diagram of the practical application of the special effects design method;
[0031] Figure 3 for Figure 1 Schematic diagram of the playing process of the special effect frame of the special effect design method;
[0032] Figure 4 A structural block diagram of a special effect design device provided in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0034] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments described in the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0036] In the description, claims and the above-mentioned drawings of this application, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this application, unless otherwise stated, the meaning of "a plurality" is two or more. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0037] Figure 1 is a flowchart of a special effect design method according to an embodiment of this application. As Figure 1 shown, the special effect design method of the embodiment of this application for editing a video includes the following steps:
[0038] S101: Set key frames of the special effect particles of the video;
[0039] A video frame is the basic unit representing the picture at a specific moment in a video. When a video frame contains a special effect, then this video frame can be selected as a key frame.
[0040] S102: Associate the key frames with real time; and
[0041] That is, with reference to Figure 2 and Figure 3 , use real time points to divide several special effect frames into multiple segments of content. As Figure 2 shown, for example, if the current special effect has 15 frames in total, with a duration of 40 ms for each frame, and realtime1 < realtime2 < realtime3, Frame0 can be set as realtime1, Frame5 can be set as realtime5, and Frame10 can be set as realtime3.
[0042] S103: Decode and restore the frame set of the video containing the special effect particles according to the key frames.
[0043] When the video frames of a video are divided according to the above method, when the video needs to be played, different frame sets are taken according to real time for decoding and restoration, so as to realize the display of the special effect of the video.
[0044] As Figure 2 and Figure 3As shown, when realtime1 is set for Frame0, realtime5 is set for Frame5, and realtime3 is set for Frame10, then Frame0-Frame4 will be rendered and played when the real time exceeds realtime1 but not realtime2 during video playback, otherwise no special effect rendering will be performed. When the real time exceeds realtime2 but not realtime3, Frame0-Frame9 will be rendered and played when the video is played. When the real time exceeds realtime3, all frames will be rendered and played when the video is played. When realtime1 is not set, Frame0-Frame4 will be rendered and played as long as the real time does not exceed realtime2. Combining the above example, a simple special effect can be made, that is, when the real time reaches realtime1, the mask special effect does not cover the word "award", and when the real time reaches realtime2, "Prize" is displayed. Only when the real time reaches realtime3, the mask special effect does not cover the content and "Special Prize" is displayed.
[0045] Therefore, in the special effects design method provided in the embodiment of the present application, the key frame of the special effects particle of the video is first set, and the key frame is associated with the real time, and finally, according to the key frame, the frame set of the video containing the special effects particle is decoded and restored. The special effects design method provided in the embodiment of the present application combines the special effects rendering method of real time, uses the real time point to divide several special effects frames into multiple segments, and decodes and restores them according to specific key frames, rather than playing and displaying them according to a virtual timeline, so as to expand the application scenarios of video special effects.
[0046] Furthermore, in some embodiments of the present application, before setting the key frame of the special effect particles of the video, the method further includes:
[0047] An information storage field supporting the real time is added to the special effect particles of the video.
[0048] Specifically, an information storage field is added to the information description of the special effect particles of the video. If this field does not exist or the content of this field is empty, it means that the special effect does not support real time. If the special effect particles support real time, this field stores a set of real time points, so that specific video frames are combined with real time to expand the application scenarios of video features.
[0049] Furthermore, in some embodiments of the present application, the information storage field is a set of real time points in ascending order, so that specific video frames are combined with real time rather than sorted according to virtual time, so as to expand the application scenarios of video characteristics.
[0050] Furthermore, in some embodiments of the present application, before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes:
[0051] If the current frame of the video is not set with a corresponding real time, the playback sequence of the video will be composed based on the previous key frame.
[0052] Specifically, in the special effects design method provided in the embodiment of the present application, the timeline is real time rather than traditional conceptual time. At this time, the time of some frames can be set as real time and made into key frames. If the current frame does not set the corresponding real time, the video frame is based on the previous key frame to form a playback sequence. If there is no key frame before the current frame, the current frame is not based on real time but still based on traditional time or virtual time, thereby ensuring that decoding and restoration are performed according to specific key frames rather than playback and display according to a virtual timeline, so as to expand the application scenarios of video special effects.
[0053] Furthermore, in some embodiments of the present application, before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes:
[0054] If the current frame of the video is not set with a corresponding real time, and there is no key frame before the current frame of the video, the current frame is played based on the simulated time.
[0055] As mentioned above, if there is no key frame before the current frame, the current frame is not based on real time but still based on traditional time or virtual time, thereby ensuring that decoding and restoration are performed according to specific key frames rather than playback and display according to a virtual timeline, so as to expand the application scenarios of video special effects.
[0056] Furthermore, in some embodiments of the present application, after decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes:
[0057] According to the key frame, special effects rendering is performed on the frame set of the video.
[0058] Specifically, when the video preview is played, the content of the aforementioned information storage field is read. When the preview player plays special effects that support real time, the real time comparison is used instead, and the frame sets that meet the conditions are rendered in sequence, otherwise no special effects rendering is performed. This further ensures that decoding and restoration are performed according to specific key frames, rather than playback and display according to a virtual timeline, so as to expand the application scenarios of video special effects.
[0059] Furthermore, in some embodiments of the present application, before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes:
[0060] The special effect frames of the video supporting the real time are encoded and saved respectively according to the divided time periods, and recorded in a specific field of the video container.
[0061] When the video is exported for playback after editing, the corresponding player also needs to be modified to achieve the expected effect. When the video is exported, the special effect frames that support real time will be encoded and saved in divided time periods, and recorded in specific fields of the video container, thereby ensuring that special effects rendering can be combined with real time during playback, rather than playing and displaying according to a virtual timeline, so as to expand the application scenarios of video special effects.
[0062] Figure 4 2 is a structural block diagram of a special effect design device 200 provided in an embodiment of the present application. Figure 4 As shown, the special effect design device 200 of the embodiment of the present application includes: a key frame setting module 210, a time association module 220 and a decoding and restoration module 230, wherein:
[0063] A key frame setting module 210, used to set the key frames of the special effect particles of the video;
[0064] A time association module 220, configured to associate the key frame with real time; and
[0065] The decoding and restoring module 230 is used to decode and restore a frame set of the video containing the special effect particles according to the key frame.
[0066] In the special effects design device provided in the embodiment of the present application, the key frame of the special effects particle of the video is first set, and the key frame is associated with the real time, and finally, according to the key frame, the frame set of the video containing the special effects particle is decoded and restored. The special effects design method provided in the embodiment of the present application combines the special effects rendering method of real time, uses the real time point to divide several special effects frames into multiple segments, and decodes and restores them according to specific key frames, rather than playing and displaying them according to a virtual timeline, so as to expand the application scenarios of video special effects.
[0067] It should be noted that the specific implementation method of the special effects design device of the embodiment of the present application is similar to the specific implementation method of the special effects design method of the embodiment of the present application. Please refer to the description of the method part for details, and no further details will be given here.
[0068] Figure 5 Schematic diagram of the structure of an electronic device 300 according to an embodiment of the present application.
[0069] like Figure 5As shown, the electronic device 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from the storage part 302 to a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0070] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.
[0071] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 309, and / or installed from a removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, the above-mentioned functions defined in the electronic device of the present application are executed.
[0072] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electronic device, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0073] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction-executing electronic device, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction-executing electronic device, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0074] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the processing receiving device, method and computer program product according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the aforementioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based electronic device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0075] The units or modules involved in the embodiments of the present application may be implemented by software or hardware. The units or modules described may also be set in a processor, and the processor is used to implement the special effect design method when executing the program:
[0076] Setting key frames of special effect particles of the video;
[0077] associating the keyframes with real time; and
[0078] According to the key frame, a frame set of the video containing the special effect particles is decoded and restored.
[0079] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently and not be assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the special effect design method described in the present application:
[0080] Setting key frames of special effect particles of the video;
[0081] associating the keyframes with real time; and
[0082] According to the key frame, a frame set of the video containing the special effect particles is decoded and restored.
[0083] As another aspect, the present application further provides a computer program product, which may be included in the electronic device described in the above embodiment; or may exist independently without being installed in the electronic device. The above computer program product stores one or more programs, and when the above programs are used by one or more processors to execute the special effect design method described in the present application:
[0084] Setting key frames of special effect particles of the video;
[0085] associating the keyframes with real time; and
[0086] According to the key frame, a frame set of the video containing the special effect particles is decoded and restored.
[0087] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. All equivalent structural changes made by using the contents of the present application specification and drawings under the application concept of the present application, or directly / indirectly used in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A special effects design method for editing a video, characterized in that: The following steps are involved: Setting key frames of special effect particles of the video; Associating the keyframes with real time; and According to the key frame, a frame set of the video containing the special effect particles is decoded and restored.
2. The special effect design method according to claim 1, characterized in that: Before setting the key frame of the special effect particles of the video, the method further includes: An information storage field supporting the real time is added to the special effect particles of the video.
3. The special effect design method according to claim 2, characterized in that: The information storage field is a set of real time points that increase in sequence.
4. The special effect design method according to claim 1, characterized in that: Before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes: If the current frame of the video is not set with a corresponding real time, the playback sequence of the video will be composed based on the previous key frame.
5. The special effect design method according to claim 1, characterized in that: Before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes: If the current frame of the video is not set with a corresponding real time, and there is no key frame before the current frame of the video, the current frame is played based on the simulated time.
6. The special effect design method according to claim 1, characterized in that: After decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes: According to the key frame, special effects rendering is performed on the frame set of the video.
7. The special effect design method according to claim 6, characterized in that: Before decoding and restoring the frame set of the video containing the special effect particles according to the key frame, the method further includes: The special effect frames of the video supporting the real time are encoded and saved respectively according to the divided time periods, and recorded in a specific field of the video container.
8. A special effect design device, characterized in that: include: A key frame setting module, used to set the key frames of the special effect particles of the video; A time association module, used for associating the key frame with real time; and The decoding and restoring module is used to decode and restore a frame set of the video containing the special effect particles according to the key frame.
9. An electronic device, characterized in that: It comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor is used to implement the special effect design method according to any one of claims 1 to 7 when executing the program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to implement the special effect design method according to any one of claims 1-7.