Video rendering method and device, equipment and storage medium

By coordinating the video editing thread and the special effects rendering thread, editing and rendering are performed based on the reference status of the materials, which solves the problem of lost special effects in video rendering and improves rendering effect and smoothness.

CN120856928APending Publication Date: 2025-10-28BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410509590.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

In video editing scenarios, the special effects rendering thread of image frames is inconsistent with the real-time special effects, resulting in the loss of special effects in the rendered video stream and poor rendering effect.

Method used

The video editing thread obtains special effects editing instructions, edits the material in the storage space according to the reference status, and reads and updates the material data through the special effects rendering thread to ensure the consistency of the reference status.

Benefits of technology

It resolved the issue of missing special effects footage and improved the smoothness and quality of the rendered video stream.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120856928A_ABST
    Figure CN120856928A_ABST
Patent Text Reader

Abstract

The invention discloses a video rendering method and device, equipment and a storage medium. The method comprises the steps of obtaining a special effect editing instruction through a video editing thread, and determining a to-be-edited special effect material and editing operation according to the special effect editing instruction; editing data of the to-be-edited special effect material in the storage space according to the editing operation and the reference state of the to-be-edited special effect material through a video editing thread; obtaining a special effect rendering instruction through the video editing thread, determining a video material and a to-be-rendered special effect material according to the special effect rendering instruction, and updating the reference state of the to-be-rendered special effect material; and reading the data of the to-be-rendered special effect material from the storage space through the special effect rendering thread, executing a special effect rendering operation corresponding to the special effect rendering instruction on the video material, and updating the reference state of the to-be-rendered special effect material when rendering is completed. And the video rendering effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a video rendering method, apparatus, device and storage medium. Background Technology

[0002] In video editing scenarios, special effects editing and rendering of image frames in a video are performed using two threads. When users frequently add or delete special effects for image frames, the real-time special effects read from storage by the special effects rendering thread may be inconsistent with the special effects specified for rendering, resulting in the loss of special effects in the rendered video stream and poor rendering quality. Summary of the Invention

[0003] This invention provides a video rendering method, apparatus, device, and storage medium to solve the problem of special effects loss in rendered video streams and improve video rendering effects.

[0004] In a first aspect, embodiments of the present invention provide a video rendering method, the method comprising:

[0005] The video editing thread obtains special effects editing instructions, and the special effects material to be edited and the editing operation are determined according to the special effects editing instructions;

[0006] The video editing thread edits the data of the special effects material in the storage space according to the editing operation and the reference status of the special effects material to be edited; wherein, the reference status is that it is referenced by the special effects rendering thread, not referenced by the special effects rendering thread, or the reference is released.

[0007] The video editing thread obtains special effects rendering instructions, determines video materials and special effects materials to be rendered based on the special effects rendering instructions, and updates the reference status of the special effects materials to be rendered.

[0008] The special effects rendering thread reads the data of the special effects material to be rendered from the storage space, performs special effects rendering operations on the video material corresponding to the special effects rendering instructions, and updates the reference status of the special effects material to be rendered when the rendering is completed.

[0009] Secondly, embodiments of the present invention also provide a video rendering apparatus, the apparatus comprising:

[0010] The module for determining special effects material to be edited is used to obtain special effects editing instructions through the video editing thread, and determine the special effects material to be edited and the editing operation based on the special effects editing instructions;

[0011] The editing module for special effects materials is used to edit the data of the special effects materials to be edited in the storage space according to the editing operation and the reference status of the special effects materials to be edited through the video editing thread; wherein, the reference status is referenced by the special effects rendering thread, not referenced by the special effects rendering thread, or the reference is released;

[0012] The module for determining special effects materials to be rendered is used to obtain special effects rendering instructions through the video editing thread, determine video materials and special effects materials to be rendered according to the special effects rendering instructions, and update the reference status of the special effects materials to be rendered.

[0013] The special effects rendering operation execution module is used to read the data of the special effects material to be rendered from the storage space through the special effects rendering thread, perform special effects rendering operations on the video material corresponding to the special effects rendering instructions, and update the reference status of the special effects material to be rendered when the rendering is completed.

[0014] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the video rendering method according to any embodiment of the present invention.

[0018] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions that are used to cause a processor to execute and implement the video rendering method described in any embodiment of the present invention.

[0019] The technical solution of this invention, through a video editing thread, edits the data of the special effects material to be edited in the storage space according to the editing operation and the reference state of the special effects material to be edited. This ensures that the editing operation of the video editing thread on the special effects material data in the storage space is constrained by the reference state of the special effects material. Simultaneously, the video editing thread obtains special effects rendering instructions, determines the video material and the special effects material to be rendered according to the special effects rendering instructions, and updates the reference state of the special effects material to be rendered. Through the special effects rendering thread, the data of the special effects material to be rendered is read from the storage space, and the special effects rendering operation corresponding to the special effects rendering instructions is executed on the video material. When the rendering is completed, the reference state of the special effects material to be rendered is updated. This ensures that the rendering of the special effects material is updated by both the special effects rendering instructions and the rendering of the special effects rendering thread. This solves the problem of lost special effects material in the rendered video stream, improves the smoothness of the rendered video stream, and thus ensures the video rendering effect. Attached Figure Description

[0020] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0021] Figure 1 A flowchart illustrating a video rendering method provided in one embodiment of the present invention;

[0022] Figure 2 This is a schematic diagram illustrating the updating of a smart pointer for add and delete operations, provided as an embodiment of the present invention.

[0023] Figure 3 A flowchart illustrating another video rendering method provided in one embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram illustrating a target special effects rendering request provided in one embodiment of the present invention;

