dsh-remotion 0.2.0 → 0.3.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 (292) hide show
  1. package/README.en.md +7 -5
  2. package/README.md +3 -3
  3. package/lib/index.d.ts +2 -2
  4. package/lib/index.js +15 -2
  5. package/package.json +1 -1
  6. package/skills/remotion-best-practices/SKILL.md +59 -0
  7. package/skills/remotion-best-practices/agents/openai.yaml +7 -0
  8. package/skills/remotion-best-practices/assets/remotion-icon.png +0 -0
  9. package/skills/remotion-best-practices/remotion-captions/SKILL.md +36 -0
  10. package/skills/remotion-best-practices/remotion-captions/agents/openai.yaml +7 -0
  11. package/skills/remotion-best-practices/remotion-captions/assets/remotion-icon.png +0 -0
  12. package/skills/{remotion/rules → remotion-best-practices/remotion-captions}/display-captions.md +9 -3
  13. package/skills/{remotion/rules → remotion-best-practices/remotion-captions}/import-srt-captions.md +5 -1
  14. package/skills/remotion-best-practices/remotion-create/SKILL.md +68 -0
  15. package/skills/remotion-best-practices/remotion-create/agents/openai.yaml +7 -0
  16. package/skills/remotion-best-practices/remotion-create/assets/remotion-icon.png +0 -0
  17. package/skills/{remotion/rules → remotion-best-practices/remotion-create}/tailwind.md +1 -1
  18. package/skills/remotion-best-practices/remotion-create/video-layout.md +9 -0
  19. package/skills/remotion-best-practices/remotion-docs/SKILL.md +46 -0
  20. package/skills/remotion-best-practices/remotion-docs/agents/openai.yaml +7 -0
  21. package/skills/remotion-best-practices/remotion-docs/assets/remotion-icon.png +0 -0
  22. package/skills/remotion-best-practices/remotion-interactivity/SKILL.md +247 -0
  23. package/skills/remotion-best-practices/remotion-interactivity/agents/openai.yaml +7 -0
  24. package/skills/remotion-best-practices/remotion-interactivity/assets/remotion-icon.png +0 -0
  25. package/skills/remotion-best-practices/remotion-maps/SKILL.md +36 -0
  26. package/skills/remotion-best-practices/remotion-maps/agents/openai.yaml +7 -0
  27. package/skills/remotion-best-practices/remotion-maps/assets/remotion-icon.png +0 -0
  28. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -0
  29. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -0
  30. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -0
  31. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/city-path.json +12 -0
  32. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -0
  33. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -0
  34. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -0
  35. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -0
  36. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -0
  37. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -0
  38. package/skills/remotion-best-practices/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -0
  39. package/skills/remotion-best-practices/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -0
  40. package/skills/remotion-best-practices/remotion-maps/techniques/mapbox/references/render-stability.md +64 -0
  41. package/skills/remotion-best-practices/remotion-maps/techniques/maplibre/TECHNIQUE.md +465 -0
  42. package/skills/remotion-best-practices/remotion-maps/techniques/maplibre/references/render-stability.md +64 -0
  43. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -0
  44. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -0
  45. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -0
  46. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -0
  47. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -0
  48. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -0
  49. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -0
  50. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -0
  51. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -0
  52. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -0
  53. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -0
  54. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/references/render-stability.md +64 -0
  55. package/skills/remotion-best-practices/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -0
  56. package/skills/remotion-best-practices/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -0
  57. package/skills/remotion-best-practices/remotion-markup/SKILL.md +365 -0
  58. package/skills/remotion-best-practices/remotion-markup/agents/openai.yaml +7 -0
  59. package/skills/remotion-best-practices/remotion-markup/assets/remotion-icon.png +0 -0
  60. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/audio.md +4 -2
  61. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/calculate-metadata.md +4 -2
  62. package/skills/remotion-best-practices/remotion-markup/compositions.md +117 -0
  63. package/skills/remotion-best-practices/remotion-markup/cropping.md +34 -0
  64. package/skills/remotion-best-practices/remotion-markup/effects.md +251 -0
  65. package/skills/{remotion/rules/videos.md → remotion-best-practices/remotion-markup/embedding-videos.md} +6 -4
  66. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/ffmpeg.md +5 -1
  67. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/gifs.md +55 -9
  68. package/skills/remotion-best-practices/remotion-markup/google-fonts.md +76 -0
  69. package/skills/remotion-best-practices/remotion-markup/html-in-canvas.md +128 -0
  70. package/skills/remotion-best-practices/remotion-markup/images.md +73 -0
  71. package/skills/remotion-best-practices/remotion-markup/light-leaks.md +106 -0
  72. package/skills/remotion-best-practices/remotion-markup/local-fonts.md +69 -0
  73. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/lottie.md +4 -1
  74. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/measuring-dom-nodes.md +5 -1
  75. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/measuring-text.md +8 -2
  76. package/skills/remotion-best-practices/remotion-markup/multi-scene-video.md +81 -0
  77. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/parameters.md +3 -1
  78. package/skills/remotion-best-practices/remotion-markup/remotion-maps/SKILL.md +36 -0
  79. package/skills/remotion-best-practices/remotion-markup/remotion-maps/agents/openai.yaml +7 -0
  80. package/skills/remotion-best-practices/remotion-markup/remotion-maps/assets/remotion-icon.png +0 -0
  81. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -0
  82. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -0
  83. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -0
  84. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/city-path.json +12 -0
  85. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -0
  86. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -0
  87. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -0
  88. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -0
  89. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -0
  90. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -0
  91. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -0
  92. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -0
  93. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/mapbox/references/render-stability.md +64 -0
  94. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maplibre/TECHNIQUE.md +465 -0
  95. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maplibre/references/render-stability.md +64 -0
  96. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -0
  97. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -0
  98. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -0
  99. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -0
  100. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -0
  101. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -0
  102. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -0
  103. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -0
  104. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -0
  105. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -0
  106. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -0
  107. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/references/render-stability.md +64 -0
  108. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -0
  109. package/skills/remotion-best-practices/remotion-markup/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -0
  110. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/sequencing.md +63 -12
  111. package/skills/remotion-best-practices/remotion-markup/sfx.md +51 -0
  112. package/skills/remotion-best-practices/remotion-markup/text-highlights.md +56 -0
  113. package/skills/remotion-best-practices/remotion-markup/timing.md +111 -0
  114. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/transitions.md +49 -7
  115. package/skills/remotion-best-practices/remotion-markup/video-editing.md +90 -0
  116. package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/voiceover.md +2 -2
  117. package/skills/remotion-best-practices/remotion-multimedia/SKILL.md +20 -0
  118. package/skills/remotion-best-practices/remotion-multimedia/agents/openai.yaml +7 -0
  119. package/skills/remotion-best-practices/remotion-multimedia/assets/remotion-icon.png +0 -0
  120. package/skills/{remotion/rules → remotion-best-practices/remotion-multimedia}/get-audio-duration.md +1 -3
  121. package/skills/{remotion/rules → remotion-best-practices/remotion-multimedia}/get-video-dimensions.md +1 -3
  122. package/skills/{remotion/rules → remotion-best-practices/remotion-multimedia}/get-video-duration.md +1 -3
  123. package/skills/remotion-best-practices/remotion-render/SKILL.md +27 -0
  124. package/skills/remotion-best-practices/remotion-render/agents/openai.yaml +7 -0
  125. package/skills/remotion-best-practices/remotion-render/assets/remotion-icon.png +0 -0
  126. package/skills/remotion-best-practices/remotion-saas/SKILL.md +33 -0
  127. package/skills/remotion-best-practices/remotion-saas/agents/openai.yaml +7 -0
  128. package/skills/remotion-best-practices/remotion-saas/assets/remotion-icon.png +0 -0
  129. package/skills/remotion-best-practices/remotion-saas/framework.md +21 -0
  130. package/skills/remotion-best-practices/remotion-saas/player.md +33 -0
  131. package/skills/remotion-best-practices/remotion-saas/rendering.md +69 -0
  132. package/skills/remotion-best-practices/remotion-studio/SKILL.md +24 -0
  133. package/skills/remotion-best-practices/remotion-studio/agents/openai.yaml +7 -0
  134. package/skills/remotion-best-practices/remotion-studio/assets/remotion-icon.png +0 -0
  135. package/skills/remotion-best-practices/remotion-upgrade/SKILL.md +31 -0
  136. package/skills/remotion-best-practices/remotion-upgrade/agents/openai.yaml +7 -0
  137. package/skills/remotion-best-practices/remotion-upgrade/assets/remotion-icon.png +0 -0
  138. package/skills/remotion-captions/SKILL.md +36 -0
  139. package/skills/remotion-captions/agents/openai.yaml +7 -0
  140. package/skills/remotion-captions/assets/remotion-icon.png +0 -0
  141. package/skills/remotion-captions/display-captions.md +190 -0
  142. package/skills/remotion-captions/import-srt-captions.md +73 -0
  143. package/skills/remotion-captions/transcribe-captions.md +70 -0
  144. package/skills/remotion-create/SKILL.md +68 -0
  145. package/skills/remotion-create/agents/openai.yaml +7 -0
  146. package/skills/remotion-create/assets/remotion-icon.png +0 -0
  147. package/skills/remotion-create/tailwind.md +11 -0
  148. package/skills/remotion-create/video-layout.md +9 -0
  149. package/skills/remotion-docs/SKILL.md +46 -0
  150. package/skills/remotion-docs/agents/openai.yaml +7 -0
  151. package/skills/remotion-docs/assets/remotion-icon.png +0 -0
  152. package/skills/remotion-interactivity/SKILL.md +247 -0
  153. package/skills/remotion-interactivity/agents/openai.yaml +7 -0
  154. package/skills/remotion-interactivity/assets/remotion-icon.png +0 -0
  155. package/skills/remotion-maps/SKILL.md +36 -0
  156. package/skills/remotion-maps/agents/openai.yaml +7 -0
  157. package/skills/remotion-maps/assets/remotion-icon.png +0 -0
  158. package/skills/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -0
  159. package/skills/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -0
  160. package/skills/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -0
  161. package/skills/remotion-maps/techniques/cesium/assets/city-path.json +12 -0
  162. package/skills/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -0
  163. package/skills/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -0
  164. package/skills/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -0
  165. package/skills/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -0
  166. package/skills/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -0
  167. package/skills/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -0
  168. package/skills/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -0
  169. package/skills/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -0
  170. package/skills/remotion-maps/techniques/mapbox/references/render-stability.md +64 -0
  171. package/skills/remotion-maps/techniques/maplibre/TECHNIQUE.md +465 -0
  172. package/skills/remotion-maps/techniques/maplibre/references/render-stability.md +64 -0
  173. package/skills/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -0
  174. package/skills/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -0
  175. package/skills/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -0
  176. package/skills/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -0
  177. package/skills/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -0
  178. package/skills/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -0
  179. package/skills/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -0
  180. package/skills/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -0
  181. package/skills/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -0
  182. package/skills/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -0
  183. package/skills/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -0
  184. package/skills/remotion-maps/techniques/maptiler/references/render-stability.md +64 -0
  185. package/skills/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -0
  186. package/skills/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -0
  187. package/skills/remotion-markup/3d.md +86 -0
  188. package/skills/remotion-markup/SKILL.md +365 -0
  189. package/skills/remotion-markup/agents/openai.yaml +7 -0
  190. package/skills/remotion-markup/assets/remotion-icon.png +0 -0
  191. package/skills/remotion-markup/audio-visualization.md +198 -0
  192. package/skills/remotion-markup/audio.md +171 -0
  193. package/skills/remotion-markup/calculate-metadata.md +136 -0
  194. package/skills/remotion-markup/compositions.md +117 -0
  195. package/skills/remotion-markup/cropping.md +34 -0
  196. package/skills/remotion-markup/effects.md +251 -0
  197. package/skills/remotion-markup/embedding-videos.md +173 -0
  198. package/skills/remotion-markup/ffmpeg.md +38 -0
  199. package/skills/remotion-markup/gifs.md +187 -0
  200. package/skills/remotion-markup/google-fonts.md +76 -0
  201. package/skills/remotion-markup/html-in-canvas.md +128 -0
  202. package/skills/remotion-markup/images.md +73 -0
  203. package/skills/remotion-markup/light-leaks.md +106 -0
  204. package/skills/remotion-markup/local-fonts.md +69 -0
  205. package/skills/remotion-markup/lottie.md +73 -0
  206. package/skills/remotion-markup/measuring-dom-nodes.md +38 -0
  207. package/skills/remotion-markup/measuring-text.md +146 -0
  208. package/skills/remotion-markup/multi-scene-video.md +81 -0
  209. package/skills/remotion-markup/parameters.md +111 -0
  210. package/skills/remotion-markup/remotion-maps/SKILL.md +36 -0
  211. package/skills/remotion-markup/remotion-maps/agents/openai.yaml +7 -0
  212. package/skills/remotion-markup/remotion-maps/assets/remotion-icon.png +0 -0
  213. package/skills/remotion-markup/remotion-maps/techniques/cesium/TECHNIQUE.md +89 -0
  214. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/CesiumFlythrough.tsx +284 -0
  215. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/cesium-path.json +299 -0
  216. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/city-path.json +12 -0
  217. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/example-Root.tsx +39 -0
  218. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/flight-path.ts +35 -0
  219. package/skills/remotion-markup/remotion-maps/techniques/cesium/assets/sample-river.geojson +215 -0
  220. package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-data-sources.md +43 -0
  221. package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-flyover-architecture.md +128 -0
  222. package/skills/remotion-markup/remotion-maps/techniques/cesium/references/3d-troubleshooting.md +57 -0
  223. package/skills/remotion-markup/remotion-maps/techniques/cesium/scripts/prep-cesium-path.mjs +161 -0
  224. package/skills/remotion-markup/remotion-maps/techniques/mapbox/TECHNIQUE.md +449 -0
  225. package/skills/remotion-markup/remotion-maps/techniques/mapbox/references/render-stability.md +64 -0
  226. package/skills/remotion-markup/remotion-maps/techniques/maplibre/TECHNIQUE.md +465 -0
  227. package/skills/remotion-markup/remotion-maps/techniques/maplibre/references/render-stability.md +64 -0
  228. package/skills/remotion-markup/remotion-maps/techniques/maptiler/TECHNIQUE.md +80 -0
  229. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/CountryLabel.tsx +70 -0
  230. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts +80 -0
  231. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/RiverReveal.tsx +363 -0
  232. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/example-Root.tsx +22 -0
  233. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/country-meta.json +7535 -0
  234. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/sample-data/yarlung-flow.json +605 -0
  235. package/skills/remotion-markup/remotion-maps/techniques/maptiler/assets/tokens.ts +34 -0
  236. package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-data-sources.md +91 -0
  237. package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-explainer-architecture.md +129 -0
  238. package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/map-geo-prep.md +85 -0
  239. package/skills/remotion-markup/remotion-maps/techniques/maptiler/references/render-stability.md +64 -0
  240. package/skills/remotion-markup/remotion-maps/techniques/maptiler/scripts/prep-geo.mjs +202 -0
  241. package/skills/remotion-markup/remotion-maps/techniques/static-map/TECHNIQUE.md +37 -0
  242. package/skills/remotion-markup/sequencing.md +169 -0
  243. package/skills/remotion-markup/sfx.md +51 -0
  244. package/skills/remotion-markup/silence-detection.md +71 -0
  245. package/skills/remotion-markup/text-highlights.md +56 -0
  246. package/skills/remotion-markup/timing.md +111 -0
  247. package/skills/remotion-markup/transitions.md +239 -0
  248. package/skills/remotion-markup/video-editing.md +90 -0
  249. package/skills/remotion-markup/voiceover.md +99 -0
  250. package/skills/remotion-multimedia/SKILL.md +20 -0
  251. package/skills/remotion-multimedia/agents/openai.yaml +7 -0
  252. package/skills/remotion-multimedia/assets/remotion-icon.png +0 -0
  253. package/skills/remotion-multimedia/get-audio-duration.md +56 -0
  254. package/skills/remotion-multimedia/get-video-dimensions.md +66 -0
  255. package/skills/remotion-multimedia/get-video-duration.md +58 -0
  256. package/skills/remotion-render/SKILL.md +27 -0
  257. package/skills/remotion-render/agents/openai.yaml +7 -0
  258. package/skills/remotion-render/assets/remotion-icon.png +0 -0
  259. package/skills/remotion-render/transparent-videos.md +106 -0
  260. package/skills/remotion-saas/SKILL.md +33 -0
  261. package/skills/remotion-saas/agents/openai.yaml +7 -0
  262. package/skills/remotion-saas/assets/remotion-icon.png +0 -0
  263. package/skills/remotion-saas/framework.md +21 -0
  264. package/skills/remotion-saas/player.md +33 -0
  265. package/skills/remotion-saas/rendering.md +69 -0
  266. package/skills/remotion-studio/SKILL.md +24 -0
  267. package/skills/remotion-studio/agents/openai.yaml +7 -0
  268. package/skills/remotion-studio/assets/remotion-icon.png +0 -0
  269. package/skills/remotion-upgrade/SKILL.md +31 -0
  270. package/skills/remotion-upgrade/agents/openai.yaml +7 -0
  271. package/skills/remotion-upgrade/assets/remotion-icon.png +0 -0
  272. package/skills/remotion/SKILL.md +0 -95
  273. package/skills/remotion/rules/animations.md +0 -31
  274. package/skills/remotion/rules/assets.md +0 -78
  275. package/skills/remotion/rules/can-decode.md +0 -81
  276. package/skills/remotion/rules/charts.md +0 -120
  277. package/skills/remotion/rules/compositions.md +0 -154
  278. package/skills/remotion/rules/extract-frames.md +0 -229
  279. package/skills/remotion/rules/fonts.md +0 -152
  280. package/skills/remotion/rules/images.md +0 -134
  281. package/skills/remotion/rules/light-leaks.md +0 -73
  282. package/skills/remotion/rules/maps.md +0 -412
  283. package/skills/remotion/rules/sfx.md +0 -30
  284. package/skills/remotion/rules/subtitles.md +0 -36
  285. package/skills/remotion/rules/text-animations.md +0 -20
  286. package/skills/remotion/rules/timing.md +0 -136
  287. package/skills/remotion/rules/trimming.md +0 -51
  288. /package/skills/{remotion/rules → remotion-best-practices/remotion-captions}/transcribe-captions.md +0 -0
  289. /package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/3d.md +0 -0
  290. /package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/audio-visualization.md +0 -0
  291. /package/skills/{remotion/rules → remotion-best-practices/remotion-markup}/silence-detection.md +0 -0
  292. /package/skills/{remotion/rules → remotion-best-practices/remotion-render}/transparent-videos.md +0 -0
