@brunosps00/dev-workflow 0.0.5 → 0.0.7
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/dev-workflow.js +6 -4
- package/lib/constants.js +11 -0
- package/lib/init.js +36 -12
- package/lib/wrappers.js +8 -2
- package/package.json +1 -1
- package/scaffold/pt-br/commands/dw-analyze-project.md +3 -3
- package/scaffold/pt-br/commands/dw-bugfix.md +6 -6
- package/scaffold/pt-br/commands/dw-code-review.md +2 -2
- package/scaffold/pt-br/commands/dw-create-tasks.md +4 -4
- package/scaffold/pt-br/commands/dw-generate-pr.md +3 -3
- package/scaffold/pt-br/commands/dw-help.md +50 -50
- package/scaffold/pt-br/commands/dw-review-implementation.md +3 -3
- package/scaffold/pt-br/commands/dw-run-plan.md +8 -8
- package/scaffold/pt-br/commands/dw-run-task.md +3 -3
- package/scaffold/pt-br/templates/tasks-template.md +2 -2
- package/scaffold/skills/agent-browser/SKILL.md +750 -0
- package/scaffold/skills/agent-browser/references/authentication.md +303 -0
- package/scaffold/skills/agent-browser/references/commands.md +295 -0
- package/scaffold/skills/agent-browser/references/profiling.md +120 -0
- package/scaffold/skills/agent-browser/references/proxy-support.md +194 -0
- package/scaffold/skills/agent-browser/references/session-management.md +193 -0
- package/scaffold/skills/agent-browser/references/snapshot-refs.md +219 -0
- package/scaffold/skills/agent-browser/references/video-recording.md +173 -0
- package/scaffold/skills/agent-browser/templates/authenticated-session.sh +105 -0
- package/scaffold/skills/agent-browser/templates/capture-workflow.sh +69 -0
- package/scaffold/skills/agent-browser/templates/form-automation.sh +62 -0
- package/scaffold/skills/humanizer/README.md +143 -0
- package/scaffold/skills/humanizer/SKILL.md +488 -0
- package/scaffold/skills/humanizer/WARP.md +53 -0
- package/scaffold/skills/remotion-best-practices/SKILL.md +61 -0
- package/scaffold/skills/remotion-best-practices/rules/3d.md +86 -0
- package/scaffold/skills/remotion-best-practices/rules/animations.md +27 -0
- package/scaffold/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/scaffold/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/scaffold/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
- package/scaffold/skills/remotion-best-practices/rules/assets.md +78 -0
- package/scaffold/skills/remotion-best-practices/rules/audio-visualization.md +198 -0
- package/scaffold/skills/remotion-best-practices/rules/audio.md +169 -0
- package/scaffold/skills/remotion-best-practices/rules/calculate-metadata.md +134 -0
- package/scaffold/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/scaffold/skills/remotion-best-practices/rules/charts.md +120 -0
- package/scaffold/skills/remotion-best-practices/rules/compositions.md +154 -0
- package/scaffold/skills/remotion-best-practices/rules/display-captions.md +184 -0
- package/scaffold/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/scaffold/skills/remotion-best-practices/rules/ffmpeg.md +38 -0
- package/scaffold/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/scaffold/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/scaffold/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/scaffold/skills/remotion-best-practices/rules/get-video-duration.md +60 -0
- package/scaffold/skills/remotion-best-practices/rules/gifs.md +141 -0
- package/scaffold/skills/remotion-best-practices/rules/images.md +134 -0
- package/scaffold/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/scaffold/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/scaffold/skills/remotion-best-practices/rules/lottie.md +70 -0
- package/scaffold/skills/remotion-best-practices/rules/maps.md +412 -0
- package/scaffold/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/scaffold/skills/remotion-best-practices/rules/measuring-text.md +140 -0
- package/scaffold/skills/remotion-best-practices/rules/parameters.md +109 -0
- package/scaffold/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/scaffold/skills/remotion-best-practices/rules/sfx.md +26 -0
- package/scaffold/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/scaffold/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/scaffold/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/scaffold/skills/remotion-best-practices/rules/timing.md +179 -0
- package/scaffold/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/scaffold/skills/remotion-best-practices/rules/transitions.md +197 -0
- package/scaffold/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/scaffold/skills/remotion-best-practices/rules/trimming.md +51 -0
- package/scaffold/skills/remotion-best-practices/rules/videos.md +171 -0
- package/scaffold/skills/remotion-best-practices/rules/voiceover.md +99 -0
- package/scaffold/skills/security-review/LICENSE +22 -0
- package/scaffold/skills/security-review/SKILL.md +312 -0
- package/scaffold/skills/security-review/infrastructure/docker.md +432 -0
- package/scaffold/skills/security-review/languages/javascript.md +388 -0
- package/scaffold/skills/security-review/languages/python.md +363 -0
- package/scaffold/skills/security-review/references/api-security.md +519 -0
- package/scaffold/skills/security-review/references/authentication.md +353 -0
- package/scaffold/skills/security-review/references/authorization.md +372 -0
- package/scaffold/skills/security-review/references/business-logic.md +443 -0
- package/scaffold/skills/security-review/references/cryptography.md +329 -0
- package/scaffold/skills/security-review/references/csrf.md +398 -0
- package/scaffold/skills/security-review/references/data-protection.md +378 -0
- package/scaffold/skills/security-review/references/deserialization.md +410 -0
- package/scaffold/skills/security-review/references/error-handling.md +436 -0
- package/scaffold/skills/security-review/references/file-security.md +457 -0
- package/scaffold/skills/security-review/references/injection.md +259 -0
- package/scaffold/skills/security-review/references/logging.md +433 -0
- package/scaffold/skills/security-review/references/misconfiguration.md +435 -0
- package/scaffold/skills/security-review/references/modern-threats.md +475 -0
- package/scaffold/skills/security-review/references/ssrf.md +415 -0
- package/scaffold/skills/security-review/references/supply-chain.md +405 -0
- package/scaffold/skills/security-review/references/xss.md +336 -0
- package/scaffold/skills/vercel-react-best-practices/AGENTS.md +3648 -0
- package/scaffold/skills/vercel-react-best-practices/README.md +123 -0
- package/scaffold/skills/vercel-react-best-practices/SKILL.md +146 -0
- package/scaffold/skills/vercel-react-best-practices/rules/_sections.md +46 -0
- package/scaffold/skills/vercel-react-best-practices/rules/_template.md +28 -0
- package/scaffold/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/scaffold/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/scaffold/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/scaffold/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/scaffold/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +37 -0
- package/scaffold/skills/vercel-react-best-practices/rules/async-defer-await.md +82 -0
- package/scaffold/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/scaffold/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/scaffold/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/scaffold/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +60 -0
- package/scaffold/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/scaffold/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/scaffold/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/scaffold/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/scaffold/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/scaffold/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/scaffold/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/scaffold/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +60 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-request-idle-callback.md +105 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/scaffold/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +85 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +68 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +82 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +64 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md +59 -0
- package/scaffold/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +149 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +34 -0
- package/scaffold/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/scaffold/skills/webapp-testing/SKILL.md +133 -0
- package/scaffold/skills/webapp-testing/assets/test-helper.js +56 -0
|
@@ -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
|
+
```
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: transparent-videos
|
|
3
|
+
description: Rendering transparent videos in Remotion
|
|
4
|
+
metadata:
|
|
5
|
+
tags: transparent, alpha, codec, vp9, prores, webm
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Rendering Transparent Videos
|
|
9
|
+
|
|
10
|
+
Remotion can render transparent videos in two ways: as a ProRes video or as a WebM video.
|
|
11
|
+
|
|
12
|
+
## Transparent ProRes
|
|
13
|
+
|
|
14
|
+
Ideal for when importing into video editing software.
|
|
15
|
+
|
|
16
|
+
**CLI:**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx remotion render --image-format=png --pixel-format=yuva444p10le --codec=prores --prores-profile=4444 MyComp out.mov
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Default in Studio** (restart Studio after changing):
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
// remotion.config.ts
|
|
26
|
+
import { Config } from "@remotion/cli/config";
|
|
27
|
+
|
|
28
|
+
Config.setVideoImageFormat("png");
|
|
29
|
+
Config.setPixelFormat("yuva444p10le");
|
|
30
|
+
Config.setCodec("prores");
|
|
31
|
+
Config.setProResProfile("4444");
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Setting it as the default export settings for a composition** (using `calculateMetadata`):
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { CalculateMetadataFunction } from "remotion";
|
|
38
|
+
|
|
39
|
+
const calculateMetadata: CalculateMetadataFunction<Props> = async ({
|
|
40
|
+
props,
|
|
41
|
+
}) => {
|
|
42
|
+
return {
|
|
43
|
+
defaultCodec: "prores",
|
|
44
|
+
defaultVideoImageFormat: "png",
|
|
45
|
+
defaultPixelFormat: "yuva444p10le",
|
|
46
|
+
defaultProResProfile: "4444",
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
<Composition
|
|
51
|
+
id="my-video"
|
|
52
|
+
component={MyVideo}
|
|
53
|
+
durationInFrames={150}
|
|
54
|
+
fps={30}
|
|
55
|
+
width={1920}
|
|
56
|
+
height={1080}
|
|
57
|
+
calculateMetadata={calculateMetadata}
|
|
58
|
+
/>;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Transparent WebM (VP9)
|
|
62
|
+
|
|
63
|
+
Ideal for when playing in a browser.
|
|
64
|
+
|
|
65
|
+
**CLI:**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx remotion render --image-format=png --pixel-format=yuva420p --codec=vp9 MyComp out.webm
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Default in Studio** (restart Studio after changing):
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
// remotion.config.ts
|
|
75
|
+
import { Config } from "@remotion/cli/config";
|
|
76
|
+
|
|
77
|
+
Config.setVideoImageFormat("png");
|
|
78
|
+
Config.setPixelFormat("yuva420p");
|
|
79
|
+
Config.setCodec("vp9");
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Setting it as the default export settings for a composition** (using `calculateMetadata`):
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { CalculateMetadataFunction } from "remotion";
|
|
86
|
+
|
|
87
|
+
const calculateMetadata: CalculateMetadataFunction<Props> = async ({
|
|
88
|
+
props,
|
|
89
|
+
}) => {
|
|
90
|
+
return {
|
|
91
|
+
defaultCodec: "vp8",
|
|
92
|
+
defaultVideoImageFormat: "png",
|
|
93
|
+
defaultPixelFormat: "yuva420p",
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
<Composition
|
|
98
|
+
id="my-video"
|
|
99
|
+
component={MyVideo}
|
|
100
|
+
durationInFrames={150}
|
|
101
|
+
fps={30}
|
|
102
|
+
width={1920}
|
|
103
|
+
height={1080}
|
|
104
|
+
calculateMetadata={calculateMetadata}
|
|
105
|
+
/>;
|
|
106
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trimming
|
|
3
|
+
description: Trimming patterns for Remotion - cut the beginning or end of animations
|
|
4
|
+
metadata:
|
|
5
|
+
tags: sequence, trim, clip, cut, offset
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use `<Sequence>` with a negative `from` value to trim the start of an animation.
|
|
9
|
+
|
|
10
|
+
## Trim the Beginning
|
|
11
|
+
|
|
12
|
+
A negative `from` value shifts time backwards, making the animation start partway through:
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { Sequence, useVideoConfig } from "remotion";
|
|
16
|
+
|
|
17
|
+
const fps = useVideoConfig();
|
|
18
|
+
|
|
19
|
+
<Sequence from={-0.5 * fps}>
|
|
20
|
+
<MyAnimation />
|
|
21
|
+
</Sequence>;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The animation appears 15 frames into its progress - the first 15 frames are trimmed off.
|
|
25
|
+
Inside `<MyAnimation>`, `useCurrentFrame()` starts at 15 instead of 0.
|
|
26
|
+
|
|
27
|
+
## Trim the End
|
|
28
|
+
|
|
29
|
+
Use `durationInFrames` to unmount content after a specified duration:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<Sequence durationInFrames={1.5 * fps}>
|
|
33
|
+
<MyAnimation />
|
|
34
|
+
</Sequence>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The animation plays for 45 frames, then the component unmounts.
|
|
38
|
+
|
|
39
|
+
## Trim and Delay
|
|
40
|
+
|
|
41
|
+
Nest sequences to both trim the beginning and delay when it appears:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<Sequence from={30}>
|
|
45
|
+
<Sequence from={-15}>
|
|
46
|
+
<MyAnimation />
|
|
47
|
+
</Sequence>
|
|
48
|
+
</Sequence>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The inner sequence trims 15 frames from the start, and the outer sequence delays the result by 30 frames.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: videos
|
|
3
|
+
description: Embedding videos in Remotion - trimming, volume, speed, looping, pitch
|
|
4
|
+
metadata:
|
|
5
|
+
tags: video, media, trim, volume, speed, loop, pitch
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Using videos in Remotion
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
First, the @remotion/media package needs to be installed.
|
|
13
|
+
If it is not, use the following command:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx remotion add @remotion/media # If project uses npm
|
|
17
|
+
bunx remotion add @remotion/media # If project uses bun
|
|
18
|
+
yarn remotion add @remotion/media # If project uses yarn
|
|
19
|
+
pnpm exec remotion add @remotion/media # If project uses pnpm
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use `<Video>` from `@remotion/media` to embed videos into your composition.
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Video } from "@remotion/media";
|
|
26
|
+
import { staticFile } from "remotion";
|
|
27
|
+
|
|
28
|
+
export const MyComposition = () => {
|
|
29
|
+
return <Video src={staticFile("video.mp4")} />;
|
|
30
|
+
};
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Remote URLs are also supported:
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<Video src="https://remotion.media/video.mp4" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Trimming
|
|
40
|
+
|
|
41
|
+
Use `trimBefore` and `trimAfter` to remove portions of the video. Values are in seconds.
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
const { fps } = useVideoConfig();
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Video
|
|
48
|
+
src={staticFile("video.mp4")}
|
|
49
|
+
trimBefore={2 * fps} // Skip the first 2 seconds
|
|
50
|
+
trimAfter={10 * fps} // End at the 10 second mark
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Delaying
|
|
56
|
+
|
|
57
|
+
Wrap the video in a `<Sequence>` to delay when it appears:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { Sequence, staticFile } from "remotion";
|
|
61
|
+
import { Video } from "@remotion/media";
|
|
62
|
+
|
|
63
|
+
const { fps } = useVideoConfig();
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<Sequence from={1 * fps}>
|
|
67
|
+
<Video src={staticFile("video.mp4")} />
|
|
68
|
+
</Sequence>
|
|
69
|
+
);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The video will appear after 1 second.
|
|
73
|
+
|
|
74
|
+
## Sizing and Position
|
|
75
|
+
|
|
76
|
+
Use the `style` prop to control size and position:
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
<Video
|
|
80
|
+
src={staticFile("video.mp4")}
|
|
81
|
+
style={{
|
|
82
|
+
width: 500,
|
|
83
|
+
height: 300,
|
|
84
|
+
position: "absolute",
|
|
85
|
+
top: 100,
|
|
86
|
+
left: 50,
|
|
87
|
+
objectFit: "cover",
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Volume
|
|
93
|
+
|
|
94
|
+
Set a static volume (0 to 1):
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<Video src={staticFile("video.mp4")} volume={0.5} />
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Or use a callback for dynamic volume based on the current frame:
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { interpolate } from "remotion";
|
|
104
|
+
|
|
105
|
+
const { fps } = useVideoConfig();
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<Video
|
|
109
|
+
src={staticFile("video.mp4")}
|
|
110
|
+
volume={(f) =>
|
|
111
|
+
interpolate(f, [0, 1 * fps], [0, 1], { extrapolateRight: "clamp" })
|
|
112
|
+
}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Use `muted` to silence the video entirely:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<Video src={staticFile("video.mp4")} muted />
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Speed
|
|
124
|
+
|
|
125
|
+
Use `playbackRate` to change the playback speed:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
<Video src={staticFile("video.mp4")} playbackRate={2} /> {/* 2x speed */}
|
|
129
|
+
<Video src={staticFile("video.mp4")} playbackRate={0.5} /> {/* Half speed */}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Reverse playback is not supported.
|
|
133
|
+
|
|
134
|
+
## Looping
|
|
135
|
+
|
|
136
|
+
Use `loop` to loop the video indefinitely:
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
<Video src={staticFile("video.mp4")} loop />
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use `loopVolumeCurveBehavior` to control how the frame count behaves when looping:
|
|
143
|
+
|
|
144
|
+
- `"repeat"`: Frame count resets to 0 each loop (for `volume` callback)
|
|
145
|
+
- `"extend"`: Frame count continues incrementing
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
<Video
|
|
149
|
+
src={staticFile("video.mp4")}
|
|
150
|
+
loop
|
|
151
|
+
loopVolumeCurveBehavior="extend"
|
|
152
|
+
volume={(f) => interpolate(f, [0, 300], [1, 0])} // Fade out over multiple loops
|
|
153
|
+
/>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Pitch
|
|
157
|
+
|
|
158
|
+
Use `toneFrequency` to adjust the pitch without affecting speed. Values range from 0.01 to 2:
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
<Video
|
|
162
|
+
src={staticFile("video.mp4")}
|
|
163
|
+
toneFrequency={1.5} // Higher pitch
|
|
164
|
+
/>
|
|
165
|
+
<Video
|
|
166
|
+
src={staticFile("video.mp4")}
|
|
167
|
+
toneFrequency={0.8} // Lower pitch
|
|
168
|
+
/>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Pitch shifting only works during server-side rendering, not in the Remotion Studio preview or in the `<Player />`.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: voiceover
|
|
3
|
+
description: Adding AI-generated voiceover to Remotion compositions using ElevenLabs TTS
|
|
4
|
+
metadata:
|
|
5
|
+
tags: voiceover, audio, elevenlabs, tts, speech, calculateMetadata, dynamic duration
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Adding AI voiceover to a Remotion composition
|
|
9
|
+
|
|
10
|
+
Use ElevenLabs TTS to generate speech audio per scene, then use [`calculateMetadata`](./calculate-metadata) to dynamically size the composition to match the audio.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
An **ElevenLabs API key** is required (`ELEVENLABS_API_KEY` environment variable).
|
|
15
|
+
|
|
16
|
+
**MUST** ask the user for their ElevenLabs API key if `ELEVENLABS_API_KEY` is not set. **MUST NOT** fall back to other TTS tools.
|
|
17
|
+
|
|
18
|
+
Ensure the environment variable is available when running the generation script:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
node --strip-types generate-voiceover.ts
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Generating audio with ElevenLabs
|
|
25
|
+
|
|
26
|
+
Create a script that reads the config, calls the ElevenLabs API for each scene, and writes MP3 files to the `public/` directory so Remotion can access them via `staticFile()`.
|
|
27
|
+
|
|
28
|
+
The core API call for a single scene:
|
|
29
|
+
|
|
30
|
+
```ts title="generate-voiceover.ts"
|
|
31
|
+
const response = await fetch(
|
|
32
|
+
`https://api.elevenlabs.io/v1/text-to-speech/${voiceId}`,
|
|
33
|
+
{
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: {
|
|
36
|
+
"xi-api-key": process.env.ELEVENLABS_API_KEY!,
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
|
+
Accept: "audio/mpeg",
|
|
39
|
+
},
|
|
40
|
+
body: JSON.stringify({
|
|
41
|
+
text: "Welcome to the show.",
|
|
42
|
+
model_id: "eleven_multilingual_v2",
|
|
43
|
+
voice_settings: {
|
|
44
|
+
stability: 0.5,
|
|
45
|
+
similarity_boost: 0.75,
|
|
46
|
+
style: 0.3,
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const audioBuffer = Buffer.from(await response.arrayBuffer());
|
|
53
|
+
writeFileSync(`public/voiceover/${compositionId}/${scene.id}.mp3`, audioBuffer);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Dynamic composition duration with calculateMetadata
|
|
57
|
+
|
|
58
|
+
Use [`calculateMetadata`](./calculate-metadata.md) to measure the [audio durations](./get-audio-duration.md) and set the composition length accordingly.
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { CalculateMetadataFunction, staticFile } from "remotion";
|
|
62
|
+
import { getAudioDuration } from "./get-audio-duration";
|
|
63
|
+
|
|
64
|
+
const FPS = 30;
|
|
65
|
+
|
|
66
|
+
const SCENE_AUDIO_FILES = [
|
|
67
|
+
"voiceover/my-comp/scene-01-intro.mp3",
|
|
68
|
+
"voiceover/my-comp/scene-02-main.mp3",
|
|
69
|
+
"voiceover/my-comp/scene-03-outro.mp3",
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
export const calculateMetadata: CalculateMetadataFunction<Props> = async ({
|
|
73
|
+
props,
|
|
74
|
+
}) => {
|
|
75
|
+
const durations = await Promise.all(
|
|
76
|
+
SCENE_AUDIO_FILES.map((file) => getAudioDuration(staticFile(file))),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const sceneDurations = durations.map((durationInSeconds) => {
|
|
80
|
+
return durationInSeconds * FPS;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
durationInFrames: Math.ceil(sceneDurations.reduce((sum, d) => sum + d, 0)),
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The computed `sceneDurations` are passed into the component via a `voiceover` prop so the component knows how long each scene should be.
|
|
90
|
+
|
|
91
|
+
If the composition uses [`<TransitionSeries>`](./transitions.md), subtract the overlap from total duration: [./transitions.md#calculating-total-composition-duration](./transitions.md#calculating-total-composition-duration)
|
|
92
|
+
|
|
93
|
+
## Rendering audio in the component
|
|
94
|
+
|
|
95
|
+
See [audio.md](./audio.md) for more information on how to render audio in the component.
|
|
96
|
+
|
|
97
|
+
## Delaying audio start
|
|
98
|
+
|
|
99
|
+
See [audio.md#delaying](./audio.md#delaying) for more information on how to delay the audio start.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The reference material in this skill is derived from the OWASP Cheat Sheet Series.
|
|
2
|
+
|
|
3
|
+
Source: https://cheatsheetseries.owasp.org/
|
|
4
|
+
OWASP Foundation: https://owasp.org/
|
|
5
|
+
|
|
6
|
+
Original content is licensed under:
|
|
7
|
+
|
|
8
|
+
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
|
9
|
+
https://creativecommons.org/licenses/by-sa/4.0/
|
|
10
|
+
|
|
11
|
+
You are free to:
|
|
12
|
+
- Share — copy and redistribute the material in any medium or format
|
|
13
|
+
- Adapt — remix, transform, and build upon the material for any purpose,
|
|
14
|
+
even commercially
|
|
15
|
+
|
|
16
|
+
Under the following terms:
|
|
17
|
+
- Attribution — You must give appropriate credit, provide a link to the
|
|
18
|
+
license, and indicate if changes were made.
|
|
19
|
+
- ShareAlike — If you remix, transform, or build upon the material, you
|
|
20
|
+
must distribute your contributions under the same license as the original.
|
|
21
|
+
|
|
22
|
+
Full license text: https://creativecommons.org/licenses/by-sa/4.0/legalcode
|