[0025] Figure 5 This is a schematic diagram of the structure of a video rendering device provided in one embodiment of the present invention;

[0026] Figure 6 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0027] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.

[0028] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0029] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0030] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0031] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0032] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0033] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0034] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application program, server, or storage medium executing the operation of this invention, based on the prompt message.

[0035] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0036] It is understood that the above notification and user authorization process is merely illustrative and does not constitute a limitation on the implementation of the present invention. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present invention.

[0037] Figure 1 This is a flowchart illustrating a video rendering method according to an embodiment of the present invention. This embodiment is applicable to rendering special effects on video materials in a video editor. The method can be executed by a video rendering device, which can be implemented in hardware and / or software. This video rendering device can be configured in an electronic device, typically a mobile terminal or tablet computer. Figure 1 As shown, the method includes:

[0038] S110. Obtain special effects editing instructions through the video editing thread, and determine the special effects material to be edited and the editing operation according to the special effects editing instructions.

[0039] Specifically, the video editing thread can be used to generate special effects editing requests for special effects materials in real time. For example, special effects editing requests include, but are not limited to, special effects modification requests, special effects deletion requests, and special effects addition requests.

[0040] For example, obtaining special effects editing instructions through a video editing thread includes: in response to detecting an editing operation input by a user, adding a special effects editing request in real time in the video editing thread based on the editing operation and the special effects material to be edited corresponding to the editing operation, and generating special effects editing instructions in real time based on the special effects editing request in the video editing thread. The number of special effects material to be edited corresponding to the editing operation can be one or more.

[0041] Specifically, the special effects material to be edited represents the special effects waiting for the video editing thread to perform special effects editing, and the editing operation represents the addition, deletion or modification operation performed by the video editing thread on the special effects material to be edited.

[0042] S120. Through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, the data of the special effects material to be edited is edited in the storage space.

[0043] Specifically, the storage space contains data for at least one special effects material. The data for the special effects material includes, but is not limited to, special effects identifiers, special effects range, special effects target, and special effects color parameters. There are no restrictions on the data for the special effects material here, and the specific settings can be customized according to actual needs.

[0044] In this embodiment, the editing operation refers to a modification operation, an addition operation, or a deletion operation. The reference status of the special effects material is either referenced by the special effects rendering thread, not referenced by the special effects rendering thread, or the reference has been released. Specifically, being referenced by the special effects rendering thread indicates that the special effects material is being used by the video editing thread as video material and is currently in the rendering process where the special effects rendering thread is using the video material to perform special effects rendering. Not being referenced by the special effects rendering thread indicates that the special effects material is being used by the video editing thread as video material but is not currently in the rendering process where the special effects rendering thread is using the video material to perform special effects rendering. The reference has been released indicates that the special effects material is neither being used by the video editing thread as video material nor currently in the rendering process where the special effects rendering thread is using the video material to perform special effects rendering.

[0045] Based on the above embodiments, optionally, the reference status of special effects material also includes not being referenced by the video editing thread. Specifically, not being referenced by the video editing thread indicates that the special effects material is in the rendering process where the special effects rendering thread uses it to render special effects on video material, but it is not used as video material by the video editing thread.

[0046] In one optional embodiment, the special effects of the storage space are encapsulated using smart pointers, and the reference count of the smart pointers is used to characterize the reference status of the special effects material; when the reference count of the smart pointer is a second value, the reference status of the special effects material is that it is not referenced by the special effects rendering thread; when the reference count of the smart pointer is the sum of the first value and the second value, the reference status of the special effects material is that it is referenced by the special effects rendering thread; when the reference count of the smart pointer is zero, the reference status of the special effects material is that the reference has been released.

[0047] Specifically, a common implementation technique for smart pointers is to use reference counting. A smart pointer class associates a counter with the object the class points to. The reference count tracks how many pointers to the same object point to it. The principle behind smart pointers is that each time a new object of the class is created, the pointer is initialized and the reference count is set to a second value; when an object is created as a copy of another object, the copy constructor copies the pointer and increments the corresponding reference count, which is the first value.

[0048] Specifically, the first value represents the value corresponding to the reference of the special effects rendering thread, and the second value represents the value corresponding to the reference of the video editing thread. The first and second values ​​can be the same or different. For example, both the first and second values ​​can be 1, or the first value can be 1 and the second value can be 2. The specific parameters of the first and second values ​​are not limited here.

[0049] Based on the above embodiments, optionally, when the reference count of the smart pointer is a first value, the reference status of the special effects material is that it is not referenced by the video editing thread.

[0050] Specifically, the process of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes at least the following steps: determining the reference status of the special effects material to be edited before the editing operation, editing the data of the special effects material to be edited in the storage space according to the editing operation, and updating the reference status of the special effects material to be edited after the editing operation.

[0051] In an optional embodiment, the step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes: through the video editing thread, if the editing operation is an add operation and the reference status of the special effects material to be edited is reference released, then the data of the special effects material to be edited is added to the storage space, and the reference count of the smart pointer of the special effects material to be edited is incremented by a second value.

[0052] Specifically, in response to the add operation, the reference count of the smart pointer of the effect material to be edited is updated from zero to the second value, that is, the reference status of the effect material to be edited is updated from reference release to not being referenced by the effect rendering thread.

[0053] In another optional embodiment, the step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes: if the editing operation is a deletion operation and the reference status of the special effects material to be edited is referenced by the special effects rendering thread, then the data of the special effects material to be edited is retained in the storage space, and the reference count of the smart pointer of the special effects material to be edited is decremented by a second value; until the reference status of the special effects material to be edited is detected to be reference released, then the data of the special effects material to be edited is deleted from the storage space.