@@ -0,0 +1,251 @@
1
+ ---
2
+ name: effects
3
+ description: Canvas/WebGL visual effects for Remotion using effects arrays and createEffect().
4
+ metadata:
5
+ tags: effects, visual-effects, webgl, canvas, video, create-effect
6
+ ---
7
+
8
+ Use this rule only when the top-level skill lists an effect that matches the requested look, or when the user asks to create a reusable custom effect.
9
+
10
+ Docs: https://www.remotion.dev/docs/effects
11
+ Custom effect docs: https://www.remotion.dev/docs/create-effect
12
+
13
+ ## Usage
14
+
15
+ Install the package that provides the chosen effect:
16
+
17
+ ```bash
18
+ npx remotion add @remotion/effects
19
+ ```
20
+
21
+ Effects are functions passed to the `effects` prop of canvas-based components such as `<Video>` from `@remotion/media`, `<Solid>`, `<CanvasImage>`, and `<HtmlInCanvas>`.
22
+
23
+ ```tsx
24
+ import {Video} from '@remotion/media';
25
+ import {blur} from '@remotion/effects/blur';
26
+
27
+ <Video
28
+ src="https://remotion.media/video.mp4"
29
+ effects={[blur({radius: 8})]}
30
+ />;
31
+ ```
32
+
33
+ Use the effect docs for exact props and imports. Most `@remotion/effects` imports use `@remotion/effects/<effect-slug>`; `uvTranslate()` and `xyTranslate()` use `@remotion/effects/translate`.
34
+
35
+ These effects use WebGL2. During renders, enable WebGL with:
36
+
37
+ ```ts
38
+ import {Config} from '@remotion/cli/config';
39
+
40
+ Config.setChromiumOpenGlRenderer('angle');
41
+ ```
42
+
43
+ ## Available effects
44
+
45
+ `brightness()`, `contrast()`, `colorKey()`, `duotone()`, `grayscale()`, `hue()`, `invert()`, `saturation()`, `tint()`, `linearGradient()`, `linearGradientTint()`, `thermalVision()`, `blur()`, `linearProgressiveBlur()`, `radialProgressiveBlur()`, `zoomBlur()`, `dropShadow()`, `glow()`, `lightTrail()`, `evolve()`, `venetianBlinds()`, `mirror()`, `scale()`, `uvTranslate()`, `xyTranslate()`, `barrelDistortion()`, `chromaticAberration()`, `fisheye()`, `cornerPin()`, `wave()`, `burlap()`, `emboss()`, `dotGrid()`, `halftone()`, `noise()`, `noiseDisplacement()`, `paper()`, `roughenEdges()`, `pattern()`, `pixelate()`, `pixelDissolve()`, `scanlines()`, `speckle()`, `shine()`, `shrinkwrap()`, `vignette()`, `contourLines()`, `checkerboard()`, `halftoneLinearGradient()`, `gridlines()`, `whiteNoise()`, `tvSignalOff()`, `lines()`, `rings()`, `waves()`, `zigzag()`, `lightLeak()`, `starburst()`.
46
+
47
+ Example:
48
+
49
+ ```tsx
50
+ import {brightness} from "@remotion/effects";
51
+
52
+ <Video
53
+ src="https://remotion.media/video.mp4"
54
+ effects={[brightness({})]}
55
+ />;
56
+ ```
57
+
58
+ ## Custom effects
59
+
60
+ Use `createEffect()` from `remotion` when the user wants a reusable effect factory that works in the same `effects` array as `@remotion/effects`.
61
+
62
+ Prefer a custom effect over `<HtmlInCanvas onPaint>` when the transformation should be reusable, parameterized, editable in Studio, or stackable with other effects.
63
+
64
+ For quick project-specific effects, keep the effect next to the composition, for example `src/effects/palette-map.ts`. For library effects intended for `@remotion/effects`, follow the repository's `add-effect` skill instead.
65
+
66
+ `createEffect()` expects:
67
+
68
+ - `type`: stable reverse-DNS identifier, for example `com.example.paletteMap`.
69
+ - `label`: Studio label, commonly `paletteMap()`.
70
+ - `documentationLink`: URL or `null`.
71
+ - `backend`: `"2d"`, `"webgl2"` or `"webgpu"`.
72
+ - `calculateKey(params)`: stable string containing every resolved parameter that changes output.
73
+ - `setup(target)`: create reusable backend state, or return `null`.
74
+ - `apply({source, target, width, height, params, state, flipSourceY})`: draw the transformed result into `target`.
75
+ - `cleanup(state)`: free resources created by `setup()`.
76
+ - `schema`: an `InteractivitySchema` for Studio controls. `disabled` is added automatically.
77
+ - `validateParams(params)`: throw on missing or invalid values.
78
+
79
+ Use `backend: "2d"` for simple pixel, filter, drawImage, or image-data effects. Use WebGL2 only when shader math or GPU performance is needed; during renders, enable WebGL as shown above.
80
+
81
+ ```ts
82
+ import {createEffect, type InteractivitySchema} from 'remotion';
83
+
84
+ type MyEffectParams = {
85
+ readonly amount?: number;
86
+ };
87
+
88
+ const myEffectSchema = {
89
+ amount: {
90
+ type: 'number',
91
+ min: 0,
92
+ max: 1,
93
+ step: 0.01,
94
+ default: 1,
95
+ description: 'Amount',
96
+ },
97
+ } as const satisfies InteractivitySchema;
98
+
99
+ const resolve = (params: MyEffectParams) => ({
100
+ amount: params.amount ?? 1,
101
+ });
102
+
103
+ export const myEffect = createEffect<MyEffectParams, null>({
104
+ type: 'com.example.myEffect',
105
+ label: 'myEffect()',
106
+ documentationLink: null,
107
+ backend: '2d',
108
+ calculateKey: (params) => {
109
+ const {amount} = resolve(params);
110
+ return `my-effect-${amount}`;
111
+ },
112
+ setup: () => null,
113
+ apply: ({source, target, width, height, params}) => {
114
+ const ctx = target.getContext('2d');
115
+ if (!ctx) {
116
+ throw new Error('Could not get a 2D context for myEffect().');
117
+ }
118
+
119
+ const {amount} = resolve(params);
120
+
121
+ ctx.clearRect(0, 0, width, height);
122
+ ctx.filter = `opacity(${amount * 100}%)`;
123
+ ctx.drawImage(source, 0, 0, width, height);
124
+ ctx.filter = 'none';
125
+ },
126
+ cleanup: () => undefined,
127
+ schema: myEffectSchema,
128
+ validateParams: ({amount = 1}) => {
129
+ if (typeof amount !== 'number' || !Number.isFinite(amount) || amount < 0 || amount > 1) {
130
+ throw new TypeError('amount must be a number between 0 and 1');
131
+ }
132
+ },
133
+ });
134
+ ```
135
+
136
+ For a WebGL2 effect, compile/link shaders in `setup()`, keep the program, fullscreen quad, texture, and uniform locations in state, upload `source` in `apply()`, and free GPU resources in `cleanup()`. Minimal shape:
137
+
138
+ ```ts
139
+ import {createEffect, type InteractivitySchema} from 'remotion';
140
+
141
+ type RgbShiftParams = {
142
+ readonly amount?: number;
143
+ };
144
+
145
+ type RgbShiftState = {
146
+ readonly gl: WebGL2RenderingContext;
147
+ readonly program: WebGLProgram;
148
+ readonly vao: WebGLVertexArrayObject;
149
+ readonly vbo: WebGLBuffer;
150
+ readonly texture: WebGLTexture;
151
+ readonly uSource: WebGLUniformLocation | null;
152
+ readonly uOffset: WebGLUniformLocation | null;
153
+ };
154
+
155
+ const rgbShiftSchema = {
156
+ amount: {
157
+ type: 'number',
158
+ min: 0,
159
+ max: 80,
160
+ step: 1,
161
+ default: 12,
162
+ description: 'Amount',
163
+ },
164
+ } as const satisfies InteractivitySchema;
165
+
166
+ export const rgbShift = createEffect<RgbShiftParams, RgbShiftState>({
167
+ type: 'com.example.rgbShift',
168
+ label: 'rgbShift()',
169
+ documentationLink: null,
170
+ backend: 'webgl2',
171
+ calculateKey: ({amount = 12}) => `rgb-shift-${amount}`,
172
+ setup: (target) => {
173
+ const gl = target.getContext('webgl2', {
174
+ premultipliedAlpha: true,
175
+ alpha: true,
176
+ preserveDrawingBuffer: true,
177
+ });
178
+ if (!gl) {
179
+ throw new Error('Could not get a WebGL2 context for rgbShift().');
180
+ }
181
+
182
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
183
+
184
+ // Compile/link shaders, create a fullscreen quad VAO/VBO, create a
185
+ // CLAMP_TO_EDGE RGBA texture, and get uSource/uOffset uniform locations.
186
+ return createRgbShiftState(gl);
187
+ },
188
+ apply: ({source, width, height, params, state, flipSourceY}) => {
189
+ const amount = params.amount ?? 12;
190
+ const {gl} = state;
191
+
192
+ gl.viewport(0, 0, width, height);
193
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipSourceY);
194
+ gl.activeTexture(gl.TEXTURE0);
195
+ gl.bindTexture(gl.TEXTURE_2D, state.texture);
196
+ gl.texImage2D(
197
+ gl.TEXTURE_2D,
198
+ 0,
199
+ gl.RGBA,
200
+ gl.RGBA,
201
+ gl.UNSIGNED_BYTE,
202
+ source as TexImageSource,
203
+ );
204
+
205
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
206
+ gl.useProgram(state.program);
207
+ if (state.uSource) gl.uniform1i(state.uSource, 0);
208
+ if (state.uOffset) gl.uniform2f(state.uOffset, amount / width, 0);
209
+ gl.bindVertexArray(state.vao);
210
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
211
+ },
212
+ cleanup: ({gl, program, vao, vbo, texture}) => {
213
+ gl.deleteTexture(texture);
214
+ gl.deleteBuffer(vbo);
215
+ gl.deleteProgram(program);
216
+ gl.deleteVertexArray(vao);
217
+ },
218
+ schema: rgbShiftSchema,
219
+ validateParams: ({amount = 12}) => {
220
+ if (typeof amount !== 'number' || !Number.isFinite(amount) || amount < 0 || amount > 80) {
221
+ throw new TypeError('amount must be a number between 0 and 80');
222
+ }
223
+ },
224
+ });
225
+ ```
226
+
227
+ For a complete 2D and WebGL2 pair, see `packages/example/src/EffectsTestbed/sample-posterize-2d.ts` and `packages/example/src/EffectsTestbed/sample-rgb-shift-webgl.ts`.
228
+
229
+ Use the returned factory in an `effects` array:
230
+
231
+ ```tsx
232
+ import {CanvasImage, staticFile} from 'remotion';
233
+ import {myEffect} from './effects/my-effect';
234
+
235
+ export const MyComp: React.FC = () => {
236
+ return (
237
+ <CanvasImage
238
+ src={staticFile('image.png')}
239
+ effects={[myEffect({amount: 0.8})]}
240
+ />
241
+ );
242
+ };
243
+ ```
244
+
245
+ When generating a custom effect, also:
246
+
247
+ - Include `disabled?: boolean` only through the returned factory; do not add it to the custom params type or schema.
248
+ - Validate required parameters at factory-call time with `validateParams`.
249
+ - Include all defaults in both `schema` and the `resolve()` helper.
250
+ - Reset mutable 2D context state such as `filter`, `globalAlpha`, transforms, and compositing after drawing.
251
+ - Preserve alpha unless the requested effect intentionally changes transparency.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: videos
2
+ name: embedding-videos
3
3
  description: Embedding videos in Remotion - trimming, volume, speed, looping, pitch
