Time formats
Every duration in VideoFlow passes through a single parser. You can give it a number, a string with a unit, a clock form, or a frame count — the parser returns seconds, and every downstream API works in seconds.
On this page
Supported inputs
| Input | Seconds | Notes |
|---|---|---|
5 | 5 | Any plain number is seconds. |
0.5 | 0.5 | Fractions fine. |
'2s' | 2 | Seconds with suffix. |
'500ms' | 0.5 | Milliseconds. |
'3m' | 180 | Minutes. |
'1h' | 3600 | Hours. |
'120f' | depends on fps | At 30 fps → 4s. At 60 → 2s. |
'00:30' | 30 | mm:ss form. |
'01:20:05' | 4805 | hh:mm:ss form. |
'00:05:10:15' | depends on fps | hh:mm:ss:ff — ff is frames. |
Where you can pass them
Anywhere the API accepts a duration. A partial list:
$.wait('2s');
$.wait(0.5);
$.wait('120f'); // 120 frames
layer.animate({...}, {...}, { duration: '750ms' });
layer.animate({...}, {...}, { duration: '30f' }); // frame-exact
layer.fadeIn('500ms');
layer.fadeOut('1s');
// Trim a clip's source — start 5s in, play sourceStart-relative.
$.addVideo({}, { source, sourceStart: '00:00:05' });
// Schedule a layer with the flow pattern instead of an explicit sourceDuration.
$.wait('2s');
const t = $.addText({ text: 'hi' });
$.wait('3s');
t.remove();Frames and fps
Frame-count inputs ('120f', 'hh:mm:ss:ff') are parsed against the project's fps. If your flow is 30 fps, '30f' is one second. If you change the fps after the fact, all frame-based durations shift accordingly.
$.wait('1s'); $.wait('15f') is clearer than $.wait(1.5) when the 15 frames matter.