[0054] Specifically, in response to a deletion operation, if the reference status of the effect material to be edited is "referenced by the effect rendering thread," then the reference count of the smart pointer of the effect material to be edited is updated from the sum of the first and second values ​​to the first value. That is, the reference status of the effect material to be edited is updated from "referenced by the effect rendering thread" to "not referenced by the video editing thread." The process continues until the effect rendering thread finishes rendering; if the reference status of the effect material to be edited has not been referenced by the video editing thread and has been updated to "reference released" when the effect rendering thread finishes rendering, then the data of the effect material to be edited is deleted from the storage space.

[0055] Based on the above embodiments, optionally, the step of editing the data of the special effects material to be edited in the storage space through the video editing thread according to the editing operation and the reference status of the special effects material to be edited further includes: if the editing operation is a deletion operation and the reference status of the special effects material to be edited is not referenced by the special effects rendering thread, then the reference count of the smart pointer of the special effects material to be edited is decremented by a second value, and the data of the special effects material to be edited is deleted in the storage space.

[0056] Specifically, in response to a deletion operation, if the reference status of the effect material to be edited is not referenced by the effect rendering thread, the reference count of the smart pointer of the effect material to be edited is updated from the second value to zero, that is, the reference status of the effect material to be edited has been updated from never being referenced by the effect rendering thread to reference release.

[0057] S130. Obtain special effects rendering instructions through the video editing thread, determine video material and special effects material to be rendered according to the special effects rendering instructions, and update the reference status of the special effects material to be rendered.

[0058] Specifically, the video editing thread is also used to generate special effects rendering requests in real time. In response to the detection of rendering operations for video materials, special effects rendering requests are added in real time in the video editing thread based on the special effects materials and video materials stored in the storage space, and special effects rendering instructions are generated based on at least one special effects rendering request in the video editing thread.

[0059] The rendering operation can be user input or generated by the client according to a preset rendering strategy. For example, the preset rendering strategy includes, but is not limited to, a preset rendering cycle, detecting that the number of times a specified editing operation or special effects material has been edited has reached a preset threshold, etc. The preset rendering strategy is not limited here, and can be customized according to actual needs.

[0060] Specifically, the special effects material to be rendered is used to represent the special effects material stored in the storage space loaded in the special effects rendering request in response to the rendering operation.

[0061] In an optional embodiment, the step of determining the video material and the special effects material to be rendered according to the special effects rendering instructions, and updating the reference status of the special effects material to be rendered, includes: determining the video material and the special effects material to be rendered according to the special effects rendering instructions, and adding a first value to the reference count of the smart pointer of the special effects material to be rendered.

[0062] Specifically, in response to the special effects rendering command, the reference count of the smart pointer of the special effects material to be rendered is updated from the second value to the sum of the first and second values, that is, the reference state of the special effects material to be rendered has been updated from never being referenced by the special effects rendering thread to being referenced by the special effects rendering thread.

[0063] S140. Through the special effects rendering thread, read the data of the special effects material to be rendered from the storage space, perform special effects rendering operation on the video material corresponding to the special effects rendering instruction, and update the reference status of the special effects material to be rendered when the rendering is completed.

[0064] Based on the above embodiments, optionally, updating the reference status of the special effects material to be rendered when rendering is completed includes: decrementing the reference count of the smart pointer of the special effects material to be rendered by a first value when rendering is completed.

[0065] Specifically, when rendering is complete, the reference count of the smart pointer of the special effects material to be rendered is updated from the sum of the first and second values ​​to the second value, that is, the reference status of the special effects material to be rendered is updated from being referenced by the special effects rendering thread to not being referenced by the special effects rendering thread.

[0066] Figure 2 This is a schematic diagram illustrating the updating of a smart pointer for add and delete operations, as provided in one embodiment of the present invention. Figure 2 Taking an example where the first and second values ​​are 1 and 2 respectively. Specifically, in response to the effect addition instruction for effect A in the video editing thread, the reference count of the smart pointer for effect A is incremented by 2, i.e., effect A ref = 2. In response to the effect addition instruction for effect B in the video editing thread, the reference count of the smart pointer for effect B is incremented by 2, i.e., effect B ref = 2. In response to the effect rendering instruction generated in response to the effect rendering request in the video editing thread, the reference counts of the smart pointers for effect A and effect B are incremented by 1 respectively, i.e., effect A ref = 3 and effect B ref = 3.

[0067] In response to the effect deletion command for effect A in the video editing thread, the data for effect A is retained in storage, and the reference count of the smart pointer for effect A is decremented by 2, i.e., effect A ref = 1. After rendering for the effect rendering command is completed, the reference counts of the smart pointers for effect A and effect B are decremented by 1 respectively, i.e., effect A ref = 0 and effect B ref = 2. Since effect A ref = 0, meaning the reference state of effect A is released, the data for effect A is deleted from storage.

[0068] The technical solution of this embodiment, through a video editing thread, edits the data of the special effects material to be edited in the storage space according to the editing operation and the reference state of the special effects material to be edited. This makes the editing operation of the special effects material data in the storage space by the video editing thread constrained by the reference state of the special effects material. At the same time, the video editing thread obtains special effects rendering instructions, determines the video material and the special effects material to be rendered according to the special effects rendering instructions, and updates the reference state of the special effects material to be rendered. Through the special effects rendering thread, the data of the special effects material to be rendered is read from the storage space, and the special effects rendering operation corresponding to the special effects rendering instructions is executed on the video material. When the rendering is completed, the reference state of the special effects material to be rendered is updated. This ensures that the reference state of the special effects material is updated upon completion of both the special effects rendering instructions and the rendering of the special effects rendering thread. This solves the problem of lost special effects material in the rendered video stream, improves the smoothness of the rendered video stream, and thus ensures the video rendering effect.

