Video special effect editing method and apparatus, electronic device, and storage medium
By assigning tasks to two threads during the video special effects editing process, the performance degradation caused by repeated execution of video algorithm detection is solved, and the stability and efficiency of video playback are improved.
Patent Information
- Application Number
- PCT/CN2024/136430
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-24
- Filing Date
- 2024-12-03
- Publication Date
- 2025-07-31
AI Technical Summary
During the video special effects editing process, when repeatedly playing video for debugging, frequent video algorithm detection tasks lead to waste of computing resources, degradation of performance, lag or delay.
The video special effects editing task and the video algorithm detection task are assigned to execute in two threads, and the current detection result is obtained on the first thread in advance and saved. The video special effects editing is performed on the second thread to avoid repeated execution of the detection task.
The frame rate of video playback is improved, the stability of video algorithm detection tasks is achieved, and the lag or delay in video special effects editing is avoided.
Smart Images

Figure CN2024136430_31072025_PF_FP_ABST
Abstract
Description
Video special effects editing method, device, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application No. 202410103062.9, filed on January 24, 2024, entitled “Video special effects editing method, device, electronic device and storage medium”. The entire contents of that application are incorporated herein by reference. Technical Field
[0003] The embodiments of the present disclosure relate to data processing technology, and more particularly to a method, device, electronic device, and storage medium for editing video special effects. Summary of the Invention
[0004] The present disclosure provides a video special effects editing method, device, electronic device and storage medium to solve the problem of performance degradation caused by repeated execution of video algorithm detection tasks when repeatedly playing videos for debugging, improve the frame rate of video playback, and achieve the stability of the video algorithm detection task effect.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for editing video special effects, the method comprising:
[0006] Determine the current video segment;
[0007] Obtain target editing parameter information for performing a video special effects editing task on a video frame in the current video clip;
[0008] Determining a current detection result corresponding to the current video clip, where the current detection result is obtained by pre-executing a video algorithm detection task on video frames in the current video clip on a first thread, and execution of the video special effects editing task depends on the detection result of the video algorithm detection task;
[0009] Based on the current detection result and the target editing parameter information, a video special effects editing task is performed on the video frames in the current video clip on the second thread.
[0010] In a second aspect, an embodiment of the present disclosure further provides a video special effects editing device, the device comprising:
[0011] A video segment determination module, used to determine the current video segment;
[0012] An information acquisition module is used to obtain target editing parameter information used for performing a video special effects editing task on a video frame in a current video clip;
[0013] a detection result determination module, configured to determine a current detection result corresponding to the current video clip, the current detection result being obtained by pre-executing a video algorithm detection task on video frames in the current video clip on a first thread, the execution of the video special effects editing task being dependent on the detection result of the video algorithm detection task;
[0014] The task execution module is used to execute the video special effects editing task on the video frames in the current video clip on the second thread based on the current detection result and the target editing parameter information.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] a storage device for storing one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the video special effects editing method described in any embodiment of the present disclosure.
[0019] In a fourth aspect, a storage medium comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute the video special effects editing method described in any embodiment of the present disclosure.
[0020] The technical solution of the embodiment of the present disclosure includes: determining the current video clip; obtaining target editing parameter information used to perform a video special effects editing task on the video frames in the current video clip; determining the current detection result corresponding to the current video clip; and performing the video special effects editing task on the video frames in the current video clip on a second thread based on the current detection result and the target editing parameter information. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0022] FIG1 is a flow chart of a method for editing video special effects according to an embodiment of the present disclosure;
[0023] FIG2 is a schematic diagram of a process for determining a current detection result provided by an embodiment of the present disclosure;
[0024] FIG3 is a schematic structural diagram of a video special effects editing device provided by an embodiment of the present disclosure;
[0025] FIG4 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0028] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0029] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0033] During the video special effects editing process, video special effects editing parameters can usually be used to edit the video. Since video special effects editing parameters are often adjusted during video special effects editing and then the video is frequently played repeatedly to debug the video special effects editing effect, some video algorithm detection tasks that the video special effects editing tasks rely on need to be repeated each time the video is played repeatedly for debugging, resulting in a waste of computing resources and reduced editing efficiency. In particular, when processing high-definition video or complex special effects, the video algorithm detection task is computationally intensive, and repeated execution can lead to performance degradation, causing the video special effects editing to freeze or lag.
[0034] Figure 1 is a flow chart of a video special effects editing method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation where video special effects editing parameters are adjusted during the video special effects editing process, and then the video is repeatedly played to debug the video special effects editing effect. The method can be executed by a video special effects editing device, and the video special effects editing device can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0035] As shown in FIG1 , the video special effects editing method of this embodiment includes:
[0036] S110: Determine the current video segment.
[0037] This application is to observe the effect of video special effects editing by playing the video after editing. In this process, a video algorithm detection task needs to be performed. In the prior art, the video algorithm detection task needs to be performed multiple times (for example, the user needs to perform the video algorithm detection task multiple times during the process of playing the video multiple times to debug the video special effects editing effect). However, this application does not need to repeatedly perform the video algorithm detection task, but only needs to determine the current detection result corresponding to the current video clip. For example, the target object in the video is edited and rendered on the screen through video editing software. During the process of the user's operation to add special effects, the background will perform the video algorithm detection task on the target object in another process (for example, locate the target object) to obtain the current detection result corresponding to the edited video. Therefore, when the user debugs by playing the video, there is no need to perform the video algorithm detection task again. Instead, it only needs to call the current detection result for debugging, thereby minimizing performance waste as much as possible.
[0038] Specifically, determining the current video segment includes: in response to a first editing operation on the current video material, forming a current video segment including a plurality of video frames from the current video material and placing the current video segment on a video special effects editing track for presentation.
[0039] S120: Obtain target editing parameter information for performing a video special effects editing task on video frames in the current video clip.
[0040] Among them, the video special effects editing task can be a task of adding user requirements to video frames in a video, and the corresponding video special effects editing task corresponds to corresponding target editing parameter information.
[0041] Specifically, in response to the second editing operation on the current video clip, the video special effects editing parameter configuration interface corresponding to the current video clip is presented; in response to the third editing operation on the video special effects editing parameter configuration interface, the target editing parameter information used for the video special effects editing task on the video frames in the current video clip is obtained. The third editing operation is used to configure and / or adjust the video special effects editing parameter values on the video special effects editing parameter configuration interface for at least one video frame in the current video clip.
[0042] The second editing operation is a selection operation for the current video clip presented on the video special effects editing track, or the second editing operation is a selection operation for the video content corresponding to the current video clip presented in the video preview area.
[0043] S130: Determine a current detection result corresponding to the current video segment.
[0044] Among them, the current detection result is obtained by executing the video algorithm detection task on the video frames in the current video clip in advance on the first thread. The execution of the video special effects editing task depends on the detection result of the video algorithm detection task. The video special effects editing task is executed in the second thread. Distributing the video special effects editing task and the video algorithm detection task in the two threads can effectively realize the division of resources, thereby avoiding causing freezes or delays in video special effects editing.
[0045] To prevent the use of the first thread to obtain the current test result from affecting the user's current operation, the process of obtaining the current test result must follow the following rules:
[0046] When the video special effects editing task is not executed on the video frame in the current video clip, the video algorithm detection task is executed on the current video frame in the current video clip on the first thread to obtain the current detection result, and when it is detected that the video special effects editing task starts to be executed on the video frame in the current video clip, the execution of the video algorithm detection task on the video frame in the current video clip on the first thread is paused.
[0047] Specifically, in order to avoid having to repeatedly execute the video algorithm detection task when executing the video special effects editing task, the present application pre-executes the video algorithm detection task in the first thread to obtain the corresponding detection results, and saves the detection results in the memory and / or disk, so that when debugging the corresponding video clips later, there is no need to execute the video algorithm detection task again, and only the corresponding detection results need to be extracted.
[0048] Optionally, the current detection result corresponding to the current video clip needs to be stored for use in subsequent video special effects editing tasks. The specific storage method is as follows:
[0049] Storing the current detection results of at least some of the video frames in the current video clip in the target memory for use when performing a video special effects editing task on the video frames in the current video clip; the target memory is a temporary storage and occupies relatively few resources, and directly obtaining the current detection results from the target memory is faster and more convenient;
[0050] The current detection results for all video frames in the current video clip are stored on the target disk, which is then gradually updated and written to the target memory. The target disk is permanent storage, and as long as the disk is not damaged or the corresponding stored content is not deleted, the information stored on the target disk will not be lost due to external factors such as computer power outages.
[0051] In one feasible embodiment, optionally, FIG2 is a schematic diagram of a process for determining a current detection result provided by an embodiment of the present disclosure. The present application determines the current detection result corresponding to the current video clip, including the following situations, namely steps A1-A3:
[0052] Step A1: If it is detected that the current detection result of the video frame in the current video clip exists in the target memory, the current detection result corresponding to the video frame in the current video clip is directly read from the target memory for performing the video special effects editing task on the current video clip on the second thread;
[0053] Specifically, if it is detected that the current detection result of the video frame in the current video clip exists in the target memory, then for each video frame included in the current video clip, the first identification information and the second identification information corresponding to the video frame in the current video clip are determined, and according to the first identification information and the second identification information, the current detection result matching each video frame in the current video clip is read from the target memory.
[0054] Among them, the first identification information includes the name of the current video clip, the path of the current video clip and the last modification time of the current video clip, and the second identification information includes the display timestamp of the video frame in the current video clip on the current video clip to which it belongs; using the first identification information and the second identification information to distinguish each video frame in the video clip can avoid confusion when extracting the current detection result matching the current video frame, thereby achieving effective planning of the video frames.
[0055] Step A2: If it is detected that the current detection result of the video frame in the current video clip does not exist in the target memory but the current detection result of the video frame in the current video clip exists in the target disk, the current detection result corresponding to the video frame in the current video clip is asynchronously read from the target disk for executing the video special effects editing task on the current video clip on the second thread.
[0056] Step A3: If it is detected that the current detection results of the video frames in the current video clip do not exist in the target memory and the target disk, the video algorithm detection task is performed on the video frames in the current video clip on the second thread to obtain real-time detection results; further, based on the real-time detection results and the target editing parameter information, the video special effects editing task is performed on the video frames in the current video clip on the second thread.
[0057] The technical solution of the present application first determines whether the current detection results of the video frames in the current video clip exist in the target memory and the target disk. If the current detection results of the video frames in the current video clip exist in the target memory and the target disk, the current detection results are directly used to execute the video special effects editing task. If the current detection results of the video frames in the current video clip do not exist in both the target memory and the target disk, the video algorithm detection task is executed in real time in the second thread to obtain the real-time detection results, so as to execute the video special effects editing task using the real-time detection results. In this way, there is no need to repeatedly execute the video algorithm detection task, which effectively reduces the computational complexity of the video algorithm detection task and avoids performance degradation. At the same time, even if the video frame jumps too large during the previous and subsequent operations (for example, suddenly adjusting from 2 frames to 50 frames), there will be no video special effects editing freeze or delay, because the present application will adopt the above three forms for smooth switching, while the existing technology performs the video algorithm detection task in real time. The video algorithm detection task needs to use the data of the previous video frame, but the large video frame adjustment causes the real-time video algorithm detection task to be unable to be executed quickly and effectively, resulting in performance degradation and video special effects editing freeze or delay.
[0058] S140 . Based on the current detection result and the target editing parameter information, perform a video special effects editing task on the video frames in the current video clip on the second thread.
[0059] Specifically, on the second thread, the current detection results are used to perform operations such as positioning on the video frame, and then the corresponding target editing parameter information is matched on the corresponding video frame, so as to perform video special effects editing tasks on the video frames in the current video clip on the second thread, and render the results on the display interface to view the corresponding effects.
[0060] Optionally, when performing the video special effects editing task on the video frame in the current video clip on the second thread, the process further includes:
[0061] If it is detected that the target disk contains the next detection result corresponding to the next video clip after the current video clip, then it is detected whether the target memory contains the next detection result corresponding to the next video clip, and the next detection result is obtained by executing the video algorithm detection task on the video frames in the next video clip on the first thread in advance; if it exists, the video special effects editing task can be directly executed on the video frames in the next video clip on the second thread; if it does not exist, the next detection result corresponding to the next video clip is read from the target disk to the target memory in advance, so as to execute the video special effects editing task on the video frames in the next video clip on the second thread; this method effectively avoids the time waiting to read the next file and greatly improves the frame rate of video playback.
[0062] Optionally, the current detection result is obtained from the target memory or the target disk, and the target memory serves as a temporary cache, that is, the corresponding current detection result is stored in the target memory from the target disk in advance or stored in the target memory when the video algorithm detection task is executed, so that the video special effects editing task can be smoothly performed. Therefore, it is necessary to monitor the target memory in real time to avoid the target memory being full and affecting the execution of the video special effects editing task and the storage of the current detection result. The method further includes steps B1-B3:
[0063] Step B1: If it is detected that the amount of data stored in the target memory is greater than the preset storage data amount, then detecting whether there is a current detection result corresponding to the current video clip in the target memory; wherein the preset storage data amount is set according to the capacity of the actual file, for example, it can be set to 30M;
[0064] Step B2: If a current detection result corresponding to the current video clip exists, deleting at least part of the reference detection results in the target memory until the amount of data stored in the target memory is no longer greater than a preset storage data amount, the reference detection results being obtained by executing the video algorithm detection task on video frames in video clips other than the current video clip in advance on the first thread;
[0065] Step B3: If there is no current detection result corresponding to the current video clip, all reference detection results in the target memory are deleted.
[0066] Optionally, for video special effects editing, the video algorithm detection task may change due to the user's editing operations. Therefore, before performing the video special effects editing task, it is necessary to first determine whether the monitoring results obtained by the video algorithm detection task corresponding to the video special effects editing task meet the current preset usage conditions. This can ensure the accuracy of the current detection results obtained, as follows:
[0067] detecting whether the detection results obtained by executing a video algorithm detection task on video frames in the current video clip in advance on the first thread and cached in the target memory and the target disk meet preset usage conditions for executing a video special effects editing task on the current video clip on the second thread;
[0068] If the preset usage conditions for performing video special effects editing tasks on the current video clip on the second thread are met, it is detected whether the current detection results of the video frames in the current video clip exist in the target memory or target disk. For example, the flowchart shown in Figure 2 can be used to make this determination.
[0069] The technical solution of the disclosed embodiment includes: determining the current video clip; obtaining target editing parameter information used for performing a video special effects editing task on the video frames in the current video clip; determining the current detection result corresponding to the current video clip; and performing a video special effects editing task on the video frames in the current video clip on the second thread based on the current detection result and the target editing parameter information. The present application pre-executes a video algorithm detection task on the video frames in the current video clip on the first thread to obtain the current detection result, so that when performing a video special effects editing task on the current video clip on the second thread, there is no need to repeatedly execute the video algorithm detection task, which solves the problem of performance degradation caused by repeatedly executing the video algorithm detection task when repeatedly playing a video for debugging, improves the frame rate of video playback, achieves stability in the effect of the video algorithm detection task, and greatly avoids freezes or delays in video special effects editing.
[0070] Figure 3 is a structural schematic diagram of a video special effects editing device provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to situations where video special effects editing parameters are adjusted during the video special effects editing process, and then the video is repeatedly played to debug the video special effects editing effect. The video special effects editing device can be implemented in the form of software and / or hardware, and optionally, can be implemented by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0071] As shown in FIG. 3 , the video special effects editing device includes: a video segment determination module 210 , an information acquisition module 220 , a detection result determination module 230 , and a task execution module 240 .
[0072] A video segment determination module 210 is configured to determine a current video segment;
[0073] The information acquisition module 220 is used to obtain target editing parameter information used for performing a video special effects editing task on a video frame in a current video clip;
[0074] a detection result determination module 230 configured to determine a current detection result corresponding to the current video segment, the current detection result being obtained by pre-executing a video algorithm detection task on video frames in the current video segment on a first thread, the execution of the video special effects editing task being dependent on the detection result of the video algorithm detection task;
[0075] The task execution module 240 is configured to execute a video special effects editing task on the video frames in the current video segment on the second thread based on the current detection result and the target editing parameter information.
[0076] Optionally, the video segment determination module is configured to:
[0077] In response to a first editing operation on the current video material, the current video material is formed into a current video segment including a plurality of video frames and is placed on a video special effect editing track for presentation.
[0078] Optional information acquisition module, used to:
[0079] In response to a second editing operation on the current video clip, presenting a video special effect editing parameter configuration interface corresponding to the current video clip;
[0080] In response to the third editing operation on the video special effects editing parameter configuration interface, the target editing parameter information used for performing the video special effects editing task on the video frames in the current video clip is obtained. The third editing operation is used to configure and / or adjust the video special effects editing parameter values on the video special effects editing parameter configuration interface for at least one video frame in the current video clip.
[0081] Wherein, the second editing operation is a selection operation on the current video clip presented on the video special effects editing track; or,
[0082] The second editing operation is an operation of selecting the video content corresponding to the current video clip presented in the video preview area.
[0083] Optionally, the detection result determination module includes:
[0084] a first detection unit configured to, if detecting that a current detection result of a video frame in a current video clip exists in a target memory, directly read the current detection result corresponding to the video frame in the current video clip from the target memory for performing a video special effects editing task on the current video clip on a second thread;
[0085] The second detection unit is used to asynchronously read the current detection result corresponding to the video frame in the current video clip from the target disk for executing the video special effects editing task on the current video clip on the second thread if it is detected that the current detection result of the video frame in the current video clip does not exist in the target memory but the current detection result of the video frame in the current video clip exists in the target disk.
[0086] Optionally, the first detection unit includes a reading unit configured to:
[0087] For each video frame included in the current video segment, determining first identification information and second identification information corresponding to the video frame in the current video segment, where the first identification information includes a name of the current video segment, a path of the current video segment, and a last modification time of the current video segment, and the second identification information includes a display timestamp of the video frame in the current video segment on the current video segment to which it belongs;
[0088] According to the first identification information and the second identification information, a current detection result of each video frame matching in the current video segment is read from the target memory.
[0089] Optionally, the detection result determination module further includes a first detection unit, configured to:
[0090] When the video special effects editing task is not executed on the video frame in the current video clip, executing the video algorithm detection task on the current video frame in the current video clip on the first thread to obtain a current detection result;
[0091] Furthermore, when it is detected that the video special effects editing task starts to be executed on the video frames in the current video clip, the execution of the video algorithm detection task on the video frames in the current video clip on the first thread is paused.
[0092] Optionally, the detection result determination module further includes a storage unit, configured to:
[0093] storing the current detection results of at least part of the video frames corresponding to the current video clip in the target memory for directly reading the current detection results of the video frames from the target memory for use when performing a video special effects editing task on the video frames in the current video clip;
[0094] The current detection results of all video frames in the current video segment are stored in the target disk, so as to gradually update and write the current detection results of each video frame stored in the target disk from the target disk to the target memory.
[0095] Optionally, the detection result determination module further includes a second detection unit, configured to:
[0096] If it is detected that the amount of data stored in the target memory is greater than the preset storage data amount, detecting whether there is a current detection result corresponding to the current video clip in the target memory;
[0097] If a current detection result corresponding to the current video clip exists, deleting at least part of the reference detection results in the target memory until the amount of data stored in the target memory is no longer greater than a preset storage amount of data, the reference detection results being obtained by executing a video algorithm detection task on video frames in video clips other than the current video clip in advance on the first thread;
[0098] If there is no current detection result corresponding to the current video clip, all reference detection results in the target memory are deleted.
[0099] Optionally, the detection result determination module further includes a third detection unit, configured to:
[0100] If it is detected that the current detection result of the video frame in the current video clip does not exist in the target memory and the target disk, then the video algorithm detection task is executed on the video frame in the current video clip on the second thread to obtain a real-time detection result;
[0101] Based on the real-time detection result and the target editing parameter information, a video special effects editing task is performed on the video frames in the current video clip on the second thread.
[0102] Optionally, the detection result determination module further includes a fourth detection unit, configured to:
[0103] detecting whether the detection results obtained by executing a video algorithm detection task on video frames in the current video clip in advance on the first thread and cached in the target memory and the target disk meet preset usage conditions for executing a video special effects editing task on the current video clip on the second thread;
[0104] If the preset usage condition for executing the video special effects editing task on the current video clip on the second thread is met, it is detected whether there is a current detection result of the video frame in the current video clip in the target memory or the target disk.
[0105] Optionally, the task execution module is also used to:
[0106] If it is detected that the target disk contains a next detection result corresponding to the next video segment after the current video segment, then detecting whether the target memory contains a next detection result corresponding to the next video segment, wherein the next detection result is obtained by executing a video algorithm detection task on the video frames in the next video segment in advance on the first thread;
[0107] If not, the next detection result corresponding to the next video segment is read from the target disk into the target memory in advance, so as to perform the video special effects editing task on the video frames in the next video segment on the second thread.
[0108] The video special effects editing device provided by the embodiments of the present disclosure can execute the video special effects editing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0109] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0110] FIG4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Referring to FIG4 , a schematic diagram of the structure of an electronic device (such as a terminal device or server in FIG4 ) 500 suitable for implementing an embodiment of the present disclosure is shown below. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG4 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0111] As shown in FIG4 , the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0112] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG4 shows the electronic device 500 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0113] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-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 the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0114] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0115] The electronic device provided by the embodiment of the present disclosure and the video special effects editing method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0116] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the video special effects editing method provided in the above embodiment is implemented.
[0117] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, 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. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal 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 that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0118] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0119] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0120] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: determines the current video clip; obtains the target editing parameter information used for performing the video special effects editing task on the video frames in the current video clip; determines the current detection result corresponding to the current video clip, and the current detection result is obtained by performing the video algorithm detection task on the video frames in the current video clip in advance on the first thread, and the execution of the video special effects editing task depends on the detection result of the video algorithm detection task; based on the current detection result and the target editing parameter information, performs the video special effects editing task on the video frames in the current video clip on the second thread.
[0121] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of 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 than that 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 system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0123] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0124] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0125] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, 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 foregoing.
[0126] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0127] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0128] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video special effect editing method, comprising: Determining a current video segment; Obtaining target editing parameter information for performing a video special effect editing task on video frames in the current video segment; Determining a current detection result corresponding to the current video segment, where the current detection result is obtained by performing a video algorithm detection task on video frames in the current video segment on a first thread in advance, and the execution of the video special effect editing task depends on the detection result of the video algorithm detection task; Based on the current detection result and the target editing parameter information, performing a video special effect editing task on video frames in the current video segment on a second thread.
2. The method according to claim 1, wherein determining a current video segment comprises: In response to a first editing operation on a current video material, forming the current video material into a current video segment including a plurality of video frames and presenting it on a video special effect editing track.
3. The method according to claim 1, wherein obtaining target editing parameter information for performing a video special effect editing task on the current video segment comprises: In response to a second editing operation on the current video segment, presenting a video special effect editing parameter configuration interface corresponding to the current video segment; In response to a third editing operation on the video special effect editing parameter configuration interface, obtaining target editing parameter information for performing a video special effect editing task on video frames in the current video segment, where the third editing operation is used to configure and / or adjust the values of video special effect editing parameters for at least one video frame in the current video segment on the video special effect editing parameter configuration interface.
4. The method according to claim 3, wherein the second editing operation is a selection operation on the current video segment presented on the video special effect editing track; or, The second editing operation is a selection operation on the video content corresponding to the current video segment presented in the video preview area.
5. The method according to claim 1, wherein determining the current detection result corresponding to the current video segment comprises: If it is detected that the current detection result of the video frames in the current video segment exists in the target memory, directly reading the current detection result corresponding to the video frames in the current video segment from the target memory for performing a video special effect editing task on the current video segment on the second thread; If it is detected that the current detection result of the video frames in the current video segment does not exist in the target memory but exists in the target disk, asynchronously reading the current detection result corresponding to the video frames in the current video segment from the target disk for performing a video special effect editing task on the current video segment on the second thread.
6. The method according to claim 5, wherein reading the current detection result corresponding to the video frames in the current video segment from the target memory comprises: For each video frame included in the current video segment, determine the first identification information and the second identification information corresponding to the video frame in the current video segment, where the first identification information includes the name of the current video segment, the path of the current video segment, and the last modification time of the current video segment, and the second identification information includes the display timestamp of the video frame in the current video segment on the current video segment to which it belongs; According to the first identification information and the second identification information, read the current detection result matching each video frame in the current video segment from the target memory.
7. The method according to claim 1 or 5, wherein before determining the current detection result corresponding to the current video segment, further comprising: When no video effect editing task is performed on the video frames in the current video segment, perform a video algorithm detection task on the current video frame in the current video segment on the first thread to obtain a current detection result; And when it is detected that a video effect editing task starts to be performed on the video frames in the current video segment, pause performing the video algorithm detection task on the video frames in the current video segment on the first thread.
8. The method according to claim 1 or 5, wherein before determining the current detection result corresponding to the current video segment, further comprising: Store the current detection results of at least some video frames corresponding to the current video segment in the target memory for directly reading and using the current detection results of the video frames from the target memory when performing a video effect editing task on the video frames in the current video segment; Store the current detection results of all video frames in the current video segment on the target disk for gradually updating and writing the current detection results of each video frame stored on the target disk to the target memory from the target disk.
9. The method according to claim 5, wherein the method further comprises: If it is detected that the amount of data already stored in the target memory is greater than the preset storage data amount, detect whether there is a current detection result corresponding to the current video segment in the target memory; If there is a current detection result corresponding to the current video segment, delete at least some of the reference detection results in the target memory until the amount of data already stored in the target memory is no longer greater than the preset storage data amount, where the reference detection results are obtained by performing a video algorithm detection task on the video frames in other video segments except the current video segment on the first thread in advance; If there is no current detection result corresponding to the current video segment, delete all the reference detection results in the target memory.
10. The method according to claim 5, wherein the method further comprises: If it is detected that there is no current detection result of the video frames in the current video segment in both the target memory and the target disk, perform a video algorithm detection task on the video frames in the current video segment on the second thread to obtain a real-time detection result; Based on the real-time detection result and the target editing parameter information, perform a video effect editing task on the video frames in the current video segment on the second thread.
11. The method according to claim 5, wherein the method further comprises: Detect whether the detection result obtained by previously performing a video algorithm detection task on video frames in the current video segment on the first thread and cached in the target memory and the target disk meets the preset usage conditions that can be used to perform a video special effect editing task on the current video segment on the second thread; If it meets the preset usage conditions that can be used to perform a video special effect editing task on the current video segment on the second thread, then detect whether the current detection result of the video frames in the current video segment exists in the target memory or the target disk.
12. The method according to claim 1, wherein when performing a video special effect editing task on video frames in the current video segment on the second thread, it further includes: If it is detected that the next detection result corresponding to the next video segment after the current video segment exists in the target disk, then detect whether the next detection result corresponding to the next video segment exists in the target memory, where the next detection result is obtained by previously performing a video algorithm detection task on video frames in the next video segment on the first thread; If not, read in advance the next detection result corresponding to the next video segment from the target disk into the target memory for use in performing a video special effect editing task on video frames in the next video segment on the second thread.
13. A video special effect editing device, comprising: A video segment determination module, configured to determine the current video segment; An information acquisition module, configured to acquire target editing parameter information for performing a video special effect editing task on video frames in the current video segment; A detection result determination module, configured to determine the current detection result corresponding to the current video segment, where the current detection result is obtained by previously performing a video algorithm detection task on video frames in the current video segment on the first thread, and the execution of the video special effect editing task depends on the detection result of the video algorithm detection task; A task execution module, configured to perform a video special effect editing task on video frames in the current video segment on the second thread based on the current detection result and the target editing parameter information.
14. An electronic device, comprising: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the video special effect editing method according to any one of claims 1-12.
15. A storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute the video special effect editing method according to any one of claims 1-12 when executed by a computer processor.
Citation Information
Patent Citations
Video editing method and device based on IOS equipment
CN104091607A
Image rendering method, device and system and computer readable storage medium
CN114556408A
Video special effect editing method and device, electronic equipment and storage medium
CN117939241A
Video editing device, video editing method, program, and medium in which the program is recorded
US20120275768A1
Video processing method and apparatus, electronic device, and readable storage medium
WO2023083064A1