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
| Parameter | What it changes | Example / check |
|---|---|---|
| 10 | The starting number of seconds. | The first image displays 10. |
| 25 | This project's frame rate. | Not a hidden browser setting. |
| math.floor | Completed whole seconds. | Frames 0…24 display the same number. |
| %02d | At 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
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
- Create a Fusion Composition at 25 fps with a range of at least 0…274, or an equivalent local range.
- Add Text1 and choose a font with even tabular figures; check the widths of 10 and 00.
- Enable Expression on Styled Text and paste the complete text formula below.
- Check the absolute starting frame and local frames 24, 25, 249 and 250.
- Use centered alignment or the alignment requested by the client so changing digits do not shift the text.
- For another frame rate, replace 25 in the formula. The laboratory's playback rate does not change the Resolve project's settings.
- Scrub backward and render the same checkpoint again: the value must match.
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 check | Expected | Why check it |
|---|---|---|
| 0…24 | 10 | No complete second has elapsed. |
| 25…49 | 09 | The first second has elapsed. |
| 249 | 01 | The final frame of a ten-second video. |
| 250 onward | 00 | Zero is held. |
INTERACTIVE EXAMPLE
Change a parameter. Compare the result.
Countdown
Text1 → Styled TextFrames convert to completed whole seconds. The countdown stops at zero; fps in the formula must match the project.
At each second boundary, the number decreases by 1. After the countdown, it stays at 00.
Text(string.format("%02d", math.max(0, 10 - math.floor(math.max(0, time - comp.RenderStart) / 25))))The browser evaluates the numeric core; Text and string.format run in Fusion.
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
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.