@kolbo/kolbo-code-windows-x64 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/kolbo.exe +0 -0
- package/package.json +14 -0
- package/skills/frontend-design/SKILL.md +42 -0
- package/skills/kolbo/SKILL.md +216 -0
- package/skills/remotion-best-practices/SKILL.md +61 -0
- package/skills/remotion-best-practices/rules/3d.md +86 -0
- package/skills/remotion-best-practices/rules/animations.md +27 -0
- package/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
- package/skills/remotion-best-practices/rules/assets.md +78 -0
- package/skills/remotion-best-practices/rules/audio-visualization.md +198 -0
- package/skills/remotion-best-practices/rules/audio.md +169 -0
- package/skills/remotion-best-practices/rules/calculate-metadata.md +134 -0
- package/skills/remotion-best-practices/rules/can-decode.md +81 -0
- package/skills/remotion-best-practices/rules/charts.md +120 -0
- package/skills/remotion-best-practices/rules/compositions.md +154 -0
- package/skills/remotion-best-practices/rules/display-captions.md +184 -0
- package/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/skills/remotion-best-practices/rules/ffmpeg.md +38 -0
- package/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/skills/remotion-best-practices/rules/get-video-duration.md +60 -0
- package/skills/remotion-best-practices/rules/gifs.md +141 -0
- package/skills/remotion-best-practices/rules/images.md +134 -0
- package/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/skills/remotion-best-practices/rules/lottie.md +70 -0
- package/skills/remotion-best-practices/rules/maps.md +412 -0
- package/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/skills/remotion-best-practices/rules/measuring-text.md +140 -0
- package/skills/remotion-best-practices/rules/parameters.md +109 -0
- package/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/skills/remotion-best-practices/rules/sfx.md +30 -0
- package/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/skills/remotion-best-practices/rules/timing.md +179 -0
- package/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/skills/remotion-best-practices/rules/transitions.md +197 -0
- package/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/skills/remotion-best-practices/rules/trimming.md +51 -0
- package/skills/remotion-best-practices/rules/videos.md +171 -0
- package/skills/remotion-best-practices/rules/voiceover.md +99 -0
- package/skills/video-production/SKILL.md +152 -0
- package/skills/youtube-clipper/SKILL.md +187 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sequencing
|
|
3
|
+
description: Sequencing patterns for Remotion - delay, trim, limit duration of items
|
|
4
|
+
metadata:
|
|
5
|
+
tags: sequence, series, timing, delay, trim
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use `<Sequence>` to delay when an element appears in the timeline.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Sequence } from "remotion";
|
|
12
|
+
|
|
13
|
+
const {fps} = useVideoConfig();
|
|
14
|
+
|
|
15
|
+
<Sequence from={1 * fps} durationInFrames={2 * fps} premountFor={1 * fps}>
|
|
16
|
+
<Title />
|
|
17
|
+
</Sequence>
|
|
18
|
+
<Sequence from={2 * fps} durationInFrames={2 * fps} premountFor={1 * fps}>
|
|
19
|
+
<Subtitle />
|
|
20
|
+
</Sequence>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This will by default wrap the component in an absolute fill element.
|
|
24
|
+
If the items should not be wrapped, use the `layout` prop:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
<Sequence layout="none">
|
|
28
|
+
<Title />
|
|
29
|
+
</Sequence>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Premounting
|
|
33
|
+
|
|
34
|
+
This loads the component in the timeline before it is actually played.
|
|
35
|
+
Always premount any `<Sequence>`!
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<Sequence premountFor={1 * fps}>
|
|
39
|
+
<Title />
|
|
40
|
+
</Sequence>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Series
|
|
44
|
+
|
|
45
|
+
Use `<Series>` when elements should play one after another without overlap.
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { Series } from "remotion";
|
|
49
|
+
|
|
50
|
+
<Series>
|
|
51
|
+
<Series.Sequence durationInFrames={45}>
|
|
52
|
+
<Intro />
|
|
53
|
+
</Series.Sequence>
|
|
54
|
+
<Series.Sequence durationInFrames={60}>
|
|
55
|
+
<MainContent />
|
|
56
|
+
</Series.Sequence>
|
|
57
|
+
<Series.Sequence durationInFrames={30}>
|
|
58
|
+
<Outro />
|
|
59
|
+
</Series.Sequence>
|
|
60
|
+
</Series>;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Same as with `<Sequence>`, the items will be wrapped in an absolute fill element by default when using `<Series.Sequence>`, unless the `layout` prop is set to `none`.
|
|
64
|
+
|
|
65
|
+
### Series with overlaps
|
|
66
|
+
|
|
67
|
+
Use negative offset for overlapping sequences:
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
<Series>
|
|
71
|
+
<Series.Sequence durationInFrames={60}>
|
|
72
|
+
<SceneA />
|
|
73
|
+
</Series.Sequence>
|
|
74
|
+
<Series.Sequence offset={-15} durationInFrames={60}>
|
|
75
|
+
{/* Starts 15 frames before SceneA ends */}
|
|
76
|
+
<SceneB />
|
|
77
|
+
</Series.Sequence>
|
|
78
|
+
</Series>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Frame References Inside Sequences
|
|
82
|
+
|
|
83
|
+
Inside a Sequence, `useCurrentFrame()` returns the local frame (starting from 0):
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
<Sequence from={60} durationInFrames={30}>
|
|
87
|
+
<MyComponent />
|
|
88
|
+
{/* Inside MyComponent, useCurrentFrame() returns 0-29, not 60-89 */}
|
|
89
|
+
</Sequence>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Nested Sequences
|
|
93
|
+
|
|
94
|
+
Sequences can be nested for complex timing:
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<Sequence from={0} durationInFrames={120}>
|
|
98
|
+
<Background />
|
|
99
|
+
<Sequence from={15} durationInFrames={90} layout="none">
|
|
100
|
+
<Title />
|
|
101
|
+
</Sequence>
|
|
102
|
+
<Sequence from={45} durationInFrames={60} layout="none">
|
|
103
|
+
<Subtitle />
|
|
104
|
+
</Sequence>
|
|
105
|
+
</Sequence>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Nesting compositions within another
|
|
109
|
+
|
|
110
|
+
To add a composition within another composition, you can use the `<Sequence>` component with a `width` and `height` prop to specify the size of the composition.
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<AbsoluteFill>
|
|
114
|
+
<Sequence width={COMPOSITION_WIDTH} height={COMPOSITION_HEIGHT}>
|
|
115
|
+
<CompositionComponent />
|
|
116
|
+
</Sequence>
|
|
117
|
+
</AbsoluteFill>
|
|
118
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfx
|
|
3
|
+
description: Including sound effects
|
|
4
|
+
metadata:
|
|
5
|
+
tags: sfx, sound, effect, audio
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
To include a sound effect, use the `<Audio>` tag:
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Audio } from "@remotion/sfx";
|
|
12
|
+
|
|
13
|
+
<Audio src={"https://remotion.media/whoosh.wav"} />;
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The following sound effects are available:
|
|
17
|
+
|
|
18
|
+
- `https://remotion.media/whoosh.wav`
|
|
19
|
+
- `https://remotion.media/whip.wav`
|
|
20
|
+
- `https://remotion.media/page-turn.wav`
|
|
21
|
+
- `https://remotion.media/switch.wav`
|
|
22
|
+
- `https://remotion.media/mouse-click.wav`
|
|
23
|
+
- `https://remotion.media/shutter-modern.wav`
|
|
24
|
+
- `https://remotion.media/shutter-old.wav`
|
|
25
|
+
- `https://remotion.media/ding.wav`
|
|
26
|
+
- `https://remotion.media/bruh.wav`
|
|
27
|
+
- `https://remotion.media/vine-boom.wav`
|
|
28
|
+
- `https://remotion.media/windows-xp-error.wav`
|
|
29
|
+
|
|
30
|
+
For more sound effects, search the internet. A good resource is https://github.com/kapishdima/soundcn/tree/main/assets.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: subtitles
|
|
3
|
+
description: subtitles and caption rules
|
|
4
|
+
metadata:
|
|
5
|
+
tags: subtitles, captions, remotion, json
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
All captions must be processed in JSON. The captions must use the `Caption` type which is the following:
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import type { Caption } from "@remotion/captions";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This is the definition:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
type Caption = {
|
|
18
|
+
text: string;
|
|
19
|
+
startMs: number;
|
|
20
|
+
endMs: number;
|
|
21
|
+
timestampMs: number | null;
|
|
22
|
+
confidence: number | null;
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Generating captions
|
|
27
|
+
|
|
28
|
+
To transcribe video and audio files to generate captions, load the [./transcribe-captions.md](./transcribe-captions.md) file for more instructions.
|
|
29
|
+
|
|
30
|
+
## Displaying captions
|
|
31
|
+
|
|
32
|
+
To display captions in your video, load the [./display-captions.md](./display-captions.md) file for more instructions.
|
|
33
|
+
|
|
34
|
+
## Importing captions
|
|
35
|
+
|
|
36
|
+
To import captions from a .srt file, load the [./import-srt-captions.md](./import-srt-captions.md) file for more instructions.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tailwind
|
|
3
|
+
description: Using TailwindCSS in Remotion.
|
|
4
|
+
metadata:
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You can and should use TailwindCSS in Remotion, if TailwindCSS is installed in the project.
|
|
8
|
+
|
|
9
|
+
Don't use `transition-*` or `animate-*` classes - always animate using the `useCurrentFrame()` hook.
|
|
10
|
+
|
|
11
|
+
Tailwind must be installed and enabled first in a Remotion project - fetch https://www.remotion.dev/docs/tailwind using WebFetch for instructions.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: text-animations
|
|
3
|
+
description: Typography and text animation patterns for Remotion.
|
|
4
|
+
metadata:
|
|
5
|
+
tags: typography, text, typewriter, highlighter ken
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Text animations
|
|
9
|
+
|
|
10
|
+
Based on `useCurrentFrame()`, reduce the string character by character to create a typewriter effect.
|
|
11
|
+
|
|
12
|
+
## Typewriter Effect
|
|
13
|
+
|
|
14
|
+
See [Typewriter](assets/text-animations-typewriter.tsx) for an advanced example with a blinking cursor and a pause after the first sentence.
|
|
15
|
+
|
|
16
|
+
Always use string slicing for typewriter effects. Never use per-character opacity.
|
|
17
|
+
|
|
18
|
+
## Word Highlighting
|
|
19
|
+
|
|
20
|
+
See [Word Highlight](assets/text-animations-word-highlight.tsx) for an example for how a word highlight is animated, like with a highlighter pen.
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: timing
|
|
3
|
+
description: Interpolation curves in Remotion - linear, easing, spring animations
|
|
4
|
+
metadata:
|
|
5
|
+
tags: spring, bounce, easing, interpolation
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
A simple linear interpolation is done using the `interpolate` function.
|
|
9
|
+
|
|
10
|
+
```ts title="Going from 0 to 1 over 100 frames"
|
|
11
|
+
import { interpolate } from "remotion";
|
|
12
|
+
|
|
13
|
+
const opacity = interpolate(frame, [0, 100], [0, 1]);
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
By default, the values are not clamped, so the value can go outside the range [0, 1].
|
|
17
|
+
Here is how they can be clamped:
|
|
18
|
+
|
|
19
|
+
```ts title="Going from 0 to 1 over 100 frames with extrapolation"
|
|
20
|
+
const opacity = interpolate(frame, [0, 100], [0, 1], {
|
|
21
|
+
extrapolateRight: "clamp",
|
|
22
|
+
extrapolateLeft: "clamp",
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Spring animations
|
|
27
|
+
|
|
28
|
+
Spring animations have a more natural motion.
|
|
29
|
+
They go from 0 to 1 over time.
|
|
30
|
+
|
|
31
|
+
```ts title="Spring animation from 0 to 1 over 100 frames"
|
|
32
|
+
import { spring, useCurrentFrame, useVideoConfig } from "remotion";
|
|
33
|
+
|
|
34
|
+
const frame = useCurrentFrame();
|
|
35
|
+
const { fps } = useVideoConfig();
|
|
36
|
+
|
|
37
|
+
const scale = spring({
|
|
38
|
+
frame,
|
|
39
|
+
fps,
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Physical properties
|
|
44
|
+
|
|
45
|
+
The default configuration is: `mass: 1, damping: 10, stiffness: 100`.
|
|
46
|
+
This leads to the animation having a bit of bounce before it settles.
|
|
47
|
+
|
|
48
|
+
The config can be overwritten like this:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
const scale = spring({
|
|
52
|
+
frame,
|
|
53
|
+
fps,
|
|
54
|
+
config: { damping: 200 },
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The recommended configuration for a natural motion without a bounce is: `{ damping: 200 }`.
|
|
59
|
+
|
|
60
|
+
Here are some common configurations:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
const smooth = { damping: 200 }; // Smooth, no bounce (subtle reveals)
|
|
64
|
+
const snappy = { damping: 20, stiffness: 200 }; // Snappy, minimal bounce (UI elements)
|
|
65
|
+
const bouncy = { damping: 8 }; // Bouncy entrance (playful animations)
|
|
66
|
+
const heavy = { damping: 15, stiffness: 80, mass: 2 }; // Heavy, slow, small bounce
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Delay
|
|
70
|
+
|
|
71
|
+
The animation starts immediately by default.
|
|
72
|
+
Use the `delay` parameter to delay the animation by a number of frames.
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
const entrance = spring({
|
|
76
|
+
frame: frame - ENTRANCE_DELAY,
|
|
77
|
+
fps,
|
|
78
|
+
delay: 20,
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Duration
|
|
83
|
+
|
|
84
|
+
A `spring()` has a natural duration based on the physical properties.
|
|
85
|
+
To stretch the animation to a specific duration, use the `durationInFrames` parameter.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
const spring = spring({
|
|
89
|
+
frame,
|
|
90
|
+
fps,
|
|
91
|
+
durationInFrames: 40,
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Combining spring() with interpolate()
|
|
96
|
+
|
|
97
|
+
Map spring output (0-1) to custom ranges:
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
const springProgress = spring({
|
|
101
|
+
frame,
|
|
102
|
+
fps,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Map to rotation
|
|
106
|
+
const rotation = interpolate(springProgress, [0, 1], [0, 360]);
|
|
107
|
+
|
|
108
|
+
<div style={{ rotate: rotation + "deg" }} />;
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Adding springs
|
|
112
|
+
|
|
113
|
+
Springs return just numbers, so math can be performed:
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
const frame = useCurrentFrame();
|
|
117
|
+
const { fps, durationInFrames } = useVideoConfig();
|
|
118
|
+
|
|
119
|
+
const inAnimation = spring({
|
|
120
|
+
frame,
|
|
121
|
+
fps,
|
|
122
|
+
});
|
|
123
|
+
const outAnimation = spring({
|
|
124
|
+
frame,
|
|
125
|
+
fps,
|
|
126
|
+
durationInFrames: 1 * fps,
|
|
127
|
+
delay: durationInFrames - 1 * fps,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const scale = inAnimation - outAnimation;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Easing
|
|
134
|
+
|
|
135
|
+
Easing can be added to the `interpolate` function:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { interpolate, Easing } from "remotion";
|
|
139
|
+
|
|
140
|
+
const value1 = interpolate(frame, [0, 100], [0, 1], {
|
|
141
|
+
easing: Easing.inOut(Easing.quad),
|
|
142
|
+
extrapolateLeft: "clamp",
|
|
143
|
+
extrapolateRight: "clamp",
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The default easing is `Easing.linear`.
|
|
148
|
+
There are various other convexities:
|
|
149
|
+
|
|
150
|
+
- `Easing.in` for starting slow and accelerating
|
|
151
|
+
- `Easing.out` for starting fast and slowing down
|
|
152
|
+
- `Easing.inOut`
|
|
153
|
+
|
|
154
|
+
and curves (sorted from most linear to most curved):
|
|
155
|
+
|
|
156
|
+
- `Easing.quad`
|
|
157
|
+
- `Easing.sin`
|
|
158
|
+
- `Easing.exp`
|
|
159
|
+
- `Easing.circle`
|
|
160
|
+
|
|
161
|
+
Convexities and curves need be combined for an easing function:
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
const value1 = interpolate(frame, [0, 100], [0, 1], {
|
|
165
|
+
easing: Easing.inOut(Easing.quad),
|
|
166
|
+
extrapolateLeft: "clamp",
|
|
167
|
+
extrapolateRight: "clamp",
|
|
168
|
+
});
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Cubic bezier curves are also supported:
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
const value1 = interpolate(frame, [0, 100], [0, 1], {
|
|
175
|
+
easing: Easing.bezier(0.8, 0.22, 0.96, 0.65),
|
|
176
|
+
extrapolateLeft: "clamp",
|
|
177
|
+
extrapolateRight: "clamp",
|
|
178
|
+
});
|
|
179
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: transcribe-captions
|
|
3
|
+
description: Transcribing audio to generate captions in Remotion
|
|
4
|
+
metadata:
|
|
5
|
+
tags: captions, transcribe, whisper, audio, speech-to-text
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Transcribing audio
|
|
9
|
+
|
|
10
|
+
To transcribe audio to generate captions in Remotion, you can use the [`transcribe()`](https://www.remotion.dev/docs/install-whisper-cpp/transcribe) function from the [`@remotion/install-whisper-cpp`](https://www.remotion.dev/docs/install-whisper-cpp) package.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
First, the @remotion/install-whisper-cpp package needs to be installed.
|
|
15
|
+
If it is not installed, use the following command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx remotion add @remotion/install-whisper-cpp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Transcribing
|
|
22
|
+
|
|
23
|
+
Make a Node.js script to download Whisper.cpp and a model, and transcribe the audio.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import path from "path";
|
|
27
|
+
import {
|
|
28
|
+
downloadWhisperModel,
|
|
29
|
+
installWhisperCpp,
|
|
30
|
+
transcribe,
|
|
31
|
+
toCaptions,
|
|
32
|
+
} from "@remotion/install-whisper-cpp";
|
|
33
|
+
import fs from "fs";
|
|
34
|
+
|
|
35
|
+
const to = path.join(process.cwd(), "whisper.cpp");
|
|
36
|
+
|
|
37
|
+
await installWhisperCpp({
|
|
38
|
+
to,
|
|
39
|
+
version: "1.5.5",
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
await downloadWhisperModel({
|
|
43
|
+
model: "medium.en",
|
|
44
|
+
folder: to,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Convert the audio to a 16KHz wav file first if needed:
|
|
48
|
+
// import {execSync} from 'child_process';
|
|
49
|
+
// execSync('ffmpeg -i /path/to/audio.mp4 -ar 16000 /path/to/audio.wav -y');
|
|
50
|
+
|
|
51
|
+
const whisperCppOutput = await transcribe({
|
|
52
|
+
model: "medium.en",
|
|
53
|
+
whisperPath: to,
|
|
54
|
+
whisperCppVersion: "1.5.5",
|
|
55
|
+
inputPath: "/path/to/audio123.wav",
|
|
56
|
+
tokenLevelTimestamps: true,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Optional: Apply our recommended postprocessing
|
|
60
|
+
const { captions } = toCaptions({
|
|
61
|
+
whisperCppOutput,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Write it to the public/ folder so it can be fetched from Remotion
|
|
65
|
+
fs.writeFileSync("captions123.json", JSON.stringify(captions, null, 2));
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Transcribe each clip individually and create multiple JSON files.
|
|
69
|
+
|
|
70
|
+
See [Displaying captions](display-captions.md) for how to display the captions in Remotion.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: transitions
|
|
3
|
+
description: Scene transitions and overlays for Remotion using TransitionSeries.
|
|
4
|
+
metadata:
|
|
5
|
+
tags: transitions, overlays, fade, slide, wipe, scenes
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## TransitionSeries
|
|
9
|
+
|
|
10
|
+
`<TransitionSeries>` arranges scenes and supports two ways to enhance the cut point between them:
|
|
11
|
+
|
|
12
|
+
- **Transitions** (`<TransitionSeries.Transition>`) — crossfade, slide, wipe, etc. between two scenes. Shortens the timeline because both scenes play simultaneously during the transition.
|
|
13
|
+
- **Overlays** (`<TransitionSeries.Overlay>`) — render an effect (e.g. a light leak) on top of the cut point without shortening the timeline.
|
|
14
|
+
|
|
15
|
+
Children are absolutely positioned.
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx remotion add @remotion/transitions
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Transition example
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { TransitionSeries, linearTiming } from "@remotion/transitions";
|
|
27
|
+
import { fade } from "@remotion/transitions/fade";
|
|
28
|
+
|
|
29
|
+
<TransitionSeries>
|
|
30
|
+
<TransitionSeries.Sequence durationInFrames={60}>
|
|
31
|
+
<SceneA />
|
|
32
|
+
</TransitionSeries.Sequence>
|
|
33
|
+
<TransitionSeries.Transition
|
|
34
|
+
presentation={fade()}
|
|
35
|
+
timing={linearTiming({ durationInFrames: 15 })}
|
|
36
|
+
/>
|
|
37
|
+
<TransitionSeries.Sequence durationInFrames={60}>
|
|
38
|
+
<SceneB />
|
|
39
|
+
</TransitionSeries.Sequence>
|
|
40
|
+
</TransitionSeries>;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Overlay example
|
|
44
|
+
|
|
45
|
+
Any React component can be used as an overlay. For a ready-made effect, see the **light-leaks** rule.
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { TransitionSeries } from "@remotion/transitions";
|
|
49
|
+
import { LightLeak } from "@remotion/light-leaks";
|
|
50
|
+
|
|
51
|
+
<TransitionSeries>
|
|
52
|
+
<TransitionSeries.Sequence durationInFrames={60}>
|
|
53
|
+
<SceneA />
|
|
54
|
+
</TransitionSeries.Sequence>
|
|
55
|
+
<TransitionSeries.Overlay durationInFrames={20}>
|
|
56
|
+
<LightLeak />
|
|
57
|
+
</TransitionSeries.Overlay>
|
|
58
|
+
<TransitionSeries.Sequence durationInFrames={60}>
|
|
59
|
+
<SceneB />
|
|
60
|
+
</TransitionSeries.Sequence>
|
|
61
|
+
</TransitionSeries>;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Mixing transitions and overlays
|
|
65
|
+
|
|
66
|
+
Transitions and overlays can coexist in the same `<TransitionSeries>`, but an overlay cannot be adjacent to a transition or another overlay.
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { TransitionSeries, linearTiming } from "@remotion/transitions";
|
|
70
|
+
import { fade } from "@remotion/transitions/fade";
|
|
71
|
+
import { LightLeak } from "@remotion/light-leaks";
|
|
72
|
+
|
|
73
|
+
<TransitionSeries>
|
|
74
|
+
<TransitionSeries.Sequence durationInFrames={60}>
|
|
75
|
+
<SceneA />
|
|
76
|
+
</TransitionSeries.Sequence>
|
|
77
|
+
<TransitionSeries.Overlay durationInFrames={30}>
|
|
78
|
+
<LightLeak />
|
|
79
|
+
</TransitionSeries.Overlay>
|
|
80
|
+
<TransitionSeries.Sequence durationInFrames={60}>
|
|
81
|
+
<SceneB />
|
|
82
|
+
</TransitionSeries.Sequence>
|
|
83
|
+
<TransitionSeries.Transition
|
|
84
|
+
presentation={fade()}
|
|
85
|
+
timing={linearTiming({ durationInFrames: 15 })}
|
|
86
|
+
/>
|
|
87
|
+
<TransitionSeries.Sequence durationInFrames={60}>
|
|
88
|
+
<SceneC />
|
|
89
|
+
</TransitionSeries.Sequence>
|
|
90
|
+
</TransitionSeries>;
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Transition props
|
|
94
|
+
|
|
95
|
+
`<TransitionSeries.Transition>` requires:
|
|
96
|
+
|
|
97
|
+
- `presentation` — the visual effect (e.g. `fade()`, `slide()`, `wipe()`).
|
|
98
|
+
- `timing` — controls speed and easing (e.g. `linearTiming()`, `springTiming()`).
|
|
99
|
+
|
|
100
|
+
## Overlay props
|
|
101
|
+
|
|
102
|
+
`<TransitionSeries.Overlay>` accepts:
|
|
103
|
+
|
|
104
|
+
- `durationInFrames` — how long the overlay is visible (positive integer).
|
|
105
|
+
- `offset?` — shifts the overlay relative to the cut point center. Positive = later, negative = earlier. Default: `0`.
|
|
106
|
+
|
|
107
|
+
## Available transition types
|
|
108
|
+
|
|
109
|
+
Import transitions from their respective modules:
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import { fade } from "@remotion/transitions/fade";
|
|
113
|
+
import { slide } from "@remotion/transitions/slide";
|
|
114
|
+
import { wipe } from "@remotion/transitions/wipe";
|
|
115
|
+
import { flip } from "@remotion/transitions/flip";
|
|
116
|
+
import { clockWipe } from "@remotion/transitions/clock-wipe";
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Slide transition with direction
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { slide } from "@remotion/transitions/slide";
|
|
123
|
+
|
|
124
|
+
<TransitionSeries.Transition
|
|
125
|
+
presentation={slide({ direction: "from-left" })}
|
|
126
|
+
timing={linearTiming({ durationInFrames: 20 })}
|
|
127
|
+
/>;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Directions: `"from-left"`, `"from-right"`, `"from-top"`, `"from-bottom"`
|
|
131
|
+
|
|
132
|
+
## Timing options
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { linearTiming, springTiming } from "@remotion/transitions";
|
|
136
|
+
|
|
137
|
+
// Linear timing - constant speed
|
|
138
|
+
linearTiming({ durationInFrames: 20 });
|
|
139
|
+
|
|
140
|
+
// Spring timing - organic motion
|
|
141
|
+
springTiming({ config: { damping: 200 }, durationInFrames: 25 });
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Duration calculation
|
|
145
|
+
|
|
146
|
+
Transitions overlap adjacent scenes, so the total composition length is **shorter** than the sum of all sequence durations. Overlays do **not** affect the total duration.
|
|
147
|
+
|
|
148
|
+
For example, with two 60-frame sequences and a 15-frame transition:
|
|
149
|
+
|
|
150
|
+
- Without transitions: `60 + 60 = 120` frames
|
|
151
|
+
- With transition: `60 + 60 - 15 = 105` frames
|
|
152
|
+
|
|
153
|
+
Adding an overlay between two other sequences does not change the total.
|
|
154
|
+
|
|
155
|
+
### Getting the duration of a transition
|
|
156
|
+
|
|
157
|
+
Use the `getDurationInFrames()` method on the timing object:
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
import { linearTiming, springTiming } from "@remotion/transitions";
|
|
161
|
+
|
|
162
|
+
const linearDuration = linearTiming({
|
|
163
|
+
durationInFrames: 20,
|
|
164
|
+
}).getDurationInFrames({ fps: 30 });
|
|
165
|
+
// Returns 20
|
|
166
|
+
|
|
167
|
+
const springDuration = springTiming({
|
|
168
|
+
config: { damping: 200 },
|
|
169
|
+
}).getDurationInFrames({ fps: 30 });
|
|
170
|
+
// Returns calculated duration based on spring physics
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
For `springTiming` without an explicit `durationInFrames`, the duration depends on `fps` because it calculates when the spring animation settles.
|
|
174
|
+
|
|
175
|
+
### Calculating total composition duration
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { linearTiming } from "@remotion/transitions";
|
|
179
|
+
|
|
180
|
+
const scene1Duration = 60;
|
|
181
|
+
const scene2Duration = 60;
|
|
182
|
+
const scene3Duration = 60;
|
|
183
|
+
|
|
184
|
+
const timing1 = linearTiming({ durationInFrames: 15 });
|
|
185
|
+
const timing2 = linearTiming({ durationInFrames: 20 });
|
|
186
|
+
|
|
187
|
+
const transition1Duration = timing1.getDurationInFrames({ fps: 30 });
|
|
188
|
+
const transition2Duration = timing2.getDurationInFrames({ fps: 30 });
|
|
189
|
+
|
|
190
|
+
const totalDuration =
|
|
191
|
+
scene1Duration +
|
|
192
|
+
scene2Duration +
|
|
193
|
+
scene3Duration -
|
|
194
|
+
transition1Duration -
|
|
195
|
+
transition2Duration;
|
|
196
|
+
// 60 + 60 + 60 - 15 - 20 = 145 frames
|
|
197
|
+
```
|