[0069] Figure 3 This is a flowchart illustrating another video rendering method provided in one embodiment of the present invention. This embodiment further refines the "obtaining special effects rendering instructions through the video editing thread" step in the above embodiment. For example... Figure 3 As shown, the method includes:

[0070] S210. Obtain special effects editing instructions through the video editing thread, and determine the special effects material to be edited and the editing operation according to the special effects editing instructions.

[0071] S220. Through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, the data of the special effects material to be edited is edited in the storage space.

[0072] In an optional embodiment, S210-S220 are the same as those in the above embodiments. Figure 1 The S110-S120 shown are the same or similar.

[0073] In another optional embodiment, the step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes: if the editing operation is a modification operation and the reference status of the special effects material to be edited is referenced by the special effects rendering thread, then the smart pointer reference count of the special effects material to be edited is maintained, and the data of the special effects material to be edited is modified in the storage space.

[0074] Specifically, in response to the modification operation, the reference count of the smart pointer of the special effect material to be edited is maintained, that is, the reference state of the special effect material to be edited is maintained as being referenced by the special effect rendering thread, and the data of the special effect material to be edited is modified in the storage space.

[0075] In one embodiment, if the reference status of the special effects material to be edited is referenced by the special effects rendering thread, then during the execution of the special effects rendering process, the data of the special effects material to be rendered read from the storage space by the special effects rendering thread is initially the data before the modification operation is detected. After the modification operation in the video editing thread, the data of the special effects material to be rendered read from the storage space by the special effects rendering thread is the modified data of the special effects material to be rendered.

[0076] The advantage of this setup is that during the special effects rendering process, the data of the special effects material to be rendered that the special effects rendering thread reads from the storage space is inconsistent before and after, which has little impact on the smoothness of the rendered video stream. Thus, while ensuring the smoothness of the rendered video stream as much as possible, it also ensures that the modification operations of the special effects material take effect in real time.

[0077] In another optional embodiment, the step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes: if the editing operation is a modification operation and the reference status of the special effects material to be edited is referenced by the special effects rendering thread, then the data of the special effects material to be edited is retained in the storage space, and the data of a copied special effects material corresponding to the data of the special effects material to be edited is added to the storage space; the reference count of the smart pointer of the special effects material to be edited is decremented by a second value until the reference status of the special effects material to be edited is detected to be reference released, then the data of the special effects material to be edited is deleted from the storage space; the reference count of the smart pointer of the copied special effects material is incremented by a second value, and the data of the copied special effects material is modified in the storage space.

[0078] Specifically, in response to a modification operation, if the reference status of the effect material to be edited is "referenced by the effect rendering thread," then the reference count of the smart pointer of the effect material to be edited is updated from the sum of the first and second values ​​to the first value. That is, the reference status of the effect material to be edited is updated from "referenced by the effect rendering thread" to "not referenced by the video editing thread." The update waits for the reference status to complete when the effect rendering thread finishes rendering. That is, if the reference status of the effect material to be edited has not been referenced by the video editing thread and has been updated to "reference released" when the effect rendering thread finishes rendering, then the data of the effect material to be edited is deleted from the storage space.

[0079] Specifically, the reference count of the smart pointer that copies the special effects material is updated from zero to the second value, meaning that the reference status of the copy is updated from "reference released" to "not referenced by the special effects rendering thread".

[0080] The advantage of this setup is that, during the special effects rendering process, the data of the special effects material to be rendered read from the storage space by the special effects rendering thread remains consistent, further improving the smoothness of the rendered video stream.

[0081] Based on the above embodiments, optionally, the step of editing the data of the special effects material to be edited in the storage space through the video editing thread according to the editing operation and the reference status of the special effects material to be edited further includes: if the editing operation is a modification operation and the reference status of the special effects material to be edited is not referenced by the special effects rendering thread, then maintaining the reference count of the smart pointer of the special effects material to be edited, and modifying the data of the special effects material to be edited in the storage space.

[0082] S230: Obtain at least one pending effects rendering request for the video material through the video editing thread.

[0083] Specifically, since the video editing thread and the special effects rendering thread are two asynchronous threads, while the special effects rendering thread is executing the special effects rendering process corresponding to the current special effects rendering request, the video editing thread may add at least one special effects rendering request to be executed. The special effects rendering request to be executed represents a special effects rendering request waiting for the special effects rendering thread to perform special effects rendering operations and provide feedback on the rendered video.

[0084] For example, for each effect rendering request to be executed, in response to the detection of a rendering operation, at least one effect material corresponding to the video material stored in the storage space is used as the effect material to be rendered. Based on the video material and each effect material to be rendered, the effect rendering request to be executed is added in real time in the video editing thread.

[0085] S240. When the previous rendering of the video material is completed, obtain the target special effects rendering request according to the request order corresponding to each of the special effects rendering requests to be executed.

[0086] Specifically, the request order is used to characterize the order in which each pending special effects rendering request is added in the video editing thread according to the generation time sequence, and the target special effects rendering request is used to characterize the pending special effects rendering request with the earliest generation time sequence in the request order.

[0087] For example, suppose a video editing thread contains effect rendering requests A, B, and C arranged in chronological order of their generation, then the target effect rendering request is effect rendering request A.

[0088] S250. Generate special effects rendering instructions based on the video material and the special effects material to be rendered in the target special effects rendering request.