4
4
  metadata:
5
5
  tags: video, media, trim, volume, speed, loop, pitch
@@ -84,8 +84,8 @@ Use the `style` prop to control size and position:
84
84
  position: "absolute",
85
85
  top: 100,
86
86
  left: 50,
87
- objectFit: "cover",
88
87
  }}
88
+ objectFit="cover"
89
89
  />
90
90
  ```
91
91
 
@@ -125,8 +125,10 @@ Use `muted` to silence the video entirely:
125
125
  Use `playbackRate` to change the playback speed:
126
126
 
127
127
  ```tsx
128
- <Video src={staticFile("video.mp4")} playbackRate={2} /> {/* 2x speed */}
129
- <Video src={staticFile("video.mp4")} playbackRate={0.5} /> {/* Half speed */}
128
+ // 2x speed
129
+ <Video src={staticFile("video.mp4")} playbackRate={2} />
130
+ // Half speed
131
+ <Video src={staticFile("video.mp4")} playbackRate={0.5} />
130
132
  ```
131
133
 
132
134
  Reverse playback is not supported.
@@ -23,7 +23,11 @@ You have 2 options for trimming videos:
23
23
  ```tsx
24
24
  import {Video} from '@remotion/media';
25
25
 
26
- <Video src={staticFile('video.mp4')} trimBefore={5 * fps} trimAfter={10 * fps} />;
26
+ <Video
27
+ src={staticFile('video.mp4')}
28
+ trimBefore={5 * fps}
29
+ trimAfter={10 * fps}
30
+ />;
27
31
  ```
28
32
 
29
33
  2. Use the FFmpeg command line. You MUST re-encode the video to avoid frozen frames at the start of the video. Only use this if you need a standalone trimmed file (e.g. for upload or external use).
@@ -16,7 +16,11 @@ import { AnimatedImage, staticFile } from "remotion";
16
16
 
17
17
  export const MyComposition = () => {
18
18
  return (
19
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={500} />
19
+ <AnimatedImage
20
+ src={staticFile("animation.gif")}
21
+ width={500}
22
+ height={500}
23
+ />
20
24
  );
21
25
  };
22
26
  ```
