dsh-remotion 0.3.3 → 0.4.0
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/CHANGELOG.md +21 -0
- package/README.en.md +26 -65
- package/README.md +25 -67
- package/docs/USAGE.en.md +93 -0
- package/docs/USAGE.md +97 -0
- package/docs/VALIDATION.md +22 -0
- package/lib/client.js +90 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +5 -1
- package/lib/media-store.d.ts +25 -0
- package/lib/media-store.js +174 -0
- package/lib/media-templates.d.ts +52 -0
- package/lib/media-templates.js +91 -0
- package/lib/media-workbench.d.ts +42 -0
- package/lib/media-workbench.js +476 -0
- package/package.json +18 -5
- package/scripts/build-client.mjs +4 -0
- package/skills/remotion-best-practices/SKILL.md +54 -54
- package/skills/remotion-best-practices/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-captions/REFERENCE.md +36 -36
- package/skills/remotion-best-practices/remotion-captions/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-captions/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-captions/display-captions.md +190 -190
- package/skills/remotion-best-practices/remotion-captions/import-srt-captions.md +73 -73
- package/skills/remotion-best-practices/remotion-captions/transcribe-captions.md +70 -70
- package/skills/remotion-best-practices/remotion-create/REFERENCE.md +85 -85
- package/skills/remotion-best-practices/remotion-create/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-create/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-create/tailwind.md +11 -11
- package/skills/remotion-best-practices/remotion-create/video-layout.md +9 -9
- package/skills/remotion-best-practices/remotion-docs/REFERENCE.md +46 -46
- package/skills/remotion-best-practices/remotion-docs/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-docs/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-interactivity/REFERENCE.md +315 -315
- package/skills/remotion-best-practices/remotion-interactivity/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-interactivity/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-maps/REFERENCE.md +36 -36
- package/skills/remotion-best-practices/remotion-maps/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-maps/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -89
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -284
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -299
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/city-path.json +12 -12
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -39
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -35
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -215
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -43
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -128
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -57
- package/skills/remotion-best-practices/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -161
- package/skills/remotion-best-practices/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -449
- package/skills/remotion-best-practices/remotion-maps/techniques/mapbox/references/render-stability.md +64 -64
- package/skills/remotion-best-practices/remotion-maps/techniques/maplibre/TECHNIQUE.md +484 -484
- package/skills/remotion-best-practices/remotion-maps/techniques/maplibre/references/render-stability.md +64 -64
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -80
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -70
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -80
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -363
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -22
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -7535
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -605
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -34
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -91
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -129
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -85
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/render-stability.md +64 -64
- package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -202
- package/skills/remotion-best-practices/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -37
- package/skills/remotion-best-practices/remotion-markup/3d.md +86 -86
- package/skills/remotion-best-practices/remotion-markup/REFERENCE.md +358 -358
- package/skills/remotion-best-practices/remotion-markup/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-markup/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-markup/audio-visualization.md +198 -198
- package/skills/remotion-best-practices/remotion-markup/audio.md +169 -169
- package/skills/remotion-best-practices/remotion-markup/calculate-metadata.md +136 -136
- package/skills/remotion-best-practices/remotion-markup/compositions.md +123 -123
- package/skills/remotion-best-practices/remotion-markup/connected-compositions.md +79 -79
- package/skills/remotion-best-practices/remotion-markup/cropping.md +34 -34
- package/skills/remotion-best-practices/remotion-markup/effects.md +251 -251
- package/skills/remotion-best-practices/remotion-markup/embedding-videos.md +171 -171
- package/skills/remotion-best-practices/remotion-markup/ffmpeg.md +38 -38
- package/skills/remotion-best-practices/remotion-markup/gifs.md +187 -187
- package/skills/remotion-best-practices/remotion-markup/google-fonts.md +76 -76
- package/skills/remotion-best-practices/remotion-markup/html-in-canvas.md +128 -128
- package/skills/remotion-best-practices/remotion-markup/images.md +73 -73
- package/skills/remotion-best-practices/remotion-markup/light-leaks.md +106 -106
- package/skills/remotion-best-practices/remotion-markup/local-fonts.md +69 -69
- package/skills/remotion-best-practices/remotion-markup/lottie.md +73 -73
- package/skills/remotion-best-practices/remotion-markup/measuring-dom-nodes.md +38 -38
- package/skills/remotion-best-practices/remotion-markup/measuring-text.md +146 -146
- package/skills/remotion-best-practices/remotion-markup/motion-blur.md +60 -60
- package/skills/remotion-best-practices/remotion-markup/multi-scene-video.md +81 -81
- package/skills/remotion-best-practices/remotion-markup/parameters.md +111 -111
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/REFERENCE.md +36 -36
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -89
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -284
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -299
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/city-path.json +12 -12
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -39
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -35
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -215
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -43
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -128
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -57
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -161
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -449
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/mapbox/references/render-stability.md +64 -64
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maplibre/TECHNIQUE.md +484 -484
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maplibre/references/render-stability.md +64 -64
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -80
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -70
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -80
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -363
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -22
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -7535
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -605
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -34
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -91
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -129
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -85
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/render-stability.md +64 -64
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -202
- package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -37
- package/skills/remotion-best-practices/remotion-markup/sequencing.md +169 -169
- package/skills/remotion-best-practices/remotion-markup/sfx.md +51 -51
- package/skills/remotion-best-practices/remotion-markup/silence-detection.md +71 -71
- package/skills/remotion-best-practices/remotion-markup/text-highlights.md +56 -56
- package/skills/remotion-best-practices/remotion-markup/timing.md +111 -111
- package/skills/remotion-best-practices/remotion-markup/transitions.md +239 -239
- package/skills/remotion-best-practices/remotion-markup/video-editing.md +90 -90
- package/skills/remotion-best-practices/remotion-markup/voiceover.md +99 -99
- package/skills/remotion-best-practices/remotion-multimedia/REFERENCE.md +20 -20
- package/skills/remotion-best-practices/remotion-multimedia/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-multimedia/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-multimedia/get-audio-duration.md +56 -56
- package/skills/remotion-best-practices/remotion-multimedia/get-video-dimensions.md +66 -66
- package/skills/remotion-best-practices/remotion-multimedia/get-video-duration.md +58 -58
- package/skills/remotion-best-practices/remotion-render/REFERENCE.md +35 -35
- package/skills/remotion-best-practices/remotion-render/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-render/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-render/transparent-videos.md +106 -106
- package/skills/remotion-best-practices/remotion-saas/REFERENCE.md +33 -33
- package/skills/remotion-best-practices/remotion-saas/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-saas/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-saas/framework.md +19 -19
- package/skills/remotion-best-practices/remotion-saas/player.md +33 -33
- package/skills/remotion-best-practices/remotion-saas/rendering.md +69 -69
- package/skills/remotion-best-practices/remotion-studio/REFERENCE.md +24 -24
- package/skills/remotion-best-practices/remotion-studio/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-studio/assets/remotion-icon.svg +4 -4
- package/skills/remotion-best-practices/remotion-upgrade/REFERENCE.md +31 -31
- package/skills/remotion-best-practices/remotion-upgrade/agents/openai.yaml +7 -7
- package/skills/remotion-best-practices/remotion-upgrade/assets/remotion-icon.svg +4 -4
- package/skills/remotion-captions/SKILL.md +31 -31
- package/skills/remotion-captions/agents/openai.yaml +7 -7
- package/skills/remotion-captions/assets/remotion-icon.svg +4 -4
- package/skills/remotion-captions/display-captions.md +190 -190
- package/skills/remotion-captions/import-srt-captions.md +73 -73
- package/skills/remotion-captions/transcribe-captions.md +70 -70
- package/skills/remotion-create/SKILL.md +80 -80
- package/skills/remotion-create/agents/openai.yaml +7 -7
- package/skills/remotion-create/assets/remotion-icon.svg +4 -4
- package/skills/remotion-create/tailwind.md +11 -11
- package/skills/remotion-create/video-layout.md +9 -9
- package/skills/remotion-docs/SKILL.md +41 -41
- package/skills/remotion-docs/agents/openai.yaml +7 -7
- package/skills/remotion-docs/assets/remotion-icon.svg +4 -4
- package/skills/remotion-interactivity/SKILL.md +310 -310
- package/skills/remotion-interactivity/agents/openai.yaml +7 -7
- package/skills/remotion-interactivity/assets/remotion-icon.svg +4 -4
- package/skills/remotion-maps/SKILL.md +31 -31
- package/skills/remotion-maps/agents/openai.yaml +7 -7
- package/skills/remotion-maps/assets/remotion-icon.svg +4 -4
- package/skills/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -89
- package/skills/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -284
- package/skills/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -299
- package/skills/remotion-maps/techniques/cesium/assets/city-path.json +12 -12
- package/skills/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -39
- package/skills/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -35
- package/skills/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -215
- package/skills/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -43
- package/skills/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -128
- package/skills/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -57
- package/skills/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -161
- package/skills/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -449
- package/skills/remotion-maps/techniques/mapbox/references/render-stability.md +64 -64
- package/skills/remotion-maps/techniques/maplibre/TECHNIQUE.md +484 -484
- package/skills/remotion-maps/techniques/maplibre/references/render-stability.md +64 -64
- package/skills/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -80
- package/skills/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -70
- package/skills/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -80
- package/skills/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -363
- package/skills/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -22
- package/skills/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -7535
- package/skills/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -605
- package/skills/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -34
- package/skills/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -91
- package/skills/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -129
- package/skills/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -85
- package/skills/remotion-maps/techniques/maptiler/references/render-stability.md +64 -64
- package/skills/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -202
- package/skills/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -37
- package/skills/remotion-markup/3d.md +86 -86
- package/skills/remotion-markup/SKILL.md +353 -353
- package/skills/remotion-markup/agents/openai.yaml +7 -7
- package/skills/remotion-markup/assets/remotion-icon.svg +4 -4
- package/skills/remotion-markup/audio-visualization.md +198 -198
- package/skills/remotion-markup/audio.md +169 -169
- package/skills/remotion-markup/calculate-metadata.md +136 -136
- package/skills/remotion-markup/compositions.md +123 -123
- package/skills/remotion-markup/connected-compositions.md +79 -79
- package/skills/remotion-markup/cropping.md +34 -34
- package/skills/remotion-markup/effects.md +251 -251
- package/skills/remotion-markup/embedding-videos.md +171 -171
- package/skills/remotion-markup/ffmpeg.md +38 -38
- package/skills/remotion-markup/gifs.md +187 -187
- package/skills/remotion-markup/google-fonts.md +76 -76
- package/skills/remotion-markup/html-in-canvas.md +128 -128
- package/skills/remotion-markup/images.md +73 -73
- package/skills/remotion-markup/light-leaks.md +106 -106
- package/skills/remotion-markup/local-fonts.md +69 -69
- package/skills/remotion-markup/lottie.md +73 -73
- package/skills/remotion-markup/measuring-dom-nodes.md +38 -38
- package/skills/remotion-markup/measuring-text.md +146 -146
- package/skills/remotion-markup/motion-blur.md +60 -60
- package/skills/remotion-markup/multi-scene-video.md +81 -81
- package/skills/remotion-markup/parameters.md +111 -111
- package/skills/remotion-markup/remotion-maps/REFERENCE.md +36 -36
- package/skills/remotion-markup/remotion-maps/agents/openai.yaml +7 -7
- package/skills/remotion-markup/remotion-maps/assets/remotion-icon.svg +4 -4
- package/skills/remotion-markup/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -89
- package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -284
- package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -299
- package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/city-path.json +12 -12
- package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -39
- package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -35
- package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -215
- package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -43
- package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -128
- package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -57
- package/skills/remotion-markup/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -161
- package/skills/remotion-markup/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -449
- package/skills/remotion-markup/remotion-maps/techniques/mapbox/references/render-stability.md +64 -64
- package/skills/remotion-markup/remotion-maps/techniques/maplibre/TECHNIQUE.md +484 -484
- package/skills/remotion-markup/remotion-maps/techniques/maplibre/references/render-stability.md +64 -64
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -80
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -70
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -80
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -363
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -22
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -7535
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -605
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -34
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -91
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -129
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -85
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/render-stability.md +64 -64
- package/skills/remotion-markup/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -202
- package/skills/remotion-markup/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -37
- package/skills/remotion-markup/sequencing.md +169 -169
- package/skills/remotion-markup/sfx.md +51 -51
- package/skills/remotion-markup/silence-detection.md +71 -71
- package/skills/remotion-markup/text-highlights.md +56 -56
- package/skills/remotion-markup/timing.md +111 -111
- package/skills/remotion-markup/transitions.md +239 -239
- package/skills/remotion-markup/video-editing.md +90 -90
- package/skills/remotion-markup/voiceover.md +99 -99
- package/skills/remotion-multimedia/SKILL.md +15 -15
- package/skills/remotion-multimedia/agents/openai.yaml +7 -7
- package/skills/remotion-multimedia/assets/remotion-icon.svg +4 -4
- package/skills/remotion-multimedia/get-audio-duration.md +56 -56
- package/skills/remotion-multimedia/get-video-dimensions.md +66 -66
- package/skills/remotion-multimedia/get-video-duration.md +58 -58
- package/skills/remotion-render/SKILL.md +30 -30
- package/skills/remotion-render/agents/openai.yaml +7 -7
- package/skills/remotion-render/assets/remotion-icon.svg +4 -4
- package/skills/remotion-render/transparent-videos.md +106 -106
- package/skills/remotion-saas/SKILL.md +28 -28
- package/skills/remotion-saas/agents/openai.yaml +7 -7
- package/skills/remotion-saas/assets/remotion-icon.svg +4 -4
- package/skills/remotion-saas/framework.md +19 -19
- package/skills/remotion-saas/player.md +33 -33
- package/skills/remotion-saas/rendering.md +69 -69
- package/skills/remotion-studio/SKILL.md +19 -19
- package/skills/remotion-studio/agents/openai.yaml +7 -7
- package/skills/remotion-studio/assets/remotion-icon.svg +4 -4
- package/skills/remotion-upgrade/SKILL.md +26 -26
- package/skills/remotion-upgrade/agents/openai.yaml +7 -7
- package/skills/remotion-upgrade/assets/remotion-icon.svg +4 -4
- package/templates/DESIGN.md +26 -0
|
@@ -4,57 +4,57 @@ description: Router for all Remotion skills
|
|
|
4
4
|
version: 4.0.529
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
## Preserve user changes
|
|
9
|
-
|
|
10
|
-
Users may make edits in the code outside of the conversation.
|
|
11
|
-
|
|
12
|
-
If you detect a surprising change made in the meanwhile, don't overwrite it, assume it was intentional or ask for confirmation.
|
|
13
|
-
|
|
14
|
-
## Creating a video
|
|
15
|
-
|
|
16
|
-
If the user asks to make, create, or build a new video or composition, load [Create a new Remotion video](./remotion-create/REFERENCE.md), whether or not a Remotion project already exists.
|
|
17
|
-
|
|
18
|
-
## New project setup
|
|
19
|
-
|
|
20
|
-
If no Remotion project currently exists, load [Create a new Remotion project](./remotion-create/REFERENCE.md)
|
|
21
|
-
|
|
22
|
-
## React Markup Best Practices
|
|
23
|
-
|
|
24
|
-
If you are writing Remotion React Markup, load [Remotion Markup Best Practices](./remotion-markup/REFERENCE.md)
|
|
25
|
-
|
|
26
|
-
## Maps
|
|
27
|
-
|
|
28
|
-
For static maps, animated routes and markers, geographic explainers, Mapbox, MapLibre, MapTiler, GeoJSON, or 3D geographic flyovers, load [Remotion Maps](./remotion-maps/REFERENCE.md).
|
|
29
|
-
|
|
30
|
-
## Multimedia
|
|
31
|
-
|
|
32
|
-
For achieving multimedia tasks in the browser, such as trimming, cropping videos, or getting metadata from them, load [Remotion Multimedia](./remotion-multimedia/REFERENCE.md)
|
|
33
|
-
|
|
34
|
-
## Improving Interactivity
|
|
35
|
-
|
|
36
|
-
By structuring the Remotion markup well, we can allow users to interactively change things in the Studio and write back to code. If relevant: [Interactivity Best Practices](./remotion-interactivity/REFERENCE.md)
|
|
37
|
-
|
|
38
|
-
## Rendering
|
|
39
|
-
|
|
40
|
-
For advanced rendering beyond simple `npx remotion render`, see: [Rendering Best Practices](./remotion-render/REFERENCE.md)
|
|
41
|
-
|
|
42
|
-
## Opening Remotion Studio
|
|
43
|
-
|
|
44
|
-
To launch a project in Remotion Studio, open its exact local URL, or configure Studio CLI flags, load [Remotion Studio](./remotion-studio/REFERENCE.md).
|
|
45
|
-
|
|
46
|
-
## Captions
|
|
47
|
-
|
|
48
|
-
When working with Captions, load [Remotion Captions](./remotion-captions/REFERENCE.md).
|
|
49
|
-
|
|
50
|
-
## Creating a SaaS, automation or application
|
|
51
|
-
|
|
52
|
-
Use the [Remotion SaaS skill](./remotion-saas/REFERENCE.md) for knowledge about Remotion-powered SaaS apps, such as `<Player>`, rendering on Lambda, Vercel, Cloudflare, via Express.js, client-side rendering, or for finding the right SaaS template.
|
|
53
|
-
|
|
54
|
-
## Looking up Remotion APIs and documentation
|
|
55
|
-
|
|
56
|
-
To find and read current Remotion documentation, load [Remotion Docs](./remotion-docs/REFERENCE.md).
|
|
57
|
-
|
|
58
|
-
## Upgrading
|
|
59
|
-
|
|
60
|
-
To upgrade Remotion, related packages, compatible Mediabunny packages, and installed Remotion Agent Skills, load [Remotion Upgrade](./remotion-upgrade/REFERENCE.md).
|
|
7
|
+
|
|
8
|
+
## Preserve user changes
|
|
9
|
+
|
|
10
|
+
Users may make edits in the code outside of the conversation.
|
|
11
|
+
|
|
12
|
+
If you detect a surprising change made in the meanwhile, don't overwrite it, assume it was intentional or ask for confirmation.
|
|
13
|
+
|
|
14
|
+
## Creating a video
|
|
15
|
+
|
|
16
|
+
If the user asks to make, create, or build a new video or composition, load [Create a new Remotion video](./remotion-create/REFERENCE.md), whether or not a Remotion project already exists.
|
|
17
|
+
|
|
18
|
+
## New project setup
|
|
19
|
+
|
|
20
|
+
If no Remotion project currently exists, load [Create a new Remotion project](./remotion-create/REFERENCE.md)
|
|
21
|
+
|
|
22
|
+
## React Markup Best Practices
|
|
23
|
+
|
|
24
|
+
If you are writing Remotion React Markup, load [Remotion Markup Best Practices](./remotion-markup/REFERENCE.md)
|
|
25
|
+
|
|
26
|
+
## Maps
|
|
27
|
+
|
|
28
|
+
For static maps, animated routes and markers, geographic explainers, Mapbox, MapLibre, MapTiler, GeoJSON, or 3D geographic flyovers, load [Remotion Maps](./remotion-maps/REFERENCE.md).
|
|
29
|
+
|
|
30
|
+
## Multimedia
|
|
31
|
+
|
|
32
|
+
For achieving multimedia tasks in the browser, such as trimming, cropping videos, or getting metadata from them, load [Remotion Multimedia](./remotion-multimedia/REFERENCE.md)
|
|
33
|
+
|
|
34
|
+
## Improving Interactivity
|
|
35
|
+
|
|
36
|
+
By structuring the Remotion markup well, we can allow users to interactively change things in the Studio and write back to code. If relevant: [Interactivity Best Practices](./remotion-interactivity/REFERENCE.md)
|
|
37
|
+
|
|
38
|
+
## Rendering
|
|
39
|
+
|
|
40
|
+
For advanced rendering beyond simple `npx remotion render`, see: [Rendering Best Practices](./remotion-render/REFERENCE.md)
|
|
41
|
+
|
|
42
|
+
## Opening Remotion Studio
|
|
43
|
+
|
|
44
|
+
To launch a project in Remotion Studio, open its exact local URL, or configure Studio CLI flags, load [Remotion Studio](./remotion-studio/REFERENCE.md).
|
|
45
|
+
|
|
46
|
+
## Captions
|
|
47
|
+
|
|
48
|
+
When working with Captions, load [Remotion Captions](./remotion-captions/REFERENCE.md).
|
|
49
|
+
|
|
50
|
+
## Creating a SaaS, automation or application
|
|
51
|
+
|
|
52
|
+
Use the [Remotion SaaS skill](./remotion-saas/REFERENCE.md) for knowledge about Remotion-powered SaaS apps, such as `<Player>`, rendering on Lambda, Vercel, Cloudflare, via Express.js, client-side rendering, or for finding the right SaaS template.
|
|
53
|
+
|
|
54
|
+
## Looking up Remotion APIs and documentation
|
|
55
|
+
|
|
56
|
+
To find and read current Remotion documentation, load [Remotion Docs](./remotion-docs/REFERENCE.md).
|
|
57
|
+
|
|
58
|
+
## Upgrading
|
|
59
|
+
|
|
60
|
+
To upgrade Remotion, related packages, compatible Mediabunny packages, and installed Remotion Agent Skills, load [Remotion Upgrade](./remotion-upgrade/REFERENCE.md).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: '/remotion-best-practices'
|
|
3
|
-
short_description: 'Route Remotion tasks to the right workflow'
|
|
4
|
-
icon_small: './assets/remotion-icon.svg'
|
|
5
|
-
icon_large: './assets/remotion-icon.svg'
|
|
6
|
-
brand_color: '#0B84F3'
|
|
7
|
-
default_prompt: '$remotion-best-practices: Make a promo video for my product'
|
|
1
|
+
interface:
|
|
2
|
+
display_name: '/remotion-best-practices'
|
|
3
|
+
short_description: 'Route Remotion tasks to the right workflow'
|
|
4
|
+
icon_small: './assets/remotion-icon.svg'
|
|
5
|
+
icon_large: './assets/remotion-icon.svg'
|
|
6
|
+
brand_color: '#0B84F3'
|
|
7
|
+
default_prompt: '$remotion-best-practices: Make a promo video for my product'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="100" height="100" viewBox="20 30 363 363" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<title>Remotion</title>
|
|
3
|
-
<path d="M148.332 92.9015C143.307 93.1742 139.259 93.9713 135.179 95.5236C133.144 96.2893 129.809 97.957 127.973 99.1108C120.295 103.925 114.443 111.162 111.391 119.584C110.782 121.252 109.136 126.57 108.076 130.23C101.018 154.7 97.0112 181.456 96.1511 209.776C96.0148 214.286 96.0148 225.026 96.1511 229.463C96.728 248.237 98.5216 265.187 101.773 282.472C103.095 289.468 105.213 298.866 106.44 303.135C108.947 311.809 114.065 319.193 121.344 324.605C126.221 328.234 131.759 330.668 137.895 331.863C140.853 332.44 144.755 332.702 147.629 332.514C151.604 332.251 159.491 331.192 165.9 330.049C194.786 324.899 221.469 315.679 245.666 302.485C260.99 294.125 274.09 285.074 286.729 274.092C299.326 263.163 310.066 251.405 319.516 238.21C321.708 235.158 322.81 233.375 323.911 231.131C326.743 225.341 328.075 219.583 328.064 213.143C328.064 207.143 326.932 201.815 324.488 196.361C323.313 193.728 322.191 191.84 319.674 188.253C310.402 175.048 300.112 163.542 287.568 152.361C268.122 135.034 245.026 120.822 219.235 110.302C213.644 108.026 208.138 106.022 201.509 103.851C187.475 99.2681 170.106 95.2929 155.411 93.3105C153.104 92.9959 149.968 92.8176 148.332 92.9015Z" fill="#0B84F3"/>
|
|
4
|
-
</svg>
|
|
1
|
+
<svg width="100" height="100" viewBox="20 30 363 363" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Remotion</title>
|
|
3
|
+
<path d="M148.332 92.9015C143.307 93.1742 139.259 93.9713 135.179 95.5236C133.144 96.2893 129.809 97.957 127.973 99.1108C120.295 103.925 114.443 111.162 111.391 119.584C110.782 121.252 109.136 126.57 108.076 130.23C101.018 154.7 97.0112 181.456 96.1511 209.776C96.0148 214.286 96.0148 225.026 96.1511 229.463C96.728 248.237 98.5216 265.187 101.773 282.472C103.095 289.468 105.213 298.866 106.44 303.135C108.947 311.809 114.065 319.193 121.344 324.605C126.221 328.234 131.759 330.668 137.895 331.863C140.853 332.44 144.755 332.702 147.629 332.514C151.604 332.251 159.491 331.192 165.9 330.049C194.786 324.899 221.469 315.679 245.666 302.485C260.99 294.125 274.09 285.074 286.729 274.092C299.326 263.163 310.066 251.405 319.516 238.21C321.708 235.158 322.81 233.375 323.911 231.131C326.743 225.341 328.075 219.583 328.064 213.143C328.064 207.143 326.932 201.815 324.488 196.361C323.313 193.728 322.191 191.84 319.674 188.253C310.402 175.048 300.112 163.542 287.568 152.361C268.122 135.034 245.026 120.822 219.235 110.302C213.644 108.026 208.138 106.022 201.509 103.851C187.475 99.2681 170.106 95.2929 155.411 93.3105C153.104 92.9959 149.968 92.8176 148.332 92.9015Z" fill="#0B84F3"/>
|
|
4
|
+
</svg>
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: remotion-captions
|
|
3
|
-
description: Transcribing, displaying and animating captions
|
|
4
|
-
version: 4.0.529
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
All captions must be processed in JSON. The captions must use the [`Caption`](https://www.remotion.dev/docs/captions/caption.md) type which is the following:
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import type { Caption } from "@remotion/captions";
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
This is the definition:
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
type Caption = {
|
|
17
|
-
text: string;
|
|
18
|
-
startMs: number;
|
|
19
|
-
endMs: number;
|
|
20
|
-
timestampMs: number | null;
|
|
21
|
-
confidence: number | null;
|
|
22
|
-
pageBreakAfter?: boolean;
|
|
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.
|
|
1
|
+
---
|
|
2
|
+
name: remotion-captions
|
|
3
|
+
description: Transcribing, displaying and animating captions
|
|
4
|
+
version: 4.0.529
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
All captions must be processed in JSON. The captions must use the [`Caption`](https://www.remotion.dev/docs/captions/caption.md) type which is the following:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import type { Caption } from "@remotion/captions";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This is the definition:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type Caption = {
|
|
17
|
+
text: string;
|
|
18
|
+
startMs: number;
|
|
19
|
+
endMs: number;
|
|
20
|
+
timestampMs: number | null;
|
|
21
|
+
confidence: number | null;
|
|
22
|
+
pageBreakAfter?: boolean;
|
|
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.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: '/remotion-captions'
|
|
3
|
-
short_description: 'Transcribe, display, and animate captions'
|
|
4
|
-
icon_small: './assets/remotion-icon.svg'
|
|
5
|
-
icon_large: './assets/remotion-icon.svg'
|
|
6
|
-
brand_color: '#0B84F3'
|
|
7
|
-
default_prompt: '$remotion-captions: Transcribe my video and display captions'
|
|
1
|
+
interface:
|
|
2
|
+
display_name: '/remotion-captions'
|
|
3
|
+
short_description: 'Transcribe, display, and animate captions'
|
|
4
|
+
icon_small: './assets/remotion-icon.svg'
|
|
5
|
+
icon_large: './assets/remotion-icon.svg'
|
|
6
|
+
brand_color: '#0B84F3'
|
|
7
|
+
default_prompt: '$remotion-captions: Transcribe my video and display captions'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="100" height="100" viewBox="20 30 363 363" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<title>Remotion</title>
|
|
3
|
-
<path d="M148.332 92.9015C143.307 93.1742 139.259 93.9713 135.179 95.5236C133.144 96.2893 129.809 97.957 127.973 99.1108C120.295 103.925 114.443 111.162 111.391 119.584C110.782 121.252 109.136 126.57 108.076 130.23C101.018 154.7 97.0112 181.456 96.1511 209.776C96.0148 214.286 96.0148 225.026 96.1511 229.463C96.728 248.237 98.5216 265.187 101.773 282.472C103.095 289.468 105.213 298.866 106.44 303.135C108.947 311.809 114.065 319.193 121.344 324.605C126.221 328.234 131.759 330.668 137.895 331.863C140.853 332.44 144.755 332.702 147.629 332.514C151.604 332.251 159.491 331.192 165.9 330.049C194.786 324.899 221.469 315.679 245.666 302.485C260.99 294.125 274.09 285.074 286.729 274.092C299.326 263.163 310.066 251.405 319.516 238.21C321.708 235.158 322.81 233.375 323.911 231.131C326.743 225.341 328.075 219.583 328.064 213.143C328.064 207.143 326.932 201.815 324.488 196.361C323.313 193.728 322.191 191.84 319.674 188.253C310.402 175.048 300.112 163.542 287.568 152.361C268.122 135.034 245.026 120.822 219.235 110.302C213.644 108.026 208.138 106.022 201.509 103.851C187.475 99.2681 170.106 95.2929 155.411 93.3105C153.104 92.9959 149.968 92.8176 148.332 92.9015Z" fill="#0B84F3"/>
|
|
4
|
-
</svg>
|
|
1
|
+
<svg width="100" height="100" viewBox="20 30 363 363" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Remotion</title>
|
|
3
|
+
<path d="M148.332 92.9015C143.307 93.1742 139.259 93.9713 135.179 95.5236C133.144 96.2893 129.809 97.957 127.973 99.1108C120.295 103.925 114.443 111.162 111.391 119.584C110.782 121.252 109.136 126.57 108.076 130.23C101.018 154.7 97.0112 181.456 96.1511 209.776C96.0148 214.286 96.0148 225.026 96.1511 229.463C96.728 248.237 98.5216 265.187 101.773 282.472C103.095 289.468 105.213 298.866 106.44 303.135C108.947 311.809 114.065 319.193 121.344 324.605C126.221 328.234 131.759 330.668 137.895 331.863C140.853 332.44 144.755 332.702 147.629 332.514C151.604 332.251 159.491 331.192 165.9 330.049C194.786 324.899 221.469 315.679 245.666 302.485C260.99 294.125 274.09 285.074 286.729 274.092C299.326 263.163 310.066 251.405 319.516 238.21C321.708 235.158 322.81 233.375 323.911 231.131C326.743 225.341 328.075 219.583 328.064 213.143C328.064 207.143 326.932 201.815 324.488 196.361C323.313 193.728 322.191 191.84 319.674 188.253C310.402 175.048 300.112 163.542 287.568 152.361C268.122 135.034 245.026 120.822 219.235 110.302C213.644 108.026 208.138 106.022 201.509 103.851C187.475 99.2681 170.106 95.2929 155.411 93.3105C153.104 92.9959 149.968 92.8176 148.332 92.9015Z" fill="#0B84F3"/>
|
|
4
|
+
</svg>
|
|
@@ -1,190 +1,190 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: display-captions
|
|
3
|
-
description: Displaying captions in Remotion with TikTok-style pages and word highlighting
|
|
4
|
-
metadata:
|
|
5
|
-
tags: captions, subtitles, display, tiktok, highlight
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Displaying captions in Remotion
|
|
9
|
-
|
|
10
|
-
This guide explains how to display captions in Remotion, assuming you already have captions in the [`Caption`](https://www.remotion.dev/docs/captions/caption) format.
|
|
11
|
-
|
|
12
|
-
## Prerequisites
|
|
13
|
-
|
|
14
|
-
Read [Transcribing audio](transcribe-captions.md) for how to generate captions.
|
|
15
|
-
|
|
16
|
-
First, the [`@remotion/captions`](https://www.remotion.dev/docs/captions) package needs to be installed.
|
|
17
|
-
If it is not installed, use the following command:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npx remotion add @remotion/captions
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Fetching captions
|
|
24
|
-
|
|
25
|
-
First, fetch your captions JSON file. Use [`useDelayRender()`](https://www.remotion.dev/docs/use-delay-render) to hold the render until the captions are loaded:
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
import { useState, useEffect, useCallback } from "react";
|
|
29
|
-
import { AbsoluteFill, staticFile, useDelayRender } from "remotion";
|
|
30
|
-
import type { Caption } from "@remotion/captions";
|
|
31
|
-
|
|
32
|
-
export const MyComponent: React.FC = () => {
|
|
33
|
-
const [captions, setCaptions] = useState<Caption[] | null>(null);
|
|
34
|
-
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
35
|
-
const [handle] = useState(() => delayRender());
|
|
36
|
-
|
|
37
|
-
const fetchCaptions = useCallback(async () => {
|
|
38
|
-
try {
|
|
39
|
-
// Assuming captions.json is in the public/ folder.
|
|
40
|
-
const response = await fetch(staticFile("captions123.json"));
|
|
41
|
-
const data = await response.json();
|
|
42
|
-
setCaptions(data);
|
|
43
|
-
continueRender(handle);
|
|
44
|
-
} catch (e) {
|
|
45
|
-
cancelRender(e);
|
|
46
|
-
}
|
|
47
|
-
}, [continueRender, cancelRender, handle]);
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
fetchCaptions();
|
|
51
|
-
}, [fetchCaptions]);
|
|
52
|
-
|
|
53
|
-
if (!captions) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<AbsoluteFill>
|
|
59
|
-
{/* Render captions here */}
|
|
60
|
-
</AbsoluteFill>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Creating pages
|
|
66
|
-
|
|
67
|
-
Use `createTikTokStyleCaptions()` to group captions into pages. The `combineTokensWithinMilliseconds` option controls how many words appear at once:
|
|
68
|
-
|
|
69
|
-
```tsx
|
|
70
|
-
import { useMemo } from "react";
|
|
71
|
-
import { createTikTokStyleCaptions } from "@remotion/captions";
|
|
72
|
-
import type { Caption } from "@remotion/captions";
|
|
73
|
-
|
|
74
|
-
// How often captions should switch (in milliseconds)
|
|
75
|
-
// Higher values = more words per page
|
|
76
|
-
// Lower values = fewer words (more word-by-word)
|
|
77
|
-
const SWITCH_CAPTIONS_EVERY_MS = 1200;
|
|
78
|
-
|
|
79
|
-
const { pages } = useMemo(() => {
|
|
80
|
-
return createTikTokStyleCaptions({
|
|
81
|
-
captions,
|
|
82
|
-
combineTokensWithinMilliseconds: SWITCH_CAPTIONS_EVERY_MS,
|
|
83
|
-
});
|
|
84
|
-
}, [captions]);
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
If a caption has `pageBreakAfter: true`, the current page ends after that caption and the next caption starts a new page.
|
|
88
|
-
|
|
89
|
-
## Rendering with Sequences
|
|
90
|
-
|
|
91
|
-
Map over the pages and render each one in a `<Sequence>`. Calculate the start frame and duration from the page timing:
|
|
92
|
-
|
|
93
|
-
```tsx
|
|
94
|
-
import { Sequence, useVideoConfig, AbsoluteFill } from "remotion";
|
|
95
|
-
import type { TikTokPage } from "@remotion/captions";
|
|
96
|
-
|
|
97
|
-
const CaptionedContent: React.FC = () => {
|
|
98
|
-
const { fps } = useVideoConfig();
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<AbsoluteFill>
|
|
102
|
-
{pages.map((page, index) => {
|
|
103
|
-
const nextPage = pages[index + 1] ?? null;
|
|
104
|
-
const startFrame = (page.startMs / 1000) * fps;
|
|
105
|
-
const endFrame = Math.min(
|
|
106
|
-
nextPage ? (nextPage.startMs / 1000) * fps : Infinity,
|
|
107
|
-
startFrame + (SWITCH_CAPTIONS_EVERY_MS / 1000) * fps,
|
|
108
|
-
);
|
|
109
|
-
const durationInFrames = endFrame - startFrame;
|
|
110
|
-
|
|
111
|
-
if (durationInFrames <= 0) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return (
|
|
116
|
-
<Sequence
|
|
117
|
-
key={index}
|
|
118
|
-
from={startFrame}
|
|
119
|
-
durationInFrames={durationInFrames}
|
|
120
|
-
>
|
|
121
|
-
<CaptionPage page={page} />
|
|
122
|
-
</Sequence>
|
|
123
|
-
);
|
|
124
|
-
})}
|
|
125
|
-
</AbsoluteFill>
|
|
126
|
-
);
|
|
127
|
-
};
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## White-space preservation
|
|
131
|
-
|
|
132
|
-
The captions are whitespace sensitive. You should include spaces in the `text` field before each word. Use `whiteSpace: "pre"` to preserve the whitespace in the captions.
|
|
133
|
-
|
|
134
|
-
## Separate component for captions
|
|
135
|
-
|
|
136
|
-
Put captioning logic in a separate component.
|
|
137
|
-
Make a new file for it.
|
|
138
|
-
|
|
139
|
-
## Word highlighting
|
|
140
|
-
|
|
141
|
-
A caption page contains `tokens` which you can use to highlight the currently spoken word:
|
|
142
|
-
|
|
143
|
-
```tsx
|
|
144
|
-
import { AbsoluteFill, useCurrentFrame, useVideoConfig } from "remotion";
|
|
145
|
-
import type { TikTokPage } from "@remotion/captions";
|
|
146
|
-
|
|
147
|
-
const HIGHLIGHT_COLOR = "#39E508";
|
|
148
|
-
|
|
149
|
-
const CaptionPage: React.FC<{ page: TikTokPage }> = ({ page }) => {
|
|
150
|
-
const frame = useCurrentFrame();
|
|
151
|
-
const { fps } = useVideoConfig();
|
|
152
|
-
|
|
153
|
-
// Current time relative to the start of the sequence
|
|
154
|
-
const currentTimeMs = (frame / fps) * 1000;
|
|
155
|
-
// Convert to absolute time by adding the page start
|
|
156
|
-
const absoluteTimeMs = page.startMs + currentTimeMs;
|
|
157
|
-
|
|
158
|
-
return (
|
|
159
|
-
<AbsoluteFill style={{ justifyContent: "center", alignItems: "center" }}>
|
|
160
|
-
<div style={{ fontSize: 80, fontWeight: "bold", whiteSpace: "pre" }}>
|
|
161
|
-
{page.tokens.map((token, tokenIndex) => {
|
|
162
|
-
const isActive =
|
|
163
|
-
token.fromMs <= absoluteTimeMs && token.toMs > absoluteTimeMs;
|
|
164
|
-
|
|
165
|
-
return (
|
|
166
|
-
<span
|
|
167
|
-
key={`${token.fromMs}-${tokenIndex}`}
|
|
168
|
-
style={{ color: isActive ? HIGHLIGHT_COLOR : "white" }}
|
|
169
|
-
>
|
|
170
|
-
{token.text}
|
|
171
|
-
</span>
|
|
172
|
-
);
|
|
173
|
-
})}
|
|
174
|
-
</div>
|
|
175
|
-
</AbsoluteFill>
|
|
176
|
-
);
|
|
177
|
-
};
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## Display captions alongside video content
|
|
181
|
-
|
|
182
|
-
By default, put the captions alongside the video content, so the captions are in sync.
|
|
183
|
-
For each video, make a new captions JSON file.
|
|
184
|
-
|
|
185
|
-
```tsx
|
|
186
|
-
<AbsoluteFill>
|
|
187
|
-
<Video src={staticFile("video.mp4")} />
|
|
188
|
-
<CaptionPage page={page} />
|
|
189
|
-
</AbsoluteFill>
|
|
190
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: display-captions
|
|
3
|
+
description: Displaying captions in Remotion with TikTok-style pages and word highlighting
|
|
4
|
+
metadata:
|
|
5
|
+
tags: captions, subtitles, display, tiktok, highlight
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Displaying captions in Remotion
|
|
9
|
+
|
|
10
|
+
This guide explains how to display captions in Remotion, assuming you already have captions in the [`Caption`](https://www.remotion.dev/docs/captions/caption) format.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
Read [Transcribing audio](transcribe-captions.md) for how to generate captions.
|
|
15
|
+
|
|
16
|
+
First, the [`@remotion/captions`](https://www.remotion.dev/docs/captions) package needs to be installed.
|
|
17
|
+
If it is not installed, use the following command:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx remotion add @remotion/captions
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Fetching captions
|
|
24
|
+
|
|
25
|
+
First, fetch your captions JSON file. Use [`useDelayRender()`](https://www.remotion.dev/docs/use-delay-render) to hold the render until the captions are loaded:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { useState, useEffect, useCallback } from "react";
|
|
29
|
+
import { AbsoluteFill, staticFile, useDelayRender } from "remotion";
|
|
30
|
+
import type { Caption } from "@remotion/captions";
|
|
31
|
+
|
|
32
|
+
export const MyComponent: React.FC = () => {
|
|
33
|
+
const [captions, setCaptions] = useState<Caption[] | null>(null);
|
|
34
|
+
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
35
|
+
const [handle] = useState(() => delayRender());
|
|
36
|
+
|
|
37
|
+
const fetchCaptions = useCallback(async () => {
|
|
38
|
+
try {
|
|
39
|
+
// Assuming captions.json is in the public/ folder.
|
|
40
|
+
const response = await fetch(staticFile("captions123.json"));
|
|
41
|
+
const data = await response.json();
|
|
42
|
+
setCaptions(data);
|
|
43
|
+
continueRender(handle);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
cancelRender(e);
|
|
46
|
+
}
|
|
47
|
+
}, [continueRender, cancelRender, handle]);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
fetchCaptions();
|
|
51
|
+
}, [fetchCaptions]);
|
|
52
|
+
|
|
53
|
+
if (!captions) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<AbsoluteFill>
|
|
59
|
+
{/* Render captions here */}
|
|
60
|
+
</AbsoluteFill>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Creating pages
|
|
66
|
+
|
|
67
|
+
Use `createTikTokStyleCaptions()` to group captions into pages. The `combineTokensWithinMilliseconds` option controls how many words appear at once:
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { useMemo } from "react";
|
|
71
|
+
import { createTikTokStyleCaptions } from "@remotion/captions";
|
|
72
|
+
import type { Caption } from "@remotion/captions";
|
|
73
|
+
|
|
74
|
+
// How often captions should switch (in milliseconds)
|
|
75
|
+
// Higher values = more words per page
|
|
76
|
+
// Lower values = fewer words (more word-by-word)
|
|
77
|
+
const SWITCH_CAPTIONS_EVERY_MS = 1200;
|
|
78
|
+
|
|
79
|
+
const { pages } = useMemo(() => {
|
|
80
|
+
return createTikTokStyleCaptions({
|
|
81
|
+
captions,
|
|
82
|
+
combineTokensWithinMilliseconds: SWITCH_CAPTIONS_EVERY_MS,
|
|
83
|
+
});
|
|
84
|
+
}, [captions]);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If a caption has `pageBreakAfter: true`, the current page ends after that caption and the next caption starts a new page.
|
|
88
|
+
|
|
89
|
+
## Rendering with Sequences
|
|
90
|
+
|
|
91
|
+
Map over the pages and render each one in a `<Sequence>`. Calculate the start frame and duration from the page timing:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import { Sequence, useVideoConfig, AbsoluteFill } from "remotion";
|
|
95
|
+
import type { TikTokPage } from "@remotion/captions";
|
|
96
|
+
|
|
97
|
+
const CaptionedContent: React.FC = () => {
|
|
98
|
+
const { fps } = useVideoConfig();
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<AbsoluteFill>
|
|
102
|
+
{pages.map((page, index) => {
|
|
103
|
+
const nextPage = pages[index + 1] ?? null;
|
|
104
|
+
const startFrame = (page.startMs / 1000) * fps;
|
|
105
|
+
const endFrame = Math.min(
|
|
106
|
+
nextPage ? (nextPage.startMs / 1000) * fps : Infinity,
|
|
107
|
+
startFrame + (SWITCH_CAPTIONS_EVERY_MS / 1000) * fps,
|
|
108
|
+
);
|
|
109
|
+
const durationInFrames = endFrame - startFrame;
|
|
110
|
+
|
|
111
|
+
if (durationInFrames <= 0) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<Sequence
|
|
117
|
+
key={index}
|
|
118
|
+
from={startFrame}
|
|
119
|
+
durationInFrames={durationInFrames}
|
|
120
|
+
>
|
|
121
|
+
<CaptionPage page={page} />
|
|
122
|
+
</Sequence>
|
|
123
|
+
);
|
|
124
|
+
})}
|
|
125
|
+
</AbsoluteFill>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## White-space preservation
|
|
131
|
+
|
|
132
|
+
The captions are whitespace sensitive. You should include spaces in the `text` field before each word. Use `whiteSpace: "pre"` to preserve the whitespace in the captions.
|
|
133
|
+
|
|
134
|
+
## Separate component for captions
|
|
135
|
+
|
|
136
|
+
Put captioning logic in a separate component.
|
|
137
|
+
Make a new file for it.
|
|
138
|
+
|
|
139
|
+
## Word highlighting
|
|
140
|
+
|
|
141
|
+
A caption page contains `tokens` which you can use to highlight the currently spoken word:
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { AbsoluteFill, useCurrentFrame, useVideoConfig } from "remotion";
|
|
145
|
+
import type { TikTokPage } from "@remotion/captions";
|
|
146
|
+
|
|
147
|
+
const HIGHLIGHT_COLOR = "#39E508";
|
|
148
|
+
|
|
149
|
+
const CaptionPage: React.FC<{ page: TikTokPage }> = ({ page }) => {
|
|
150
|
+
const frame = useCurrentFrame();
|
|
151
|
+
const { fps } = useVideoConfig();
|
|
152
|
+
|
|
153
|
+
// Current time relative to the start of the sequence
|
|
154
|
+
const currentTimeMs = (frame / fps) * 1000;
|
|
155
|
+
// Convert to absolute time by adding the page start
|
|
156
|
+
const absoluteTimeMs = page.startMs + currentTimeMs;
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<AbsoluteFill style={{ justifyContent: "center", alignItems: "center" }}>
|
|
160
|
+
<div style={{ fontSize: 80, fontWeight: "bold", whiteSpace: "pre" }}>
|
|
161
|
+
{page.tokens.map((token, tokenIndex) => {
|
|
162
|
+
const isActive =
|
|
163
|
+
token.fromMs <= absoluteTimeMs && token.toMs > absoluteTimeMs;
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<span
|
|
167
|
+
key={`${token.fromMs}-${tokenIndex}`}
|
|
168
|
+
style={{ color: isActive ? HIGHLIGHT_COLOR : "white" }}
|
|
169
|
+
>
|
|
170
|
+
{token.text}
|
|
171
|
+
</span>
|
|
172
|
+
);
|
|
173
|
+
})}
|
|
174
|
+
</div>
|
|
175
|
+
</AbsoluteFill>
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Display captions alongside video content
|
|
181
|
+
|
|
182
|
+
By default, put the captions alongside the video content, so the captions are in sync.
|
|
183
|
+
For each video, make a new captions JSON file.
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
<AbsoluteFill>
|
|
187
|
+
<Video src={staticFile("video.mp4")} />
|
|
188
|
+
<CaptionPage page={page} />
|
|
189
|
+
</AbsoluteFill>
|
|
190
|
+
```
|