[0089] Figure 4 This is a schematic diagram of a target special effects rendering request provided in one embodiment of the present invention. Figure 4 The video editing thread contains three pending effects rendering requests: Render 1, Render 2, and Render 3. Render 1 is the target effects rendering request. Specifically, the effects to be rendered corresponding to Render 1 include Effect A and Effect B; the effects to be rendered corresponding to Render 2 include Effect B; and the effects to be rendered corresponding to Render 3 include Effect B and Effect C.

[0090] S260. Determine the video material and the special effects material to be rendered according to the special effects rendering instructions, and update the reference status of the special effects material to be rendered.

[0091] S270. Through the special effects rendering thread, read the data of the special effects material to be rendered from the storage space, perform special effects rendering operation on the video material corresponding to the special effects rendering instruction, and update the reference status of the special effects material to be rendered when the rendering is completed.

[0092] S260-S270 in this embodiment are the same as those in the above embodiments. Figure 1 The S130-S140 shown are the same or similar, and will not be described again in this embodiment.

[0093] If the special effects rendering instruction is generated in real-time in response to a special effects rendering request, and the next special effects rendering request is generated during the execution of the special effects rendering process corresponding to the current special effects rendering request on the special effects rendering thread. Figure 4For example, during the special effects rendering process corresponding to Render 1 in the special effects rendering thread, in response to the deletion operation of special effects A in the video editing thread, the reference count of the smart pointer of special effects A is decremented by 2, i.e., special effects A ref = 1. In response to Render 2 in the video editing thread, special effects rendering instructions corresponding to Render 2 are generated in real time, and the reference count of the smart pointer of special effects A is incremented by 1, i.e., special effects A ref = 2. When the special effects rendering thread completes the special effects rendering corresponding to Render 1, the reference count of the smart pointer of special effects A is decremented by 1, i.e., special effects A ref = 1. Obviously, the special effects rendering instructions generated in real time according to Render 2 cause special effects A not to be deleted from the storage space as expected, resulting in chaotic rendering effects.

[0094] The technical solution of this embodiment obtains at least one pending special effects rendering request for video material through a video editing thread. When the previous rendering corresponding to the video material is completed, a target special effects rendering request is obtained according to the request order corresponding to each pending special effects rendering request. Based on the video material and the special effects material to be rendered in the target special effects rendering request, a special effects rendering instruction is generated. This solves the problem of chaotic rendering of video stream, thereby further improving the smoothness of the rendering video stream and further ensuring the video rendering effect.

[0095] The following are embodiments of the video rendering apparatus provided in this invention. This apparatus and the video rendering method described above belong to the same inventive concept. For details not described in detail in the embodiments of the video rendering apparatus, please refer to the content about the video rendering method in the above embodiments.

[0096] Figure 5 This is a schematic diagram of the structure of a video rendering apparatus provided in one embodiment of the present invention. Figure 5 As shown, the device includes: a special effects material determination module 310, a special effects material editing module 320, a special effects material determination module 330, and a special effects rendering operation execution module 340.

[0097] Among them, the special effects material determination module 310 is used to obtain special effects editing instructions through the video editing thread, and determine the special effects material to be edited and the editing operation according to the special effects editing instructions;

[0098] The editing module 320 for special effects materials is used to edit the data of the special effects materials to be edited in the storage space according to the editing operation and the reference status of the special effects materials to be edited through the video editing thread; wherein, the reference status is that it is referenced by the special effects rendering thread, not referenced by the special effects rendering thread, or the reference is released;

[0099] The module 330 for determining special effects material to be rendered is used to obtain special effects rendering instructions through the video editing thread, determine video material and special effects material to be rendered according to the special effects rendering instructions, and update the reference status of the special effects material to be rendered.

[0100] The special effects rendering operation execution module 340 is used to read the data of the special effects material to be rendered from the storage space through the special effects rendering thread, perform special effects rendering operations on the video material corresponding to the special effects rendering instructions, and update the reference status of the special effects material to be rendered when the rendering is completed.

[0101] The technical solution of this embodiment, through a video editing thread, edits the data of the special effects material to be edited in the storage space according to the editing operation and the reference state of the special effects material to be edited. This makes the editing operation of the special effects data in the storage space by the video editing thread constrained by the reference state of the special effects material. At the same time, the video editing thread obtains special effects rendering instructions, determines the special effects material to be rendered according to the special effects rendering instructions, and updates the reference state of the special effects material to be rendered. Through the special effects rendering thread, the data of the special effects material to be rendered is read from the storage space, and the special effects rendering operation corresponding to the special effects rendering instructions is executed. When the rendering is completed, the reference state of the special effects material to be rendered is updated. This ensures that the rendering of the special effects instructions and the rendering of the special effects rendering thread will update the reference state of the special effects material upon completion. This solves the problem of special effects loss in the rendered video stream, improves the smoothness of the rendered video stream, and thus ensures the video rendering effect.

[0102] In an optional embodiment, the special effects materials in the storage space are encapsulated using smart pointers, and the special effects material determination module 330 is specifically used for:

[0103] The video material and the special effects material to be rendered are determined according to the special effects rendering instructions, and the reference count of the smart pointer of the special effects material to be rendered is incremented by a first value;

[0104] Accordingly, the special effects rendering operation execution module 340 is specifically used for:

[0105] When rendering is complete, decrement the reference count of the smart pointer of the material to be rendered by the first value;

[0106] The reference count of the smart pointer is used to characterize the reference status of the special effects material. When the reference count of the smart pointer is the second value, the reference status of the special effects material to be rendered is that it is not referenced by the special effects rendering thread. When the reference count of the smart pointer is the sum of the first value and the second value, the reference status of the special effects material to be rendered is that it is referenced by the special effects rendering thread. When the reference count of the smart pointer is zero, the reference status of the special effects material to be rendered is that the reference has been released.