@@ -37,13 +41,28 @@ Control how the image fills its container with the `fit` prop:
37
41
 
38
42
  ```tsx
39
43
  // Stretch to fill (default)
40
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={300} fit="fill" />
44
+ <AnimatedImage
45
+ src={staticFile("animation.gif")}
46
+ width={500}
47
+ height={300}
48
+ fit="fill"
49
+ />
41
50
 
42
51
  // Maintain aspect ratio, fit inside container
43
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={300} fit="contain" />
52
+ <AnimatedImage
53
+ src={staticFile("animation.gif")}
54
+ width={500}
55
+ height={300}
56
+ fit="contain"
57
+ />
44
58
 
45
59
  // Fill container, crop if needed
46
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={300} fit="cover" />
60
+ <AnimatedImage
61
+ src={staticFile("animation.gif")}
62
+ width={500}
63
+ height={300}
64
+ fit="cover"
65
+ />
47
66
  ```
48
67
 
49
68
  ## Playback speed
@@ -51,8 +70,20 @@ Control how the image fills its container with the `fit` prop:
51
70
  Use `playbackRate` to control the animation speed:
52
71
 
53
72
  ```tsx
54
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={500} playbackRate={2} /> {/* 2x speed */}
55
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={500} playbackRate={0.5} /> {/* Half speed */}
73
+ // 2x speed
74
+ <AnimatedImage
75
+ src={staticFile("animation.gif")}
76
+ width={500}
77
+ height={500}
78
+ playbackRate={2}
79
+ />
80
+ // Half speed
81
+ <AnimatedImage
82
+ src={staticFile("animation.gif")}
83
+ width={500}
84
+ height={500}
85
+ playbackRate={0.5}
86
+ />
56
87
  ```
