@kolbo/kolbo-code-darwin-x64-baseline 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 +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,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 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
|
+
By default this guide uses **ElevenLabs** as the TTS provider (`ELEVENLABS_API_KEY` environment variable). Users may substitute any TTS service that can produce an audio file.
|
|
15
|
+
|
|
16
|
+
If the user has not specified a TTS provider, recommend ElevenLabs and ask for their API key.
|
|
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,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: video-production
|
|
3
|
+
description: >
|
|
4
|
+
Full-stack video production assistant. Analyzes talking head footage,
|
|
5
|
+
generates transcriptions/SRT subtitles, plans and creates motion graphics (Remotion),
|
|
6
|
+
generates B-roll images/videos, produces timeline XMLs for Premiere/DaVinci.
|
|
7
|
+
Use for: video analysis, transcription, subtitles, motion graphics, B-roll, shorts,
|
|
8
|
+
timeline XML, clip cutting, silence removal, After Effects, Premiere Pro, DaVinci Resolve.
|
|
9
|
+
Keywords: video edit, ffmpeg, remotion, after effects, premiere, davinci, shorts, subtitles,
|
|
10
|
+
motion graphics, clip, render, transcribe, xml, timeline, b-roll, talking head, analyze
|
|
11
|
+
allowed-tools:
|
|
12
|
+
- Read
|
|
13
|
+
- Write
|
|
14
|
+
- Edit
|
|
15
|
+
- Bash
|
|
16
|
+
- Glob
|
|
17
|
+
- Grep
|
|
18
|
+
- Agent
|
|
19
|
+
- AskUserQuestion
|
|
20
|
+
- TaskCreate
|
|
21
|
+
- TaskUpdate
|
|
22
|
+
- WebFetch
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Video Production — Strategy Map
|
|
26
|
+
|
|
27
|
+
## Pipeline
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Input video → Transcribe → Analyze → Plan segments
|
|
31
|
+
→ Generate: Remotion compositions | B-roll | SRT subtitles
|
|
32
|
+
→ Output: Premiere XML / DaVinci EDL / individual MP4s / SRT
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## APIs & Capabilities
|
|
36
|
+
|
|
37
|
+
| Service | Use |
|
|
38
|
+
|---------|-----|
|
|
39
|
+
| ElevenLabs Scribe | Primary transcription — word-level SRT, multilingual |
|
|
40
|
+
| Claude | Content analysis, edit planning |
|
|
41
|
+
| Google Gemini | Video understanding, visual analysis |
|
|
42
|
+
| fal.ai (MCP) | Image & video B-roll generation |
|
|
43
|
+
| Runway | Image-to-video, video-to-video |
|
|
44
|
+
| FLUX / BFL | High quality still image generation |
|
|
45
|
+
| ElevenLabs | TTS, voice cloning, SFX |
|
|
46
|
+
| Suno | Background music generation |
|
|
47
|
+
| Remotion Lambda | Cloud render motion graphics |
|
|
48
|
+
|
|
49
|
+
> Load API keys from the project's `.env` file or environment variables.
|
|
50
|
+
|
|
51
|
+
## Key Rules
|
|
52
|
+
|
|
53
|
+
- **FFmpeg on Windows**: always copy inputs to `tempfile.mkdtemp()` first (handles spaces in paths)
|
|
54
|
+
- **9:16 shorts**: blurred background + centered content — never crop the original
|
|
55
|
+
- **Hebrew / RTL subtitles**: ASS format, Heebo Bold font, `\pos()` for RTL rendering
|
|
56
|
+
- **Video quality standard**: `-c:v libx264 -crf 18 -c:a aac -b:a 128k`
|
|
57
|
+
- **Image generation**: prefer fal MCP server over Python scripts when available
|
|
58
|
+
- **Silence removal**: `silencedetect -35dB:d=0.4` → trim+concat → `atempo=1.14`
|
|
59
|
+
|
|
60
|
+
## Transcription
|
|
61
|
+
|
|
62
|
+
Use ElevenLabs Scribe for word-level SRT with speaker diarization:
|
|
63
|
+
```python
|
|
64
|
+
import requests
|
|
65
|
+
|
|
66
|
+
def transcribe(audio_path, api_key, language="he"):
|
|
67
|
+
with open(audio_path, "rb") as f:
|
|
68
|
+
response = requests.post(
|
|
69
|
+
"https://api.elevenlabs.io/v1/speech-to-text",
|
|
70
|
+
headers={"xi-api-key": api_key},
|
|
71
|
+
files={"file": f},
|
|
72
|
+
data={"model_id": "scribe_v1", "language_code": language,
|
|
73
|
+
"timestamps_granularity": "word", "diarize": True}
|
|
74
|
+
)
|
|
75
|
+
return response.json()
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 9:16 Shorts — Blurred Background
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
filter_complex = (
|
|
82
|
+
"[0:v]split[bg][fg];"
|
|
83
|
+
"[bg]scale=1080:1920:force_original_aspect_ratio=increase,"
|
|
84
|
+
"crop=1080:1920,gblur=sigma=40[blurred];"
|
|
85
|
+
"[fg]scale=1080:1920:force_original_aspect_ratio=decrease,"
|
|
86
|
+
"pad=1080:1920:(ow-iw)/2:(oh-ih)/2:color=black@0[front];"
|
|
87
|
+
"[blurred][front]overlay=0:0"
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Silence Removal
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import subprocess, json
|
|
95
|
+
|
|
96
|
+
def detect_silence(video_path, noise_db=-35, duration=0.4):
|
|
97
|
+
result = subprocess.run([
|
|
98
|
+
"ffmpeg", "-i", video_path,
|
|
99
|
+
"-af", f"silencedetect=noise={noise_db}dB:d={duration}",
|
|
100
|
+
"-f", "null", "-"
|
|
101
|
+
], capture_output=True, text=True)
|
|
102
|
+
# Parse silence_start/silence_end from stderr
|
|
103
|
+
...
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## RTL (Hebrew/Arabic) Subtitles
|
|
107
|
+
|
|
108
|
+
SRT with `subtitles` filter works for basic burn. For per-word karaoke highlighting with RTL:
|
|
109
|
+
|
|
110
|
+
- Each word gets its own ASS `Dialogue` line with explicit `\pos(x,y)`
|
|
111
|
+
- Use PIL to measure word widths: apply `~0.74` scale factor (PIL→libass calibration)
|
|
112
|
+
- Use `Alignment=7` (top-left anchor) so `\pos` sets exact top-left of each word
|
|
113
|
+
- Set `Encoding=177` (Hebrew) in ASS style
|
|
114
|
+
- Strip punctuation and render as separate positioned elements
|
|
115
|
+
- Two ASS styles (e.g., White + Yellow) instead of inline `\c` color tags
|
|
116
|
+
|
|
117
|
+
**CRITICAL**: Any inline ASS tag (`\c`, `\K`, `\1c`, etc.) between RTL words breaks Unicode bidirectional algorithm in libass — words render LTR. Use separate Dialogue lines instead.
|
|
118
|
+
|
|
119
|
+
## Remotion Motion Graphics
|
|
120
|
+
|
|
121
|
+
For motion graphics rendering, use the `remotion-best-practices` skill for detailed Remotion patterns.
|
|
122
|
+
|
|
123
|
+
For cloud rendering via Remotion Lambda:
|
|
124
|
+
```bash
|
|
125
|
+
npx remotion lambda render <serve-url> <composition-id> --out output.mp4
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Premiere Pro XML Timeline
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
def generate_premiere_xml(clips, output_path, fps=30):
|
|
132
|
+
# Generate FCP7 XML compatible with Premiere Pro
|
|
133
|
+
...
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Output Structure
|
|
137
|
+
|
|
138
|
+
Organize outputs per project:
|
|
139
|
+
```
|
|
140
|
+
<project>/
|
|
141
|
+
├── raw/ # original footage
|
|
142
|
+
├── transcripts/ # SRT, word-level JSON
|
|
143
|
+
├── clips/ # cut segments
|
|
144
|
+
├── shorts/ # 9:16 vertical versions
|
|
145
|
+
├── b-roll/ # generated B-roll images/videos
|
|
146
|
+
├── motion/ # Remotion compositions
|
|
147
|
+
└── export/ # final deliverables + XML timelines
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Check Before Writing New Scripts
|
|
151
|
+
|
|
152
|
+
Before writing a new script, ask the user if they already have one for the task — they may have existing tools for clipping, silence removal, or subtitle burning.
|