[0107] In one optional embodiment, the special effects material editing module 320 includes:

[0108] The first editing effect material deletion unit is used to, through the video editing thread, if the editing operation is a deletion operation and the reference status of the editing effect material is referenced by the effect rendering thread, retain the data of the editing effect material in the storage space and decrement the reference count of the smart pointer of the editing effect material by a second value;

[0109] Once the reference status of the special effects material to be edited is detected to be "reference released", the data of the special effects material to be edited will be deleted from the storage space.

[0110] In one optional embodiment, the special effects material editing module 320 further includes:

[0111] The second editing effect material deletion unit is used to, if the editing operation is a deletion operation and the reference status of the editing effect material is not referenced by the effect rendering thread, decrement the reference count of the smart pointer of the editing effect material by a second value and delete the data of the editing effect material in the storage space.

[0112] In one optional embodiment, the special effects material editing module 320 includes:

[0113] The unit for adding special effects material to be edited is used, through the video editing thread, if the editing operation is an add operation and the reference status of the special effects material to be edited is reference released, to add the data of the special effects material to be edited to the storage space, and to add a second value to the reference count of the smart pointer of the special effects material to be edited.

[0114] In one optional embodiment, the special effects material editing module 320 includes:

[0115] The first editing unit for special effects material is used to maintain the reference count of the smart pointer of the special effects material to be edited and modify the data of the special effects material to be edited in the storage space if the editing operation is a modification operation and the reference status of the special effects material to be edited is referenced by the special effects rendering thread.

[0116] In one optional embodiment, the special effects material editing module 320 includes:

[0117] The second editing unit for special effects material is used to, through the video editing thread, if the editing operation is a modification operation and the reference status of the special effects material to be edited is referenced by the special effects rendering thread, retain the data of the special effects material to be edited in the storage space, and add the data of the copied special effects material corresponding to the data of the special effects material to be edited to the storage space.

[0118] The reference count of the smart pointer of the special effect material to be edited is reduced by a second value until the reference status of the special effect material to be edited is detected to be released. Then the data of the special effect material to be edited is deleted from the storage space.

[0119] The reference count of the smart pointer of the copied special effects material is incremented by a second value, and the data of the copied special effects material is modified in the storage space.

[0120] In one optional embodiment, the special effects material editing module 320 further includes:

[0121] The third editing unit for special effects material is used to maintain the reference count of the smart pointer of the special effects material to be edited and modify the data of the special effects material to be edited in the storage space if the editing operation is a modification operation and the reference status of the special effects material to be edited is not referenced by the special effects rendering thread.

[0122] In one optional embodiment, the special effects material editing module 320 includes:

[0123] The special effects rendering instruction generation module is used to obtain at least one special effects rendering request to be executed for video footage through the video editing thread;

[0124] When the previous rendering of the video material is completed, the target special effects rendering request is obtained according to the request order of each of the special effects rendering requests to be executed;

[0125] Based on the video footage and the special effects footage to be rendered in the target special effects rendering request, generate special effects rendering instructions.

[0126] The video rendering apparatus provided in the embodiments of the present invention can execute the video rendering method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0127] The following is for reference. Figure 6The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 400 suitable for implementing embodiments of the present invention. The terminal device in the embodiments of the present invention may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0128] like Figure 6 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 406 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0129] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 406 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0130] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 409, or installed from a storage device 406, or installed from a ROM 402. When the computer program is executed by the processing device 401, it performs the functions defined in the methods of the embodiments of the present invention.

[0131] It should be noted that the computer-readable medium described above in this invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0132] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0133] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0134] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire at least two Internet Protocol (IP) addresses; send a node evaluation request including the at least two IP addresses to a node evaluation device, wherein the node evaluation device selects an IP address from the at least two IP addresses and returns it; and receive the IP address returned by the node evaluation device; wherein the acquired IP address indicates an edge node in a content delivery network.

[0135] Alternatively, the aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receive a node evaluation request including at least two Internet Protocol (IP) addresses; select an IP address from the at least two IP addresses; and return the selected IP address; wherein the received IP address indicates an edge node in the content delivery network.

[0136] Computer program code for performing the operations of this invention can 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, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0138] The units described in the embodiments of the present invention can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0139] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0140] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0141] According to one or more embodiments of the present invention, Example 1 provides a video rendering method, including:

[0142] The video editing thread obtains special effects editing instructions, and the special effects material to be edited and the editing operation are determined according to the special effects editing instructions;

[0143] The video editing thread edits the data of the special effects material in the storage space according to the editing operation and the reference status of the special effects material to be edited; wherein, the reference status is that it is referenced by the special effects rendering thread, not referenced by the special effects rendering thread, or the reference is released.

[0144] The video editing thread obtains special effects rendering instructions, determines video materials and special effects materials to be rendered based on the special effects rendering instructions, and updates the reference status of the special effects materials to be rendered.

[0145] The special effects rendering thread reads the data of the special effects material to be rendered from the storage space, performs special effects rendering operations on the video material corresponding to the special effects rendering instructions, and updates the reference status of the special effects material to be rendered when the rendering is completed.

[0146] According to one or more embodiments of the present invention, Example 2, based on the method described in Example 1, wherein the special effects materials in the storage space are encapsulated using smart pointers, and the step of determining the video materials and the special effects materials to be rendered according to the special effects rendering instructions, and updating the reference status of the special effects materials to be rendered, includes:

[0147] The video material and the special effects material to be rendered are determined according to the special effects rendering instructions, and the reference count of the smart pointer of the special effects material to be rendered is incremented by a first value;

[0148] Accordingly, updating the reference status of the special effects material to be rendered upon completion of rendering includes:

[0149] When rendering is complete, decrement the reference count of the smart pointer of the material to be rendered by the first value;

[0150] The reference count of the smart pointer is used to characterize the reference status of the special effects material. When the reference count of the smart pointer is the second value, the reference status of the special effects material to be rendered is that it is not referenced by the special effects rendering thread. When the reference count of the smart pointer is the sum of the first value and the second value, the reference status of the special effects material to be rendered is that it is referenced by the special effects rendering thread. When the reference count of the smart pointer is zero, the reference status of the special effects material to be rendered is that the reference has been released.

[0151] According to one or more embodiments of the present invention, Example 3, based on the method shown in Example 2, involves editing the data of the special effects material to be edited in the storage space through the video editing thread, according to the editing operation and the reference status of the special effects material to be edited, including:

[0152] If the editing operation is a deletion operation and the reference status of the special effect material to be edited is referenced by the special effect rendering thread, then the data of the special effect material to be edited is retained in the storage space, and the reference count of the smart pointer of the special effect material to be edited is reduced by a second value.

[0153] Once the reference status of the special effects material to be edited is detected to be "reference released", the data of the special effects material to be edited will be deleted from the storage space.

[0154] According to one or more embodiments of the present invention, Example 4, based on the method described in Example 3, further includes editing the data of the special effects material to be edited in the storage space through the video editing thread, according to the editing operation and the reference status of the special effects material to be edited, as follows:

[0155] If the editing operation is a deletion operation, and the reference status of the special effect material to be edited is not referenced by the special effect rendering thread, then the reference count of the smart pointer of the special effect material to be edited is decremented by a second value, and the data of the special effect material to be edited is deleted from the storage space.

[0156] According to one or more embodiments of the present invention, Example 5 describes the method described in Example 2, wherein editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes:

[0157] If the editing operation is an add operation and the reference status of the special effect material to be edited is reference released, then the data of the special effect material to be edited is added to the storage space, and the reference count of the smart pointer of the special effect material to be edited is incremented by a second value.

[0158] According to one or more embodiments of the present invention, Example 6 describes the method described in Example 2, wherein editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes:

[0159] If the editing operation is a modification operation and the reference status of the special effects material to be edited is referenced by the special effects rendering thread, then the reference count of the smart pointer of the special effects material to be edited is maintained, and the data of the special effects material to be edited is modified in the storage space.

[0160] According to one or more embodiments of the present invention, Example 7 describes the method described in Example 2, wherein editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes:

[0161] If the editing operation is a modification operation and the reference status of the special effect material to be edited is referenced by the special effect rendering thread, then the data of the special effect material to be edited is retained in the storage space, and the data of the copied special effect material corresponding to the data of the special effect material to be edited is added to the storage space.

[0162] The reference count of the smart pointer of the special effect material to be edited is reduced by a second value until the reference status of the special effect material to be edited is detected to be released. Then the data of the special effect material to be edited is deleted from the storage space.

[0163] The reference count of the smart pointer of the copied special effects material is incremented by a second value, and the data of the copied special effects material is modified in the storage space.

[0164] According to one or more embodiments of the present invention, Example 8, based on the method described in Example 6 or Example 7, further includes editing the data of the special effects material to be edited in the storage space through the video editing thread, according to the editing operation and the reference status of the special effects material to be edited, as follows:

[0165] If the editing operation is a modification operation, and the reference status of the special effect material to be edited is not referenced by the special effect rendering thread, then the reference count of the smart pointer of the special effect material to be edited is maintained, and the data of the special effect material to be edited is modified in the storage space.

[0166] According to one or more embodiments of the present invention, Example 9, based on the method described in Example 1, includes obtaining special effects rendering instructions through a video editing thread, comprising:

[0167] Obtain at least one pending effects rendering request for the video footage through the video editing thread;

[0168] When the previous rendering of the video material is completed, the target special effects rendering request is obtained according to the request order of each of the special effects rendering requests to be executed;

[0169] Based on the video footage and the special effects footage to be rendered in the target special effects rendering request, generate special effects rendering instructions.

[0170] According to one or more embodiments of the present invention, Example 10 provides a video rendering apparatus, comprising:

[0171] The module for determining special effects material to be edited is used to obtain special effects editing instructions through the video editing thread, and determine the special effects material to be edited and the editing operation based on the special effects editing instructions;

[0172] The editing module for special effects materials to be edited is used to edit the data of the special effects materials to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects materials to be edited; wherein, the reference status is referenced by the special effects rendering thread, not referenced by the special effects rendering thread, or the reference is released;

[0173] The module for determining special effects and special effects materials to be rendered is used to obtain special effects rendering instructions through the video editing thread, determine video materials and special effects materials to be rendered according to the special effects rendering instructions, and update the reference status of the special effects materials to be rendered.

[0174] The special effects rendering operation execution module is used to read the data of the special effects material to be rendered from the storage space through the special effects rendering thread, perform special effects rendering operations on the video material corresponding to the special effects rendering instructions, and update the reference status of the special effects material to be rendered when the rendering is completed.

[0175] According to one or more embodiments of the present invention, Example 11 provides an electronic device, comprising:

[0176] At least one processor; and

[0177] A memory communicatively connected to the at least one processor; wherein,

[0178] The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the video rendering method described in any one of Examples 1-9.

[0179] According to one or more embodiments of the present invention, Example 12 provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions for causing a processor to execute and implement the video rendering method described in any one of Examples 1-9.