57
88
 
58
89
  ## Looping behavior
@@ -61,13 +92,28 @@ Control what happens when the animation finishes:
61
92
 
62
93
  ```tsx
63
94
  // Loop indefinitely (default)
64
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={500} loopBehavior="loop" />
95
+ <AnimatedImage
96
+ src={staticFile("animation.gif")}
97
+ width={500}
98
+ height={500}
99
+ loopBehavior="loop"
100
+ />
65
101
 
66
102
  // Play once, show final frame
67
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={500} loopBehavior="pause-after-finish" />
103
+ <AnimatedImage
104
+ src={staticFile("animation.gif")}
105
+ width={500}
106
+ height={500}
107
+ loopBehavior="pause-after-finish"
108
+ />
68
109
 
69
110
  // Play once, then clear canvas
70
- <AnimatedImage src={staticFile("animation.gif")} width={500} height={500} loopBehavior="clear-after-finish" />
111
+ <AnimatedImage
112
+ src={staticFile("animation.gif")}
113
+ width={500}
114
+ height={500}
115
+ loopBehavior="clear-after-finish"
116
+ />
71
117
  ```
72
118
 
73
119
  ## Styling
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: fonts
3
+ description: Loading Google Fonts and local fonts in Remotion
4
+ metadata:
5
+ tags: fonts, google-fonts, typography, text
6
+ ---
7
+
8
+ # Using fonts in Remotion
9
+
10
+ ## Google Fonts with @remotion/google-fonts
11
+
12
+ The recommended way to use Google Fonts. It's type-safe and automatically blocks rendering until the font is ready.
13
+
14
+ ### Prerequisites
15
+
16
+ First, the @remotion/google-fonts package needs to be installed.
17
+ If it is not installed, use the following command:
18
+
19
+ ```bash
20
+ npx remotion add @remotion/google-fonts # If project uses npm
21
+ bunx remotion add @remotion/google-fonts # If project uses bun
22
+ yarn remotion add @remotion/google-fonts # If project uses yarn
23
+ pnpm exec remotion add @remotion/google-fonts # If project uses pnpm
24
+ ```
25
+
26
+ ```tsx
27
+ import { loadFont } from "@remotion/google-fonts/Lobster";
28
+
29
+ const { fontFamily } = loadFont();
30
+
31
+ export const MyComposition = () => {
32
+ return (
33
+ <div style={{ fontFamily }}>
34
+ Hello World
35
+ </div>
36
+ );
37
+ };
38
+ ```
39
+
40
+ Preferrably, specify only needed weights and subsets to reduce file size:
41
+
42
+ ```tsx
43
+ import { loadFont } from "@remotion/google-fonts/Roboto";
44
+
45
+ const { fontFamily } = loadFont("normal", {
46
+ weights: ["400", "700"],
47
+ subsets: ["latin"],
48
+ });
49
+ ```
50
+
51
+ ## Using in components
52
+
53
+ Call `loadFont()` at the top level of your component or in a separate file that's imported early:
54
+
55
+ ```tsx
56
+ import { loadFont } from "@remotion/google-fonts/Montserrat";
57
+
58
+ const { fontFamily } = loadFont("normal", {
59
+ weights: ["400", "700"],
60
+ subsets: ["latin"],
61
+ });
62
+
63
+ export const Title: React.FC<{ text: string }> = ({ text }) => {
64
+ return (
65
+ <h1
66
+ style={{
67
+ fontFamily,
68
+ fontSize: 80,
69
+ fontWeight: "bold",
70
+ }}
71
+ >
72
+ {text}
73
+ </h1>
74
+ );
75
+ };
76
+ ```
@@ -0,0 +1,128 @@
1
+ # Using `<HtmlInCanvas>` in Remotion
2
+
3
+ Renders children into a `<canvas>` so you can post-process them with the Canvas 2D API or WebGL.
4
+
5
+ Only works in Chrome 149+ with the `chrome://flags/#canvas-draw-element` flag enabled.
6
+ Give the user a notice.
7
+
8
+ ## Nesting
9
+
10
+ Do not nest `<HtmlInCanvas>` components. Remotion rejects nesting because Chrome does not reliably render nested HTML-in-canvas subtrees.
11
+
12
+ ## Enabling WebGL during renders
13
+
14
+ If you make use of WebGL during renders, you need to enable it:
15
+
16
+ From the CLI:
17
+
18
+ ```bash
19
+ npx remotion render --gl=angle
20
+ ```
21
+
22
+ Set it as the default for Studio and CLI (advised):
23
+
24
+ ```ts
25
+ import { Config } from "@remotion/cli/config";
26
+
27
+ Config.setChromiumOpenGlRenderer("angle");
28
+ ```
29
+
30
+ ## Basic usage
31
+
32
+ By default, draws to canvas with no effect applied:
33
+
34
+ ```tsx
35
+ import { HtmlInCanvas } from "remotion";
36
+
37
+ export const MyComp = () => {
38
+ return (
39
+ <HtmlInCanvas width={1280} height={720}>
40
+ <div style={{ fontSize: 80 }}>
41
+ Hello
42
+ </div>
43
+ </HtmlInCanvas>
44
+ );
45
+ };
46
+ ```
47
+
48
+ ## 2D effect with `onPaint`
49
+
50
+ `onPaint` runs whenever the content updates. Call `ctx.drawElementImage(elementImage, 0, 0)` to draw the captured DOM, and assign the returned transform to `element.style.transform` so DOM selection still aligns with the painted output.
51
+
52
+ ```tsx
53
+ import {
54
+ AbsoluteFill,
55
+ HtmlInCanvas,
56
+ type HtmlInCanvasOnPaint,
57
+ useCurrentFrame,
58
+ useVideoConfig,
59
+ } from "remotion";
60
+ import { useCallback } from "react";
61
+
62
+ export const Blur = () => {
63
+ const frame = useCurrentFrame();
64
+ const { width, height, fps } = useVideoConfig();
65
+
66
+ const onPaint: HtmlInCanvasOnPaint = useCallback(
67
+ ({ canvas, element, elementImage }) => {
68
+ const ctx = canvas.getContext("2d");
69
+ if (!ctx) throw new Error("Failed to acquire 2D context");
70
+
71
+ const blurPx = 4 + 18 * (0.5 + 0.5 * Math.sin((frame / fps) * Math.PI));
72
+
73
+ ctx.reset();
74
+ ctx.filter = `blur(${blurPx}px)`;
75
+ const transform = ctx.drawElementImage(elementImage, 0, 0);
76
+ element.style.transform = transform.toString();
77
+ },
78
+ [frame, fps],
79
+ );
80
+
81
+ return (
82
+ <HtmlInCanvas width={width} height={height} onPaint={onPaint}>
83
+ <AbsoluteFill
84
+ style={{
85
+ justifyContent: "center",
86
+ alignItems: "center",
87
+ fontSize: 120,
88
+ }}
89
+ >
90
+ <h1>
91
+ Hello
92
+ </h1>
93
+ </AbsoluteFill>
94
+ </HtmlInCanvas>
95
+ );
96
+ };
97
+ ```
98
+
99
+ ## WebGL effects
100
+
101
+ For WebGL, set up the context, program, and texture in `onInit` and return a cleanup function. Inside `onPaint`, upload the captured DOM with `gl.texElementImage2D(...)` and draw.
102
+
103
+ ```tsx
104
+ const onInit: HtmlInCanvasOnInit = useCallback(({ canvas }) => {
105
+ const gl = canvas.getContext("webgl2", { alpha: true, premultipliedAlpha: true });
106
+ if (!gl) {
107
+ throw new Error(
108
+ "WebGL2 unavailable. Try rendering with the --gl=angle option. See https://remotion.dev/docs/gl-options.",
109
+ );
110
+ }
111
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
112
+ // compile program, create texture, set up VAO...
113
+ return () => {
114
+ // delete program, texture, buffers...
115
+ };
116
+ }, []);
117
+
118
+ const onPaint: HtmlInCanvasOnPaint = useCallback(({ elementImage }) => {
119
+ gl.texElementImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, elementImage);
120
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
121
+ }, []);
122
+ ```
123
+
124
+ For a fully working minimal example, see https://github.com/remotion-dev/remotion/blob/main/packages/docs/components/demos/HtmlInCanvasDocsDemoWebGL.tsx.
125
+
126
+ ## Async `onPaint`
127
+
128
+ `onPaint` may be `async`. Remotion holds the frame open via `delayRender()` until the promise resolves. Useful for multi-pass effects with `createImageBitmap`.
@@ -0,0 +1,73 @@
1
+ ## Sizing and positioning
2
+
3
+ Use the `style` prop to control size and position:
4
+
5
+ ```tsx
6
+ <Img
7
+ src={staticFile("photo.png")}
8
+ style={{
9
+ width: 500,
10
+ height: 300,
11
+ position: "absolute",
12
+ top: 100,
13
+ left: 50,
14
+ objectFit: "cover",
15
+ }}
16
+ />
17
+ ```
18
+
19
+ ## Dynamic image paths
20
+
21
+ Use template literals for dynamic file references:
22
+
23
+ ```tsx
24
+ import { Img, staticFile, useCurrentFrame } from "remotion";
25
+
26
+ const frame = useCurrentFrame();
27
+
28
+ // Image sequence
29
+ <Img src={staticFile(`frames/frame${frame}.png`)} />
30
+
31
+ // Selecting based on props
32
+ <Img src={staticFile(`avatars/${props.userId}.png`)} />
33
+
34
+ // Conditional images
35
+ <Img
36
+ src={staticFile(`icons/${isActive ? "active" : "inactive"}.svg`)}
37
+ />
38
+ ```
39
+
40
+ This pattern is useful for:
41
+
42
+ - Image sequences (frame-by-frame animations)
43
+ - User-specific avatars or profile images
44
+ - Theme-based icons
45
+ - State-dependent graphics
46
+
47
+ ## Getting image dimensions
48
+
49
+ Use `getImageDimensions()` to get the dimensions of an image:
50
+
51
+ ```tsx
52
+ import { getImageDimensions, staticFile } from "remotion";
53
+
54
+ const { width, height } = await getImageDimensions(staticFile("photo.png"));
55
+ ```
56
+
57
+ This is useful for calculating aspect ratios or sizing compositions:
58
+
59
+ ```tsx
60
+ import {
61
+ getImageDimensions,
62
+ staticFile,
63
+ CalculateMetadataFunction,
64
+ } from "remotion";
65
+
66
+ const calculateMetadata: CalculateMetadataFunction = async () => {
67
+ const { width, height } = await getImageDimensions(staticFile("photo.png"));
68
+ return {
69
+ width,
70
+ height,
71
+ };
72
+ };
73
+ ```