Dec 7, 2021.Knowledge
In 4.20 Sequencer refactored its time representation to be based on integers rather than floats. More details can be found on this documentation page.
As a result, Sequencer maintains two frame rates for a sequence to distinguish the FPS for conceptualizing the sequence and the more granular rate for evaluation and keying content on subframes, which are the Display Rate and the Tick Resolution, respectively.
The Display Rate allows for the familiar FPS number for authoring and editing which corresponds to typical media frame rates, and is also used when rendering sequences to disk. The Tick Resolution allows for granular subframe keying without the use of floating points, which maintains frame and subframe accuracy.
Frame numbers (FFrameNumber) are stored in sequence data based on the Tick Resolution . We use Details Customization to automatically convert to the Tick Resolution when editing these values through the timeline editor (see FFrameNumberDetailsCustomization). This means setting frame values in the UI takes the familiar FPS values, and automatically stores them correctly.
Frame numbers can be encountered for things like frame offsets (e.g. the Start Frame Offset on shot sections), or in the context of frame ranges, and it’s possible to work with these values through our scripting API. In most cases we offer setters that handle these conversions, but sometimes you can access the values directly in which case you’ll be working in the Tick Resolution, as the Details Customization only applies to the editor UI.
If you are seeing results that appear to be off by large factors, you may be working with the wrong frame rate by setting values in their Display Rate frame value rather than the Tick Resolution value.
You can convert to the Tick Resolution value with this formula:
Frame value * ( Sequence’s Tick Resolution / Sequence’s Display Rate )
There are functions for getting both the Display Rate and Tick Resolution in UMovieSceneSequenceExtensions, which are available in Blueprints and Python.
If you’re interested you can look at the full frame conversion we do internally with ConvertFrameTime in FrameRate.h