Detailed guide to improving template rendering speed

更新时间:
复制 MD 格式

If you find that rendering is slow when you export your Adobe After Effects (AE) templates using VE, or if the speed is significantly slower than that of other products, this topic can help. This topic explains the causes of slow rendering and describes how to improve the speed.

Reasons for slow template rendering speed

How you create a template is the main factor that affects rendering speed. Most slow-rendering templates are not optimized during creation. The VE engine's main function is to reconstruct compositions, layers, animations, and effects from AE. The engine then renders and composites each element to produce the final video. Because of this process, every element in an AE template affects the final rendering performance.

How template creation affects rendering speed

Frame rate

Frame rate is the number of still images displayed per second in a video. For the VE video engine, this is the number of frames it must render each second. VE uses the frame rate that the designer sets in the AE template, which directly affects VE's rendering speed. For example, consider two templates of the same duration that use the same assets, animations, and effects. A template with a frame rate of 30 frames per second (fps) will take VE about twice as long to render as a template with a 15 fps frame rate.

Layer and composition size

VE renders each layer and composition into a flat image. It then blends that image with other images or compositions. The size (width and height) of a layer or composition directly determines the number of pixels VE must calculate for each frame. For example, a 100 × 100 pixel layer requires VE to calculate 100 × 100 = 10,000 pixels. Each pixel has four color channels: Red, Green, Blue, and Alpha (RGBA), and each channel is represented by a number. This means a total of 10,000 × 4 = 40,000 numbers must be processed. As you can see, the size of layers and compositions in a template directly affects the amount of calculation that VE performs.

Asset quantity, size, and type

The main assets in VE are images and videos. Text assets are treated as image assets. These assets must be decoded during rendering. The time it takes to decode an image affects the rendering speed. If an image asset is used by multiple, consecutive layers in a composition, the image is decoded only once. This has a minimal impact on rendering speed. However, if the same image is used intermittently, it must be decoded at the start of each new appearance. This increases the impact on rendering speed. Larger images also take longer to decode and have a greater impact. Decoding video assets is more time-consuming than decoding images because each frame of a video must be decoded. Larger videos also take longer to decode per frame. Therefore, the more assets you use and the larger their size, the greater the impact on rendering speed.

Template structure

Template structure refers to the assets, the number of pre-compositions, and the complexity of nested pre-compositions. When VE renders a composition, it processes layers from bottom to top. It renders each layer's content and then blends it with the layers below it. The final result is then rendered to the composition. For example, a composition has three layers and no effects. VE first renders the content of all three layers. This requires three rendering operations. Then, it blends the layers. Layer 2 is blended over Layer 1, and Layer 3 is blended over the result. This requires two blending operations. Finally, the combined result is rendered to the composition, which is one more operation. In total, a simple three-layer composition requires about six rendering operations. As you can see, more layers, more pre-compositions, and more complex nesting significantly increase the workload for the VE rendering engine.

Use of effects

In VE, you can add one or more effects to a layer. Each effect requires at least one rendering pass to produce its result. Some effects require multiple passes. Therefore, the more effects a template uses, the greater the impact on rendering speed.

Use of 3D layers

When a composition contains 3D layers, VE uses a 3D rendering engine to render the content. 3D rendering is typically more time-consuming than 2D rendering. If a composition has a continuous group of 3D layers with no 2D layers in between, VE must use a special algorithm. To ensure correct rendering, it uses an order-independent transparency algorithm for the group. This algorithm can perfectly recreate the rendering results of 3D layers in AE. However, it also increases the rendering time. Therefore, using 3D layers, especially in a continuous group, has a greater impact on VE's rendering speed.

Methods to optimize template rendering speed

  • Use a suitable frame rate

    Choose a frame rate based on your product's purpose and target audience. For templates on mobile devices aimed at general consumers, a frame rate of around 20 fps is suitable. You do not need to set it higher.

  • Set a suitable frame size

    Frame size refers to the size of all layers and pre-compositions in the template, not just the final main composition. A small main composition does not guarantee fast rendering. For example, if you use a 4K pre-composition or layer in a 540 × 960 pixel template, VE is forced to render at 4K resolution. Therefore, reduce the size of layers and pre-compositions in your template whenever possible.

  • Optimize asset usage and template structure

    Optimizing asset usage and template structure are related. When you create VE templates, merge any layers that users will not need to modify. Reduce the number of layers as much as possible. When you reduce the number of layers, the number of assets used by the template also decreases.

    Also, minimize the use of video assets. When you consolidate layers in an AE template and pre-render layers that do not require editing, check for animation. If a layer has no animation, pre-render it as an image asset. Do not pre-render all non-editable layers as video assets.

  • Optimize the use of effects

    Avoid adding the same effect to multiple individual layers. Instead, use an adjustment layer. This reduces the number of times the effect must be rendered.

  • Optimize the use of 3D layers

    If a visual effect can be achieved with 2D animation, use 2D methods instead of 3D layers. This reduces the number of 3D layers. For example, for simple 3D spatial animations, you can use the Corner Pin plugin to simulate 3D perspective animation.