@nguyenphp/antigravity-marketing 1.0.16 → 1.0.18
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/README.md +10 -5
- package/bin/index.js +4 -4
- package/package.json +1 -1
- package/templates/.agent/agents/backend-specialist.md +263 -0
- package/templates/.agent/agents/database-architect.md +226 -0
- package/templates/.agent/agents/debugger.md +225 -0
- package/templates/.agent/agents/devops-engineer.md +242 -0
- package/templates/.agent/agents/documentation-writer.md +104 -0
- package/templates/.agent/agents/explorer-agent.md +73 -0
- package/templates/.agent/agents/frontend-specialist.md +527 -0
- package/templates/.agent/agents/game-developer.md +162 -0
- package/templates/.agent/agents/mobile-developer.md +377 -0
- package/templates/.agent/agents/orchestrator.md +400 -0
- package/templates/.agent/agents/penetration-tester.md +188 -0
- package/templates/.agent/agents/performance-optimizer.md +187 -0
- package/templates/.agent/agents/project-planner.md +403 -0
- package/templates/.agent/agents/security-auditor.md +170 -0
- package/templates/.agent/agents/seo-specialist.md +111 -0
- package/templates/.agent/agents/test-engineer.md +158 -0
- package/templates/.agent/rules/GEMINI.md +248 -0
- package/templates/.agent/skills/analytics-marketing/SKILL.md +172 -324
- package/templates/.agent/skills/api-patterns/SKILL.md +81 -0
- package/templates/.agent/skills/api-patterns/api-style.md +42 -0
- package/templates/.agent/skills/api-patterns/auth.md +24 -0
- package/templates/.agent/skills/api-patterns/documentation.md +26 -0
- package/templates/.agent/skills/api-patterns/graphql.md +41 -0
- package/templates/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/templates/.agent/skills/api-patterns/response.md +37 -0
- package/templates/.agent/skills/api-patterns/rest.md +40 -0
- package/templates/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/templates/.agent/skills/api-patterns/security-testing.md +122 -0
- package/templates/.agent/skills/api-patterns/trpc.md +41 -0
- package/templates/.agent/skills/api-patterns/versioning.md +22 -0
- package/templates/.agent/skills/app-builder/SKILL.md +75 -0
- package/templates/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/templates/.agent/skills/app-builder/feature-building.md +53 -0
- package/templates/.agent/skills/app-builder/project-detection.md +34 -0
- package/templates/.agent/skills/app-builder/scaffolding.md +118 -0
- package/templates/.agent/skills/app-builder/tech-stack.md +40 -0
- package/templates/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/templates/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/templates/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/templates/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/templates/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/templates/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/templates/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/templates/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/templates/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/templates/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/templates/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/templates/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/templates/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/templates/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/templates/.agent/skills/architecture/SKILL.md +55 -0
- package/templates/.agent/skills/architecture/context-discovery.md +43 -0
- package/templates/.agent/skills/architecture/examples.md +94 -0
- package/templates/.agent/skills/architecture/pattern-selection.md +68 -0
- package/templates/.agent/skills/architecture/patterns-reference.md +50 -0
- package/templates/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/templates/.agent/skills/banner-design/SKILL.md +192 -0
- package/templates/.agent/skills/banner-design/references/banner-sizes-and-styles.md +118 -0
- package/templates/.agent/skills/bash-linux/SKILL.md +199 -0
- package/templates/.agent/skills/behavioral-modes/SKILL.md +242 -0
- package/templates/.agent/skills/brainstorming/SKILL.md +163 -0
- package/templates/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
- package/templates/.agent/skills/brand/SKILL.md +97 -0
- package/templates/.agent/skills/brand/references/approval-checklist.md +169 -0
- package/templates/.agent/skills/brand/references/asset-organization.md +157 -0
- package/templates/.agent/skills/brand/references/brand-guideline-template.md +140 -0
- package/templates/.agent/skills/brand/references/color-palette-management.md +186 -0
- package/templates/.agent/skills/brand/references/consistency-checklist.md +94 -0
- package/templates/.agent/skills/brand/references/logo-usage-rules.md +185 -0
- package/templates/.agent/skills/brand/references/messaging-framework.md +85 -0
- package/templates/.agent/skills/brand/references/typography-specifications.md +214 -0
- package/templates/.agent/skills/brand/references/update.md +118 -0
- package/templates/.agent/skills/brand/references/visual-identity.md +96 -0
- package/templates/.agent/skills/brand/references/voice-framework.md +88 -0
- package/templates/.agent/skills/brand/scripts/extract-colors.cjs +341 -0
- package/templates/.agent/skills/brand/scripts/inject-brand-context.cjs +349 -0
- package/templates/.agent/skills/brand/scripts/sync-brand-to-tokens.cjs +266 -0
- package/templates/.agent/skills/brand/scripts/validate-asset.cjs +387 -0
- package/templates/.agent/skills/brand/templates/brand-guidelines-starter.md +275 -0
- package/templates/.agent/skills/clean-code/SKILL.md +201 -0
- package/templates/.agent/skills/code-review-checklist/SKILL.md +109 -0
- package/templates/.agent/skills/copywriting/SKILL.md +250 -0
- package/templates/.agent/skills/database-design/SKILL.md +52 -0
- package/templates/.agent/skills/database-design/database-selection.md +43 -0
- package/templates/.agent/skills/database-design/indexing.md +39 -0
- package/templates/.agent/skills/database-design/migrations.md +48 -0
- package/templates/.agent/skills/database-design/optimization.md +36 -0
- package/templates/.agent/skills/database-design/orm-selection.md +30 -0
- package/templates/.agent/skills/database-design/schema-design.md +56 -0
- package/templates/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/templates/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/templates/.agent/skills/docker-expert/SKILL.md +409 -0
- package/templates/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/templates/.agent/skills/frontend-design/color-system.md +311 -0
- package/templates/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/templates/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/templates/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/templates/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/templates/.agent/skills/frontend-design/typography-system.md +345 -0
- package/templates/.agent/skills/frontend-design/ux-psychology.md +541 -0
- package/templates/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/templates/.agent/skills/frontend-slides/SKILL.md +92 -0
- package/templates/.agent/skills/frontend-slides/STYLE_PRESETS.md +347 -0
- package/templates/.agent/skills/frontend-slides/animation-patterns.md +110 -0
- package/templates/.agent/skills/frontend-slides/examples/n8n-jupviec-automation.html +789 -0
- package/templates/.agent/skills/frontend-slides/examples/n8n-jupviec-automation.pptx +0 -0
- package/templates/.agent/skills/frontend-slides/html-template.md +347 -0
- package/templates/.agent/skills/frontend-slides/scripts/export-pptx.py +58 -0
- package/templates/.agent/skills/frontend-slides/scripts/extract-pptx.py +96 -0
- package/templates/.agent/skills/frontend-slides/viewport-base.css +153 -0
- package/templates/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/templates/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/templates/.agent/skills/game-development/SKILL.md +167 -0
- package/templates/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/templates/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/templates/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/templates/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/templates/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/templates/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/templates/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/templates/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/templates/.agent/skills/geo-fundamentals/SKILL.md +156 -0
- package/templates/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/templates/.agent/skills/growth-engine/SKILL.md +244 -0
- package/templates/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/templates/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/templates/.agent/skills/lint-and-validate/SKILL.md +45 -0
- package/templates/.agent/skills/lint-and-validate/scripts/lint_runner.py +172 -0
- package/templates/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/templates/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/templates/.agent/skills/mobile-design/SKILL.md +394 -0
- package/templates/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/templates/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/templates/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/templates/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/templates/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/templates/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/templates/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/templates/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/templates/.agent/skills/mobile-design/mobile-typography.md +433 -0
- package/templates/.agent/skills/mobile-design/platform-android.md +666 -0
- package/templates/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/templates/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/templates/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/templates/.agent/skills/nestjs-expert/SKILL.md +552 -0
- package/templates/.agent/skills/nextjs-best-practices/SKILL.md +203 -0
- package/templates/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/templates/.agent/skills/parallel-agents/SKILL.md +175 -0
- package/templates/.agent/skills/performance-profiling/SKILL.md +143 -0
- package/templates/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/templates/.agent/skills/plan-writing/SKILL.md +152 -0
- package/templates/.agent/skills/powershell-windows/SKILL.md +167 -0
- package/templates/.agent/skills/ppc-advertising/SKILL.md +183 -475
- package/templates/.agent/skills/prisma-expert/SKILL.md +355 -0
- package/templates/.agent/skills/python-patterns/SKILL.md +441 -0
- package/templates/.agent/skills/react-patterns/SKILL.md +198 -0
- package/templates/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/templates/.agent/skills/remotion-best-practices/SKILL.md +45 -111
- package/templates/.agent/skills/remotion-best-practices/rules/3d.md +4 -4
- package/templates/.agent/skills/remotion-best-practices/rules/animations.md +5 -7
- package/templates/.agent/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/templates/.agent/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/templates/.agent/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
- package/templates/.agent/skills/remotion-best-practices/rules/assets.md +78 -0
- package/templates/.agent/skills/remotion-best-practices/rules/audio-visualization.md +198 -0
- package/templates/.agent/skills/remotion-best-practices/rules/audio.md +1 -4
- package/templates/.agent/skills/remotion-best-practices/rules/calculate-metadata.md +47 -17
- package/templates/.agent/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/templates/.agent/skills/remotion-best-practices/rules/charts.md +80 -48
- package/templates/.agent/skills/remotion-best-practices/rules/compositions.md +22 -14
- package/templates/.agent/skills/remotion-best-practices/rules/display-captions.md +79 -21
- package/templates/.agent/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/templates/.agent/skills/remotion-best-practices/rules/ffmpeg.md +38 -0
- package/templates/.agent/skills/remotion-best-practices/rules/fonts.md +96 -54
- package/templates/.agent/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/templates/.agent/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/templates/.agent/skills/remotion-best-practices/rules/get-video-duration.md +60 -0
- package/templates/.agent/skills/remotion-best-practices/rules/gifs.md +21 -18
- package/templates/.agent/skills/remotion-best-practices/rules/images.md +6 -2
- package/templates/.agent/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
- package/templates/.agent/skills/remotion-best-practices/rules/light-leaks.md +73 -0
- package/templates/.agent/skills/remotion-best-practices/rules/lottie.md +10 -7
- package/templates/.agent/skills/remotion-best-practices/rules/maps.md +412 -0
- package/templates/.agent/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
- package/templates/.agent/skills/remotion-best-practices/rules/measuring-text.md +140 -0
- package/templates/.agent/skills/remotion-best-practices/rules/parameters.md +109 -0
- package/templates/.agent/skills/remotion-best-practices/rules/sequencing.md +13 -1
- package/templates/.agent/skills/remotion-best-practices/rules/sfx.md +26 -0
- package/templates/.agent/skills/remotion-best-practices/rules/subtitles.md +36 -0
- package/templates/.agent/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/templates/.agent/skills/remotion-best-practices/rules/text-animations.md +4 -115
- package/templates/.agent/skills/remotion-best-practices/rules/timing.md +19 -19
- package/templates/.agent/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
- package/templates/.agent/skills/remotion-best-practices/rules/transitions.md +117 -42
- package/templates/.agent/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
- package/templates/.agent/skills/remotion-best-practices/rules/trimming.md +51 -0
- package/templates/.agent/skills/remotion-best-practices/rules/voiceover.md +99 -0
- package/templates/.agent/skills/seo-fundamentals/SKILL.md +83 -441
- package/templates/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/templates/.agent/skills/server-management/SKILL.md +161 -0
- package/templates/.agent/skills/systematic-debugging/SKILL.md +109 -0
- package/templates/.agent/skills/tdd-workflow/SKILL.md +149 -0
- package/templates/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/templates/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/templates/.agent/skills/typescript-expert/SKILL.md +429 -0
- package/templates/.agent/skills/ui-ux-pro-max/SKILL.md +585 -170
- package/templates/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/templates/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/templates/.agent/skills/ui-ux-pro-max/scripts/core.py +257 -0
- package/templates/.agent/skills/ui-ux-pro-max/scripts/design_system.py +487 -0
- package/templates/.agent/skills/ui-ux-pro-max/scripts/search.py +76 -0
- package/templates/.agent/skills/vue-expert/SKILL.md +374 -0
- package/templates/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
- package/templates/.agent/skills/vulnerability-scanner/checklists.md +121 -0
- package/templates/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/templates/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/templates/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/templates/.agent/workflows/brainstorm.md +113 -0
- package/templates/.agent/workflows/create.md +59 -0
- package/templates/.agent/workflows/debug.md +103 -0
- package/templates/.agent/workflows/deploy.md +176 -0
- package/templates/.agent/workflows/enhance.md +63 -0
- package/templates/.agent/workflows/orchestrate.md +237 -0
- package/templates/.agent/workflows/plan.md +89 -0
- package/templates/.agent/workflows/preview.md +80 -0
- package/templates/.agent/workflows/status.md +86 -0
- package/templates/.agent/workflows/test.md +144 -0
- package/templates/.agent/workflows/ui-ux-pro-max.md +231 -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,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.
|