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,171 @@
1
+ ---
2
+ name: audio
3
+ description: Using audio and sound in Remotion - importing, trimming, volume, speed, pitch
4
+ metadata:
5
+ tags: audio, media, trim, volume, speed, loop, pitch, mute, sound, sfx
6
+ ---
7
+
8
+ # Using audio in Remotion
9
+
10
+ ## Prerequisites
11
+
12
+ First, the @remotion/media package needs to be installed.
13
+ If it is not installed, use the following command:
14
+
15
+ ```bash
16
+ npx remotion add @remotion/media
17
+ ```
18
+
19
+ ## Importing Audio
20
+
21
+ Use `<Audio>` from `@remotion/media` to add audio to your composition.
22
+
23
+ ```tsx
24
+ import { Audio } from "@remotion/media";
25
+ import { staticFile } from "remotion";
26
+
27
+ export const MyComposition = () => {
28
+ return <Audio src={staticFile("audio.mp3")} />;
29
+ };
30
+ ```
31
+
32
+ Remote URLs are also supported:
33
+
34
+ ```tsx
35
+ <Audio src="https://remotion.media/audio.mp3" />
36
+ ```
37
+
38
+ By default, audio plays from the start, at full volume and full length.
39
+ Multiple audio tracks can be layered by adding multiple `<Audio>` components.
40
+
41
+ ## Trimming
42
+
43
+ Use `trimBefore` and `trimAfter` to remove portions of the audio. Values are in frames.
44
+
45
+ ```tsx
46
+ const { fps } = useVideoConfig();
47
+
48
+ return (
49
+ <Audio
50
+ src={staticFile("audio.mp3")}
51
+ trimBefore={2 * fps} // Skip the first 2 seconds
52
+ trimAfter={10 * fps} // End at the 10 second mark
53
+ />
54
+ );
55
+ ```
56
+
57
+ The audio still starts playing at the beginning of the composition - only the specified portion is played.
58
+
59
+ ## Delaying
60
+
61
+ Wrap the audio in a `<Sequence>` to delay when it starts:
62
+
63
+ ```tsx
64
+ import { Sequence, staticFile } from "remotion";
65
+ import { Audio } from "@remotion/media";
66
+
67
+ const { fps } = useVideoConfig();
68
+
69
+ return (
70
+ <Sequence from={1 * fps}>
71
+ <Audio src={staticFile("audio.mp3")} />
72
+ </Sequence>
73
+ );
74
+ ```
75
+
76
+ The audio will start playing after 1 second.
77
+
78
+ ## Volume
79
+
80
+ Set a static volume (0 to 1):
81
+
82
+ ```tsx
83
+ <Audio src={staticFile("audio.mp3")} volume={0.5} />
84
+ ```
85
+
86
+ Or use a callback for dynamic volume based on the current frame:
87
+
88
+ ```tsx
89
+ import { interpolate } from "remotion";
90
+
91
+ const { fps } = useVideoConfig();
92
+
93
+ return (
94
+ <Audio
95
+ src={staticFile("audio.mp3")}
96
+ volume={(f) =>
97
+ interpolate(f, [0, 1 * fps], [0, 1], { extrapolateRight: "clamp" })
98
+ }
99
+ />
100
+ );
101
+ ```
102
+
103
+ The value of `f` starts at 0 when the audio begins to play, not the composition frame.
104
+
105
+ ## Muting
106
+
107
+ Use `muted` to silence the audio. It can be set dynamically:
108
+
109
+ ```tsx
110
+ const frame = useCurrentFrame();
111
+ const { fps } = useVideoConfig();
112
+
113
+ return (
114
+ <Audio
115
+ src={staticFile("audio.mp3")}
116
+ muted={frame >= 2 * fps && frame <= 4 * fps} // Mute between 2s and 4s
117
+ />
118
+ );
119
+ ```
120
+
121
+ ## Speed
122
+
123
+ Use `playbackRate` to change the playback speed:
124
+
125
+ ```tsx
126
+ // 2x speed
127
+ <Audio src={staticFile("audio.mp3")} playbackRate={2} />
128
+ // Half speed
129
+ <Audio src={staticFile("audio.mp3")} playbackRate={0.5} />
130
+ ```
131
+
132
+ Reverse playback is not supported.
133
+
134
+ ## Looping
135
+
136
+ Use `loop` to loop the audio indefinitely:
137
+
138
+ ```tsx
139
+ <Audio src={staticFile("audio.mp3")} loop />
140
+ ```
141
+
142
+ Use `loopVolumeCurveBehavior` to control how the frame count behaves when looping:
143
+
144
+ - `"repeat"`: Frame count resets to 0 each loop (default)
145
+ - `"extend"`: Frame count continues incrementing
146
+
147
+ ```tsx
148
+ <Audio
149
+ src={staticFile("audio.mp3")}
150
+ loop
151
+ loopVolumeCurveBehavior="extend"
152
+ volume={(f) => interpolate(f, [0, 300], [1, 0])} // Fade out over multiple loops
153
+ />
154
+ ```
155
+
156
+ ## Pitch
157
+
158
+ Use `toneFrequency` to adjust the pitch without affecting speed. Values range from 0.01 to 2:
159
+
160
+ ```tsx
161
+ <Audio
162
+ src={staticFile("audio.mp3")}
163
+ toneFrequency={1.5} // Higher pitch
164
+ />
165
+ <Audio
166
+ src={staticFile("audio.mp3")}
167
+ toneFrequency={0.8} // Lower pitch
168
+ />
169
+ ```
170
+
171
+ Pitch shifting only works during server-side rendering, not in the Remotion Studio preview or in the `<Player />`.
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: calculate-metadata
3
+ description: Dynamically set composition duration, dimensions, and props
4
+ metadata:
5
+ tags: calculateMetadata, duration, dimensions, props, dynamic
6
+ ---
7
+
8
+ # Using calculateMetadata
9
+
10
+ Use `calculateMetadata` on a `<Composition>` to dynamically set duration, dimensions, and transform props before rendering.
11
+ Use it when metadata depends on input props, fetched data, or asset metadata.
12
+ For static dimensions, duration, FPS, and initial props, inline the values on `<Composition>` instead.
13
+
14
+ ```tsx
15
+ <Composition
16
+ id="MyComp"
17
+ component={MyComponent}
18
+ durationInFrames={300}
19
+ fps={30}
20
+ width={1920}
21
+ height={1080}
22
+ defaultProps={{ videoSrc: "https://remotion.media/video.mp4" }}
23
+ calculateMetadata={calculateMetadata}
24
+ />
25
+ ```
26
+
27
+ ## Setting duration based on a video
28
+
29
+ Use the [`getVideoDuration`](../remotion-multimedia/get-video-duration.md) and [`getVideoDimensions`](../remotion-multimedia/get-video-dimensions.md) skills to get the video duration and dimensions:
30
+
31
+ ```tsx
32
+ import { CalculateMetadataFunction } from "remotion";
33
+ import { getVideoDuration } from "./get-video-duration";
34
+
35
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({
36
+ props,
37
+ }) => {
38
+ const durationInSeconds = await getVideoDuration(props.videoSrc);
39
+
40
+ return {
41
+ durationInFrames: Math.ceil(durationInSeconds * 30),
42
+ };
43
+ };
44
+ ```
45
+
46
+ ## Matching dimensions of a video
47
+
48
+ Use the [`getVideoDimensions`](../remotion-multimedia/get-video-dimensions.md) skill to get the video dimensions:
49
+
50
+ ```tsx
51
+ import { CalculateMetadataFunction } from "remotion";
52
+ import { getVideoDuration } from "./get-video-duration";
53
+ import { getVideoDimensions } from "./get-video-dimensions";
54
+
55
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({
56
+ props,
57
+ }) => {
58
+ const dimensions = await getVideoDimensions(props.videoSrc);
59
+
60
+ return {
61
+ width: dimensions.width,
62
+ height: dimensions.height,
63
+ };
64
+ };
65
+ ```
66
+
67
+ ## Setting duration based on multiple videos
68
+
69
+ ```tsx
70
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({
71
+ props,
72
+ }) => {
73
+ const metadataPromises = props.videos.map((video) =>
74
+ getVideoDuration(video.src),
75
+ );
76
+ const allMetadata = await Promise.all(metadataPromises);
77
+
78
+ const totalDuration = allMetadata.reduce(
79
+ (sum, durationInSeconds) => sum + durationInSeconds,
80
+ 0,
81
+ );
82
+
83
+ return {
84
+ durationInFrames: Math.ceil(totalDuration * 30),
85
+ };
86
+ };
87
+ ```
88
+
89
+ ## Setting a default outName
90
+
91
+ Set the default output filename based on props:
92
+
93
+ ```tsx
94
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({
95
+ props,
96
+ }) => {
97
+ return {
98
+ defaultOutName: `video-${props.id}`, // .mp4 is added automatically
99
+ };
100
+ };
101
+ ```
102
+
103
+ ## Transforming props
104
+
105
+ Fetch data or transform props before rendering:
106
+
107
+ ```tsx
108
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({
109
+ props,
110
+ abortSignal,
111
+ }) => {
112
+ const response = await fetch(props.dataUrl, { signal: abortSignal });
113
+ const data = await response.json();
114
+
115
+ return {
116
+ props: {
117
+ ...props,
118
+ fetchedData: data,
119
+ },
120
+ };
121
+ };
122
+ ```
123
+
124
+ The `abortSignal` cancels stale requests when props change in the Studio.
125
+
126
+ ## Return value
127
+
128
+ All fields are optional. Returned values override the `<Composition>` props:
129
+
130
+ - `durationInFrames`: Number of frames
131
+ - `width`: Composition width in pixels
132
+ - `height`: Composition height in pixels
133
+ - `fps`: Frames per second
134
+ - `props`: Transformed props passed to the component
135
+ - `defaultOutName`: Default output filename
136
+ - `defaultCodec`: Default codec for rendering
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: compositions
3
+ description: Defining compositions, stills, folders, default props and dynamic metadata
4
+ metadata:
5
+ tags: composition, still, folder, props, metadata
6
+ ---
7
+
8
+ A `<Composition>` defines the component, width, height, fps and duration of a renderable video.
9
+
10
+ ## Default Props and scaffold metadata
11
+
12
+ Pass `defaultProps` to provide initial values for your component.
13
+ Values must be JSON-serializable (`Date`, `Map`, `Set`, and `staticFile()` are supported).
14
+ Use `defaultProps` for composition-wide values that should be visible and editable before the video renders.
15
+
16
+ For Studio editing, keep `defaultProps` as an inline object literal on `<Composition>` or `<Still>`.
17
+ Do not store it in a variable, import it, spread it, create it with a helper, or wrap it in `satisfies`.
18
+ When scaffolding, keep the component and `<Composition>` registration in the same file so `width`, `height`, `fps`, `durationInFrames`, and `defaultProps` are visible next to the code that uses them.
19
+ Use `type` declarations for props rather than `interface` to ensure `defaultProps` type safety.
20
+
21
+ ```tsx
22
+ type Props = {
23
+ readonly title: string;
24
+ };
25
+
26
+ export const MyComposition = ({ title }: Props) => (
27
+ <h1>
28
+ {title}
29
+ </h1>
30
+ );
31
+
32
+ const defaultProps = { title: "Hello World" };
33
+
34
+ // 👍 Inline metadata and defaults
35
+ <Composition
36
+ id="MyComposition"
37
+ component={MyComposition}
38
+ durationInFrames={100}
39
+ fps={30}
40
+ width={1080}
41
+ height={1080}
42
+ defaultProps={{ title: "Hello World" }}
43
+ />;
44
+
45
+ // 👎 Hidden defaults cannot be saved back by Studio
46
+ <Composition
47
+ id="OtherComposition"
48
+ component={MyComposition}
49
+ durationInFrames={100}
50
+ fps={30}
51
+ width={1080}
52
+ height={1080}
53
+ defaultProps={defaultProps}
54
+ />;
55
+ ```
56
+
57
+ ## Folders
58
+
59
+ Use `<Folder>` to organize compositions in the sidebar.
60
+ Folder names can only contain letters, numbers, and hyphens.
61
+
62
+ ```tsx
63
+ import { Composition, Folder } from "remotion";
64
+
65
+ export const RemotionRoot = () => {
66
+ return (
67
+ <>
68
+ <Folder name="Marketing">
69
+ <Composition id="Promo" /* ... */ />
70
+ <Composition id="Ad" /* ... */ />
71
+ </Folder>
72
+ <Folder name="Social">
73
+ <Folder name="Instagram">
74
+ <Composition id="Story" /* ... */ />
75
+ <Composition id="Reel" /* ... */ />
76
+ </Folder>
77
+ </Folder>
78
+ </>
79
+ );
80
+ };
81
+ ```
82
+
83
+ ## Stills
84
+
85
+ Use `<Still>` for single-frame images. It does not require `durationInFrames` or `fps`.
86
+
87
+ ```tsx
88
+ import { Still } from "remotion";
89
+ import { Thumbnail } from "./Thumbnail";
90
+
91
+ export const RemotionRoot = () => {
92
+ return (
93
+ <Still
94
+ id="Thumbnail"
95
+ component={Thumbnail}
96
+ width={1280}
97
+ height={720}
98
+ />
99
+ );
100
+ };
101
+ ```
102
+
103
+ ## Dynamic duration, width, and height
104
+
105
+ Use [`calculateMetadata`](./calculate-metadata.md) to make dimensions, duration, or props dynamic based on input props, fetched data, or asset metadata.
106
+
107
+ ## Nesting compositions within another
108
+
109
+ To add a composition within another composition, you can use the `<Sequence>` component with a `width` and `height` prop to specify the size of the composition.
110
+
111
+ ```tsx
112
+ <AbsoluteFill>
113
+ <Sequence width={COMPOSITION_WIDTH} height={COMPOSITION_HEIGHT}>
114
+ <CompositionComponent />
115
+ </Sequence>
116
+ </AbsoluteFill>
117
+ ```
@@ -0,0 +1,34 @@
1
+ # Cropping
2
+
3
+ Preferably, the `cropLeft`, `cropRight`, `cropTop` and `cropBottom` props are used to crop content.
4
+ It allows for interactively dragging the components and adapting the outlines in the canvas to the crop.
5
+
6
+ The following components support `crop*` props:
7
+
8
+ - `<Sequence>` from `remotion`, when `layout="absolute-fill"`
9
+ - `<CanvasImage>` from `remotion`
10
+ - `<Img>` from `remotion`
11
+ - `<AnimatedImage>` from `remotion`
12
+ - `<HtmlInCanvas>` from `remotion`
13
+ - `<Solid>` from `remotion`
14
+ - `<Video>` from `@remotion/media`
15
+ - `<Gif>` from `@remotion/gif`
16
+ - `<RemotionRiveCanvas>` from `@remotion/rive`
17
+
18
+ Crop values are ratios between `0` and `1`.
19
+ A value of `0` applies no crop on that edge.
20
+ A value of `1` is a full crop.
21
+ Keep [Interactivity Best Practices](../remotion-interactivity/SKILL.md) also for cropping, to keep it editable and keyframable.
22
+
23
+ ```tsx
24
+ <CanvasImage
25
+ src={staticFile("photo.png")}
26
+ cropLeft={interpolate(frame, [0, 30], [0, 0.25], {
27
+ extrapolateLeft: "clamp",
28
+ extrapolateRight: "clamp",
29
+ })}
30
+ cropBottom={0.1}
31
+ />
32
+ ```
33
+
34
+ Do not use `clipPath` together with crop props.
@@ -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.