Transitionsv4.0.59
To transition between two types of absolutely positioned content, you can use the <TransitionSeries>
component.
SlideTransition.tsxtsx
import {linearTiming ,TransitionSeries } from "@remotion/transitions";import {slide } from "@remotion/transitions/slide";constBasicTransition = () => {return (<TransitionSeries ><TransitionSeries .Sequence durationInFrames ={40}><Letter color ="#0b84f3">A</Letter ></TransitionSeries .Sequence ><TransitionSeries .Transition presentation ={slide ()}timing ={linearTiming ({durationInFrames : 30 })}/><TransitionSeries .Sequence durationInFrames ={60}><Letter color ="pink">B</Letter ></TransitionSeries .Sequence ></TransitionSeries >);};
SlideTransition.tsxtsx
import {linearTiming ,TransitionSeries } from "@remotion/transitions";import {slide } from "@remotion/transitions/slide";constBasicTransition = () => {return (<TransitionSeries ><TransitionSeries .Sequence durationInFrames ={40}><Letter color ="#0b84f3">A</Letter ></TransitionSeries .Sequence ><TransitionSeries .Transition presentation ={slide ()}timing ={linearTiming ({durationInFrames : 30 })}/><TransitionSeries .Sequence durationInFrames ={60}><Letter color ="pink">B</Letter ></TransitionSeries .Sequence ></TransitionSeries >);};
Enter and exit animations
You don't necessarily have to use <TransitionSeries>
for transitions between scenes. You can also use it to animate the entrace or exit of a scene by putting a transition first or last in the <TransitionSeries>
.
Duration
In the above example, A
is visible for 40 frames, B
for 60 frames and the duration of the transition is 30 frames.
During this time, both slides are rendered. This means the total duration of the animation is 60 + 40 - 30 = 70
.
Presentations
A presentation determines the visual of animation.
fade()
slide()
wipe()
flip()
Timings
A timing determines how long the animation takes and the animation curve.
springTiming()
spring()
linearTiming()
Audio transitions
See here how to include audio effects in your transitions.
Getting the duration of a transition
You can get the duration of a transition by calling getDurationInFrames()
on the timing:
Assuming a framerate of 30fpstsx
import {springTiming } from "@remotion/transitions";springTiming ({config : {damping : 200 } }).getDurationInFrames ({fps : 30 }); // 23
Assuming a framerate of 30fpstsx
import {springTiming } from "@remotion/transitions";springTiming ({config : {damping : 200 } }).getDurationInFrames ({fps : 30 }); // 23