@gl-transitions/remotion

中文文档
2.0.0发布于 2026/11/05MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 3831

Use any of the gl-transitions as a Remotion presentation

原始使用文档
文档目录4 节
  1. Install
  2. Usage
  3. Options
  4. Development

@gl-transitions/remotion

All of the gl-transitions in Remotion: glTransition() makes any of them a presentation for <TransitionSeries>, between any two scenes.

It draws the GLSL source of each transition from the gl-transitions package with WebGL 2, as the GL Transition Specification describes it. New transitions arrive by updating gl-transitions.

Install

npm install gl-transitions @gl-transitions/remotion @remotion/transitions

Requires Remotion 4.0.500 or later. The scenes are captured with Remotion's HTML-in-canvas:

  • Rendering (npx remotion render, the server-side APIs, Lambda) works out of the box: Remotion's browser has it enabled. For WebGL without a GPU, render with --gl=swangle (the default on Lambda); with one, --gl=angle.
  • The Studio needs Chrome 149 or later with chrome://flags/#canvas-draw-element enabled. The preview can flash at the start of a transition, as with Remotion's own HTML-in-canvas presentations; rendered videos are not affected.

Usage

import { linearTiming, TransitionSeries } from "@remotion/transitions";
import { glTransition } from "@gl-transitions/remotion";

export const MyVideo = () => (
  <TransitionSeries>
    <TransitionSeries.Sequence durationInFrames={60}>
      <SceneA />
    </TransitionSeries.Sequence>
    <TransitionSeries.Transition
      presentation={glTransition({ name: "CrossWarp" })}
      timing={linearTiming({ durationInFrames: 30 })}
    />
    <TransitionSeries.Sequence durationInFrames={60}>
      <SceneB />
    </TransitionSeries.Sequence>
  </TransitionSeries>
);

Scenes can be any markup: images, videos, text, other compositions.

Options

OptionTypeNotes
namestringAny transition name from gl-transitions.com; autocompletes
paramsobjectThe transition's parameters, typed per transition; the ones left out keep their default value
texturesobjectExtra images a few transitions need, by name, as URLs: luma for "LumaWipe", displacementMap for "DisplacementMap". Rendering waits for them to load
glTransition({ name: "Cube", params: { persp: 0.7, unzoom: 0.3 } });
glTransition({ name: "LumaWipe", textures: { luma: staticFile("spiral.png") } });

Where a transition draws transparent pixels (where it draws no image, as around the cube of Cube or beside LeftRight's images), Remotion's output shows one of the captured scenes or black there, not the layers beneath <TransitionSeries>.

Development

In the gl-transitions repository, examples/remotion is a Remotion project using this package: pnpm run studio opens it, and scripts/check.mjs renders every transition with Remotion's renderer and compares it with its GLSL reference render, as the Reference renders workflow does on each pull request.

版本与发布记录

@gl-transitions/remotion 共发布 4 个版本,首次发布于 2026/10/18;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.0.0latest2026/11/0511 天前
1.0.02026/10/2918 天前
0.1.02026/10/1829 天前
0.0.0-stage2026/10/1829 天前

关于 @gl-transitions/remotion 的常见问题

@gl-transitions/remotion 是什么?

Use any of the gl-transitions as a Remotion presentation

如何安装 @gl-transitions/remotion?

在项目目录运行 npm install @gl-transitions/remotion,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:remotion(>=4.0.500)、gl-transitions(^3.0.0)、@remotion/transitions(>=4.0.500)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@gl-transitions/remotion 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gl-transitions/remotion 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@gl-transitions/remotion 可以商用吗?

@gl-transitions/remotion 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gl-transitions/remotion 的下载量有多少?

根据 npm 官方下载统计,@gl-transitions/remotion 在 2026/10/17 – 2026/11/15 这 30 天内被下载 3,831 次,日均约 128 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gl-transitions/remotion 还在维护吗?

最新版本 2.0.0 发布于 2026/11/05(11 天前);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2026/10/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。