[0180] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.

[0181] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0182] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A video rendering method, characterized in that, include: The video editing thread obtains special effects editing instructions, and the special effects material to be edited and the editing operation are determined according to the special effects editing instructions; The video editing thread edits the data of the special effects material in the storage space according to the editing operation and the reference status of the special effects material to be edited; wherein, the reference status is that it is referenced by the special effects rendering thread, not referenced by the special effects rendering thread, or the reference is released. The video editing thread obtains special effects rendering instructions, determines video materials and special effects materials to be rendered based on the special effects rendering instructions, and updates the reference status of the special effects materials to be rendered. The special effects rendering thread reads the data of the special effects material to be rendered from the storage space, performs special effects rendering operations on the video material corresponding to the special effects rendering instructions, and updates the reference status of the special effects material to be rendered when the rendering is completed.

2. The method according to claim 1, characterized in that, The special effects materials in the storage space are encapsulated using smart pointers. The process of determining the video materials and special effects materials to be rendered based on the special effects rendering instructions, and updating the reference status of the special effects materials to be rendered, includes: The video material and the special effects material to be rendered are determined according to the special effects rendering instructions, and the reference count of the smart pointer of the special effects material to be rendered is incremented by a first value; Accordingly, updating the reference status of the special effects material to be rendered upon completion of rendering includes: When rendering is complete, decrement the reference count of the smart pointer of the material to be rendered by the first value; The reference count of the smart pointer is used to characterize the reference status of the special effects material. When the reference count of the smart pointer is the second value, the reference status of the special effects material to be rendered is that it is not referenced by the special effects rendering thread. When the reference count of the smart pointer is the sum of the first value and the second value, the reference status of the special effects material to be rendered is that it is referenced by the special effects rendering thread. When the reference count of the smart pointer is zero, the reference status of the special effects material to be rendered is that the reference has been released.

3. The method according to claim 2, characterized in that, The step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes: If the editing operation is a deletion operation and the reference status of the special effect material to be edited is referenced by the special effect rendering thread, then the data of the special effect material to be edited is retained in the storage space, and the reference count of the smart pointer of the special effect material to be edited is reduced by a second value. Once the reference status of the special effects material to be edited is detected to be "reference released", the data of the special effects material to be edited will be deleted from the storage space.

4. The method according to claim 3, characterized in that, The step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, further includes: If the editing operation is a deletion operation, and the reference status of the special effect material to be edited is not referenced by the special effect rendering thread, then the reference count of the smart pointer of the special effect material to be edited is decremented by a second value, and the data of the special effect material to be edited is deleted from the storage space.

5. The method according to claim 2, characterized in that, The step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes: If the editing operation is an add operation and the reference status of the special effect material to be edited is reference released, then the data of the special effect material to be edited is added to the storage space, and the reference count of the smart pointer of the special effect material to be edited is incremented by a second value.

6. The method according to claim 2, characterized in that, The step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes: If the editing operation is a modification operation and the reference status of the special effects material to be edited is referenced by the special effects rendering thread, then the reference count of the smart pointer of the special effects material to be edited is maintained, and the data of the special effects material to be edited is modified in the storage space.

7. The method according to claim 2, characterized in that, The step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, includes: If the editing operation is a modification operation and the reference status of the special effect material to be edited is referenced by the special effect rendering thread, then the data of the special effect material to be edited is retained in the storage space, and the data of the copied special effect material corresponding to the data of the special effect material to be edited is added to the storage space. The reference count of the smart pointer of the special effect material to be edited is reduced by a second value until the reference status of the special effect material to be edited is detected to be released. Then the data of the special effect material to be edited is deleted from the storage space. The reference count of the smart pointer of the copied special effects material is incremented by a second value, and the data of the copied special effects material is modified in the storage space.

8. The method according to claim 6 or 7, characterized in that, The step of editing the data of the special effects material to be edited in the storage space through the video editing thread, based on the editing operation and the reference status of the special effects material to be edited, further includes: If the editing operation is a modification operation, and the reference status of the special effect material to be edited is not referenced by the special effect rendering thread, then the reference count of the smart pointer of the special effect material to be edited is maintained, and the data of the special effect material to be edited is modified in the storage space.

9. The method according to claim 1, characterized in that, The process of obtaining special effects rendering instructions through the video editing thread includes: Obtain at least one pending effects rendering request for the video footage through the video editing thread; When the previous rendering of the video material is completed, the target special effects rendering request is obtained according to the request order of each of the special effects rendering requests to be executed; Based on the video footage and the special effects footage to be rendered in the target special effects rendering request, generate special effects rendering instructions.

10. A video rendering apparatus, characterized in that, include: The module for determining special effects material to be edited is used to obtain special effects editing instructions through the video editing thread, and determine the special effects material to be edited and the editing operation based on the special effects editing instructions; The editing module for special effects materials is used to edit the data of the special effects materials to be edited in the storage space according to the editing operation and the reference status of the special effects materials to be edited through the video editing thread; wherein, the reference status is referenced by the special effects rendering thread, not referenced by the special effects rendering thread, or the reference is released; The module for determining special effects materials to be rendered is used to obtain special effects rendering instructions through the video editing thread, determine video materials and special effects materials to be rendered according to the special effects rendering instructions, and update the reference status of the special effects materials to be rendered. The special effects rendering operation execution module is used to read the data of the special effects material to be rendered from the storage space through the special effects rendering thread, perform special effects rendering operations on the video material corresponding to the special effects rendering instructions, and update the reference status of the special effects material to be rendered when the rendering is completed.

11. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the video rendering method according to any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the video rendering method according to any one of claims 1-9.