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.
Files changed (293) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.en.md +26 -65
  3. package/README.md +25 -67
  4. package/docs/USAGE.en.md +93 -0
  5. package/docs/USAGE.md +97 -0
  6. package/docs/VALIDATION.md +22 -0
  7. package/lib/client.js +90 -0
  8. package/lib/index.d.ts +3 -0
  9. package/lib/index.js +5 -1
  10. package/lib/media-store.d.ts +25 -0
  11. package/lib/media-store.js +174 -0
  12. package/lib/media-templates.d.ts +52 -0
  13. package/lib/media-templates.js +91 -0
  14. package/lib/media-workbench.d.ts +42 -0
  15. package/lib/media-workbench.js +476 -0
  16. package/package.json +18 -5
  17. package/scripts/build-client.mjs +4 -0
  18. package/skills/remotion-best-practices/SKILL.md +54 -54
  19. package/skills/remotion-best-practices/agents/openai.yaml +7 -7
  20. package/skills/remotion-best-practices/assets/remotion-icon.svg +4 -4
  21. package/skills/remotion-best-practices/remotion-captions/REFERENCE.md +36 -36
  22. package/skills/remotion-best-practices/remotion-captions/agents/openai.yaml +7 -7
  23. package/skills/remotion-best-practices/remotion-captions/assets/remotion-icon.svg +4 -4
  24. package/skills/remotion-best-practices/remotion-captions/display-captions.md +190 -190
  25. package/skills/remotion-best-practices/remotion-captions/import-srt-captions.md +73 -73
  26. package/skills/remotion-best-practices/remotion-captions/transcribe-captions.md +70 -70
  27. package/skills/remotion-best-practices/remotion-create/REFERENCE.md +85 -85
  28. package/skills/remotion-best-practices/remotion-create/agents/openai.yaml +7 -7
  29. package/skills/remotion-best-practices/remotion-create/assets/remotion-icon.svg +4 -4
  30. package/skills/remotion-best-practices/remotion-create/tailwind.md +11 -11
  31. package/skills/remotion-best-practices/remotion-create/video-layout.md +9 -9
  32. package/skills/remotion-best-practices/remotion-docs/REFERENCE.md +46 -46
  33. package/skills/remotion-best-practices/remotion-docs/agents/openai.yaml +7 -7
  34. package/skills/remotion-best-practices/remotion-docs/assets/remotion-icon.svg +4 -4
  35. package/skills/remotion-best-practices/remotion-interactivity/REFERENCE.md +315 -315
  36. package/skills/remotion-best-practices/remotion-interactivity/agents/openai.yaml +7 -7
  37. package/skills/remotion-best-practices/remotion-interactivity/assets/remotion-icon.svg +4 -4
  38. package/skills/remotion-best-practices/remotion-maps/REFERENCE.md +36 -36
  39. package/skills/remotion-best-practices/remotion-maps/agents/openai.yaml +7 -7
  40. package/skills/remotion-best-practices/remotion-maps/assets/remotion-icon.svg +4 -4
  41. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -89
  42. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -284
  43. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -299
  44. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/city-path.json +12 -12
  45. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -39
  46. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -35
  47. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -215
  48. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -43
  49. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -128
  50. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -57
  51. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -161
  52. package/skills/remotion-best-practices/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -449
  53. package/skills/remotion-best-practices/remotion-maps/techniques/mapbox/references/render-stability.md +64 -64
  54. package/skills/remotion-best-practices/remotion-maps/techniques/maplibre/TECHNIQUE.md +484 -484
  55. package/skills/remotion-best-practices/remotion-maps/techniques/maplibre/references/render-stability.md +64 -64
  56. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -80
  57. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -70
  58. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -80
  59. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -363
  60. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -22
  61. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -7535
  62. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -605
  63. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -34
  64. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -91
  65. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -129
  66. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -85
  67. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/render-stability.md +64 -64
  68. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -202
  69. package/skills/remotion-best-practices/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -37
  70. package/skills/remotion-best-practices/remotion-markup/3d.md +86 -86
  71. package/skills/remotion-best-practices/remotion-markup/REFERENCE.md +358 -358
  72. package/skills/remotion-best-practices/remotion-markup/agents/openai.yaml +7 -7
  73. package/skills/remotion-best-practices/remotion-markup/assets/remotion-icon.svg +4 -4
  74. package/skills/remotion-best-practices/remotion-markup/audio-visualization.md +198 -198
  75. package/skills/remotion-best-practices/remotion-markup/audio.md +169 -169
  76. package/skills/remotion-best-practices/remotion-markup/calculate-metadata.md +136 -136
  77. package/skills/remotion-best-practices/remotion-markup/compositions.md +123 -123
  78. package/skills/remotion-best-practices/remotion-markup/connected-compositions.md +79 -79
  79. package/skills/remotion-best-practices/remotion-markup/cropping.md +34 -34
  80. package/skills/remotion-best-practices/remotion-markup/effects.md +251 -251
  81. package/skills/remotion-best-practices/remotion-markup/embedding-videos.md +171 -171
  82. package/skills/remotion-best-practices/remotion-markup/ffmpeg.md +38 -38
  83. package/skills/remotion-best-practices/remotion-markup/gifs.md +187 -187
  84. package/skills/remotion-best-practices/remotion-markup/google-fonts.md +76 -76
  85. package/skills/remotion-best-practices/remotion-markup/html-in-canvas.md +128 -128
  86. package/skills/remotion-best-practices/remotion-markup/images.md +73 -73
  87. package/skills/remotion-best-practices/remotion-markup/light-leaks.md +106 -106
  88. package/skills/remotion-best-practices/remotion-markup/local-fonts.md +69 -69
  89. package/skills/remotion-best-practices/remotion-markup/lottie.md +73 -73
  90. package/skills/remotion-best-practices/remotion-markup/measuring-dom-nodes.md +38 -38
  91. package/skills/remotion-best-practices/remotion-markup/measuring-text.md +146 -146
  92. package/skills/remotion-best-practices/remotion-markup/motion-blur.md +60 -60
  93. package/skills/remotion-best-practices/remotion-markup/multi-scene-video.md +81 -81
  94. package/skills/remotion-best-practices/remotion-markup/parameters.md +111 -111
  95. package/skills/remotion-best-practices/remotion-markup/remotion-maps/REFERENCE.md +36 -36
  96. package/skills/remotion-best-practices/remotion-markup/remotion-maps/agents/openai.yaml +7 -7
  97. package/skills/remotion-best-practices/remotion-markup/remotion-maps/assets/remotion-icon.svg +4 -4
  98. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -89
  99. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -284
  100. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -299
  101. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/city-path.json +12 -12
  102. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -39
  103. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -35
  104. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -215
  105. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -43
  106. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -128
  107. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -57
  108. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -161
  109. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -449
  110. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/mapbox/references/render-stability.md +64 -64
  111. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maplibre/TECHNIQUE.md +484 -484
  112. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maplibre/references/render-stability.md +64 -64
  113. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -80
  114. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -70
  115. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -80
  116. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -363
  117. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -22
  118. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -7535
  119. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -605
  120. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -34
  121. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -91
  122. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -129
  123. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -85
  124. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/render-stability.md +64 -64
  125. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -202
  126. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -37
  127. package/skills/remotion-best-practices/remotion-markup/sequencing.md +169 -169
  128. package/skills/remotion-best-practices/remotion-markup/sfx.md +51 -51
  129. package/skills/remotion-best-practices/remotion-markup/silence-detection.md +71 -71
  130. package/skills/remotion-best-practices/remotion-markup/text-highlights.md +56 -56
  131. package/skills/remotion-best-practices/remotion-markup/timing.md +111 -111
  132. package/skills/remotion-best-practices/remotion-markup/transitions.md +239 -239
  133. package/skills/remotion-best-practices/remotion-markup/video-editing.md +90 -90
  134. package/skills/remotion-best-practices/remotion-markup/voiceover.md +99 -99
  135. package/skills/remotion-best-practices/remotion-multimedia/REFERENCE.md +20 -20
  136. package/skills/remotion-best-practices/remotion-multimedia/agents/openai.yaml +7 -7
  137. package/skills/remotion-best-practices/remotion-multimedia/assets/remotion-icon.svg +4 -4
  138. package/skills/remotion-best-practices/remotion-multimedia/get-audio-duration.md +56 -56
  139. package/skills/remotion-best-practices/remotion-multimedia/get-video-dimensions.md +66 -66
  140. package/skills/remotion-best-practices/remotion-multimedia/get-video-duration.md +58 -58
  141. package/skills/remotion-best-practices/remotion-render/REFERENCE.md +35 -35
  142. package/skills/remotion-best-practices/remotion-render/agents/openai.yaml +7 -7
  143. package/skills/remotion-best-practices/remotion-render/assets/remotion-icon.svg +4 -4
  144. package/skills/remotion-best-practices/remotion-render/transparent-videos.md +106 -106
  145. package/skills/remotion-best-practices/remotion-saas/REFERENCE.md +33 -33
  146. package/skills/remotion-best-practices/remotion-saas/agents/openai.yaml +7 -7
  147. package/skills/remotion-best-practices/remotion-saas/assets/remotion-icon.svg +4 -4
  148. package/skills/remotion-best-practices/remotion-saas/framework.md +19 -19
  149. package/skills/remotion-best-practices/remotion-saas/player.md +33 -33
  150. package/skills/remotion-best-practices/remotion-saas/rendering.md +69 -69
  151. package/skills/remotion-best-practices/remotion-studio/REFERENCE.md +24 -24
  152. package/skills/remotion-best-practices/remotion-studio/agents/openai.yaml +7 -7
  153. package/skills/remotion-best-practices/remotion-studio/assets/remotion-icon.svg +4 -4
  154. package/skills/remotion-best-practices/remotion-upgrade/REFERENCE.md +31 -31
  155. package/skills/remotion-best-practices/remotion-upgrade/agents/openai.yaml +7 -7
  156. package/skills/remotion-best-practices/remotion-upgrade/assets/remotion-icon.svg +4 -4
  157. package/skills/remotion-captions/SKILL.md +31 -31
  158. package/skills/remotion-captions/agents/openai.yaml +7 -7
  159. package/skills/remotion-captions/assets/remotion-icon.svg +4 -4
  160. package/skills/remotion-captions/display-captions.md +190 -190
  161. package/skills/remotion-captions/import-srt-captions.md +73 -73
  162. package/skills/remotion-captions/transcribe-captions.md +70 -70
  163. package/skills/remotion-create/SKILL.md +80 -80
  164. package/skills/remotion-create/agents/openai.yaml +7 -7
  165. package/skills/remotion-create/assets/remotion-icon.svg +4 -4
  166. package/skills/remotion-create/tailwind.md +11 -11
  167. package/skills/remotion-create/video-layout.md +9 -9
  168. package/skills/remotion-docs/SKILL.md +41 -41
  169. package/skills/remotion-docs/agents/openai.yaml +7 -7
  170. package/skills/remotion-docs/assets/remotion-icon.svg +4 -4
  171. package/skills/remotion-interactivity/SKILL.md +310 -310
  172. package/skills/remotion-interactivity/agents/openai.yaml +7 -7
  173. package/skills/remotion-interactivity/assets/remotion-icon.svg +4 -4
  174. package/skills/remotion-maps/SKILL.md +31 -31
  175. package/skills/remotion-maps/agents/openai.yaml +7 -7
  176. package/skills/remotion-maps/assets/remotion-icon.svg +4 -4
  177. package/skills/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -89
  178. package/skills/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -284
  179. package/skills/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -299
  180. package/skills/remotion-maps/techniques/cesium/assets/city-path.json +12 -12
  181. package/skills/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -39
  182. package/skills/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -35
  183. package/skills/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -215
  184. package/skills/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -43
  185. package/skills/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -128
  186. package/skills/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -57
  187. package/skills/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -161
  188. package/skills/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -449
  189. package/skills/remotion-maps/techniques/mapbox/references/render-stability.md +64 -64
  190. package/skills/remotion-maps/techniques/maplibre/TECHNIQUE.md +484 -484
  191. package/skills/remotion-maps/techniques/maplibre/references/render-stability.md +64 -64
  192. package/skills/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -80
  193. package/skills/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -70
  194. package/skills/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -80
  195. package/skills/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -363
  196. package/skills/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -22
  197. package/skills/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -7535
  198. package/skills/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -605
  199. package/skills/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -34
  200. package/skills/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -91
  201. package/skills/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -129
  202. package/skills/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -85
  203. package/skills/remotion-maps/techniques/maptiler/references/render-stability.md +64 -64
  204. package/skills/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -202
  205. package/skills/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -37
  206. package/skills/remotion-markup/3d.md +86 -86
  207. package/skills/remotion-markup/SKILL.md +353 -353
  208. package/skills/remotion-markup/agents/openai.yaml +7 -7
  209. package/skills/remotion-markup/assets/remotion-icon.svg +4 -4
  210. package/skills/remotion-markup/audio-visualization.md +198 -198
  211. package/skills/remotion-markup/audio.md +169 -169
  212. package/skills/remotion-markup/calculate-metadata.md +136 -136
  213. package/skills/remotion-markup/compositions.md +123 -123
  214. package/skills/remotion-markup/connected-compositions.md +79 -79
  215. package/skills/remotion-markup/cropping.md +34 -34
  216. package/skills/remotion-markup/effects.md +251 -251
  217. package/skills/remotion-markup/embedding-videos.md +171 -171
  218. package/skills/remotion-markup/ffmpeg.md +38 -38
  219. package/skills/remotion-markup/gifs.md +187 -187
  220. package/skills/remotion-markup/google-fonts.md +76 -76
  221. package/skills/remotion-markup/html-in-canvas.md +128 -128
  222. package/skills/remotion-markup/images.md +73 -73
  223. package/skills/remotion-markup/light-leaks.md +106 -106
  224. package/skills/remotion-markup/local-fonts.md +69 -69
  225. package/skills/remotion-markup/lottie.md +73 -73
  226. package/skills/remotion-markup/measuring-dom-nodes.md +38 -38
  227. package/skills/remotion-markup/measuring-text.md +146 -146
  228. package/skills/remotion-markup/motion-blur.md +60 -60
  229. package/skills/remotion-markup/multi-scene-video.md +81 -81
  230. package/skills/remotion-markup/parameters.md +111 -111
  231. package/skills/remotion-markup/remotion-maps/REFERENCE.md +36 -36
  232. package/skills/remotion-markup/remotion-maps/agents/openai.yaml +7 -7
  233. package/skills/remotion-markup/remotion-maps/assets/remotion-icon.svg +4 -4
  234. package/skills/remotion-markup/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -89
  235. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -284
  236. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -299
  237. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/city-path.json +12 -12
  238. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -39
  239. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -35
  240. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -215
  241. package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -43
  242. package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -128
  243. package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -57
  244. package/skills/remotion-markup/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -161
  245. package/skills/remotion-markup/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -449
  246. package/skills/remotion-markup/remotion-maps/techniques/mapbox/references/render-stability.md +64 -64
  247. package/skills/remotion-markup/remotion-maps/techniques/maplibre/TECHNIQUE.md +484 -484
  248. package/skills/remotion-markup/remotion-maps/techniques/maplibre/references/render-stability.md +64 -64
  249. package/skills/remotion-markup/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -80
  250. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -70
  251. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -80
  252. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -363
  253. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -22
  254. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -7535
  255. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -605
  256. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -34
  257. package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -91
  258. package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -129
  259. package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -85
  260. package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/render-stability.md +64 -64
  261. package/skills/remotion-markup/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -202
  262. package/skills/remotion-markup/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -37
  263. package/skills/remotion-markup/sequencing.md +169 -169
  264. package/skills/remotion-markup/sfx.md +51 -51
  265. package/skills/remotion-markup/silence-detection.md +71 -71
  266. package/skills/remotion-markup/text-highlights.md +56 -56
  267. package/skills/remotion-markup/timing.md +111 -111
  268. package/skills/remotion-markup/transitions.md +239 -239
  269. package/skills/remotion-markup/video-editing.md +90 -90
  270. package/skills/remotion-markup/voiceover.md +99 -99
  271. package/skills/remotion-multimedia/SKILL.md +15 -15
  272. package/skills/remotion-multimedia/agents/openai.yaml +7 -7
  273. package/skills/remotion-multimedia/assets/remotion-icon.svg +4 -4
  274. package/skills/remotion-multimedia/get-audio-duration.md +56 -56
  275. package/skills/remotion-multimedia/get-video-dimensions.md +66 -66
  276. package/skills/remotion-multimedia/get-video-duration.md +58 -58
  277. package/skills/remotion-render/SKILL.md +30 -30
  278. package/skills/remotion-render/agents/openai.yaml +7 -7
  279. package/skills/remotion-render/assets/remotion-icon.svg +4 -4
  280. package/skills/remotion-render/transparent-videos.md +106 -106
  281. package/skills/remotion-saas/SKILL.md +28 -28
  282. package/skills/remotion-saas/agents/openai.yaml +7 -7
  283. package/skills/remotion-saas/assets/remotion-icon.svg +4 -4
  284. package/skills/remotion-saas/framework.md +19 -19
  285. package/skills/remotion-saas/player.md +33 -33
  286. package/skills/remotion-saas/rendering.md +69 -69
  287. package/skills/remotion-studio/SKILL.md +19 -19
  288. package/skills/remotion-studio/agents/openai.yaml +7 -7
  289. package/skills/remotion-studio/assets/remotion-icon.svg +4 -4
  290. package/skills/remotion-upgrade/SKILL.md +26 -26
  291. package/skills/remotion-upgrade/agents/openai.yaml +7 -7
  292. package/skills/remotion-upgrade/assets/remotion-icon.svg +4 -4
  293. 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
+ ```