Skip to content
VIDEOMONTAZHERDAVINCI RESOLVE · VIDEO · AI

FUSION · Practical recipes

A ten-second countdown

A deterministic counter for 25 fps, with precise rounding rules and a stop at zero.

Fusion / DaVinci Resolve 20–21; check the interface in your build

After this lesson

  • Build a reproducible countdown driven by frames.
  • Understand the initial value and when zero appears.
  • Keep the layout stable as the digits change.

Before you start

Composition
A separate Fusion Composition. 1920×1080, square pixels, 25 fps.
Parameter
Text1 → Styled Text; 25 fps
Range
Start at comp.RenderStart. Reference frames are local unless stated otherwise.

This timer is tied to composition frames rather than the system clock. The rule is simple: the first 25 frames show 10, the next 25 show 09, and 00 appears at local frame 250.

Order of calculation

First obtain local time and clamp it to a minimum of zero. Divide by 25 and round down. Subtract the completed whole seconds from 10 and prevent a negative result.

The %02d format adds a leading zero to single-digit values. Text returns a text value for Styled Text.

Check the boundaries

Frames 0…24 → 10; 25…49 → 09; 225…249 → 01; 250 onward → 00. This is the chosen countdown convention. If the first frame should have a different meaning, change the rule deliberately.

A ten-second clip at 25 fps contains 250 frames: 0…249. To show 00, you need at least one more frame, and a readable pause requires an additional hold.

Changing the frame rate and styling

The number 25 is an explicit assumption of this recipe. Replace it with the actual frame rate. For fractional rates and precise duration requirements, check what happens at the real boundaries.

Choose suitable alignment and equal-width digits. Keep the background and “Remaining” label separate from the changing number.

Four operations with four distinct jobs

First, time−comp.RenderStart converts time to local frames. Dividing by 25 converts it to seconds. math.floor retains the number of completed whole seconds. Subtracting from 10 gives the remaining value; math.max(0, …) prevents a negative result.

string.format("%02d", …) only formats the integer: 9 becomes 09. The outer Text returns text for Styled Text. If the complete expression fails, first check just the numeric core on a numeric parameter or in the laboratory, then check the formatting. Do not paste Text(...) into Size: it expects a different input type.

Ten seconds of countdown and displaying zero require different durations

At 25 fps, frames 0…249 contain exactly 250 frames, or 10 seconds of video. The last of those frames still displays 01. Zero appears at local frame 250, the first frame after ten complete seconds. To let viewers see 00, add a hold: for example, frames 0…274 provide ten seconds of countdown followed by one second at zero.

Do not fix this with an arbitrary −1 in the formula: that shifts every changeover. First agree on the requirement with the client: should the video last exactly 10 seconds, or should zero remain for another second? At 29.97 fps, some second boundaries fall between frames, so choose the duration deliberately. Do not use Text Timer's live system clock for a result that must render identically on any day.

Parameters and ranges

ParameterWhat it changesExample / check
10The starting number of seconds.The first image displays 10.
25This project's frame rate.Not a hidden browser setting.
math.floorCompleted whole seconds.Frames 0…24 display the same number.
%02dAt least two digits, with a leading zero.09, 08, …, 00.

USE IN A COMPOSITION

Build it: from an empty composition to verification

Text1 → Styled Text; 25 fps

FUSION / FLOWNodes and parameter control
100%
ImageControl in the InspectorScroll or drag the graph. Choose “Fit” to see all of it.
Solid lines are node connections in the Flow. A dashed line is a parameter dependency configured in the Inspector. A solid arrow's color matches its destination input. Modifiers are shown separately from the Flow.control.Value → Text1.Styled TextText1.Output → MediaOut1.InputCountdown from time · Expression · InspectorEXPRESSIONCountdown from timeSimple ExpressionText1 · Image node · FlowT+Text1Text+Styled TextStyled Text · an Inspector parameter, not an image portMediaOut1 · Image node · Flow↗MediaOut1MediaOut
Parameter · InspectorImage
Select a node or a colored arrow

Solid lines are node connections in the Flow. A dashed line is a parameter dependency configured in the Inspector.

Connections by port and parameter2

Color is determined by the destination input. Dashed connections are configured in the Inspector; they do not add an RGBA wire to the Flow.

The countdown depends only on composition time, not on the system clock.

Assembly steps

  1. Create a Fusion Composition at 25 fps with a range of at least 0…274, or an equivalent local range.
  2. Add Text1 and choose a font with even tabular figures; check the widths of 10 and 00.
  3. Enable Expression on Styled Text and paste the complete text formula below.
  4. Check the absolute starting frame and local frames 24, 25, 249 and 250.
  5. Use centered alignment or the alignment requested by the client so changing digits do not shift the text.
  6. For another frame rate, replace 25 in the formula. The laboratory's playback rate does not change the Resolve project's settings.
  7. Scrub backward and render the same checkpoint again: the value must match.
SIMPLE EXPRESSION · FUSION
Text(string.format("%02d", math.max(0, 10 - math.floor(math.max(0, time-comp.RenderStart)/25))))

Expected result. The counter decreases once per second and never goes below zero.

Checkpoints

When / what to checkExpectedWhy check it
0…2410No complete second has elapsed.
25…4909The first second has elapsed.
24901The final frame of a ten-second video.
250 onward00Zero is held.

INTERACTIVE EXAMPLE

Change a parameter. Compare the result.

INTERACTIVE EXAMPLE

Countdown

CONTROLLED INPUTText1 → Styled Text
VIEWER · FORMULA EVALUATIONPREVIEW
UNTIL START08SECONDS
TEACHING VIEWER0069 f
0 f← → one frame at a time25 fps
VALUE GRAPH
Value
-1.2511.20 f137 f274 f
Select a point on the graph to go to that frame. Values are checked throughout the range.

Frames convert to completed whole seconds. The countdown stops at zero; fps in the formula must match the project.

VALUE AT THIS FRAME 698
CHECK THE DEPENDENCY

At each second boundary, the number decreases by 1. After the countdown, it stays at 00.

The formula runs in the browser; the preview shows its result on a teaching object. Fusion's image processing is not reproduced here.

Errors and troubleshooting

Zero never appeared

The clip ended at frame 249. Add frames to display zero.

The countdown runs too quickly

Check the fps divisor and the composition frame rate.

Independent exercise

Create a 30-second countdown for 50 fps.

Show the solution and explanation

Replace 10 with 30 and 25 with 50. Zero appears at local frame 1500; allow for a hold afterward.

Continue learning

Official sources

Blackmagic Design · Fusion Reference ManualThe chapter “Using Modifiers, Expressions, and Custom Controls”. Page numbers depend on the PDF edition.
Blackmagic Design · Modifiers referenceThe Modifiers section. Available commands depend on the input type and Fusion version.

An original educational walkthrough. The browser model explains the principle but does not run Fusion. Control placement depends on the version; save the original composition before replacing a parameter's control source.