etro

etro-jsGPL-3.0活跃维护

用 TypeScript 写的浏览器端视频剪辑库,能在网页里直接合成、剪辑视频和音频,省去服务端转码的麻烦。

Typescript video-editing library for the browser

v0.14.1发布于 2026-08-12 06:05 UTC1,155star98fork同步于 2026-11-10 17:52 UTC

怎么上手

由 README 提炼,执行前请确认
npm i etro
硬件要求按 README 说明

README 未说明具体硬件要求;效果为硬件加速,运行在浏览器环境中

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

浏览器端用 TypeScript 编程剪辑视频的库,通过图层合成和滤镜实现视频编辑

用 TypeScript 写的浏览器端视频剪辑库,能在网页里直接合成、剪辑视频和音频,省去服务端转码的麻烦。

核心能力

  • 合成视频、音频、文本、图像图层
  • 内置硬件加速的 GLSL 滤镜效果
  • 支持用 JavaScript 和 GLSL 自定义效果
  • 图层与效果参数支持关键帧或函数
  • 会话可序列化为 JSON 并反序列化恢复

容易踩的坑

在 Node 中使用需额外安装 etro-node 包装器;离线渲染尚未支持,目前只能实时渲染为 blob;音频效果标注为即将推出,尚不可用

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.14.1
  1. v0.14.1最新正式版2026-08-12 · 2026-08-12 06:05 UTC

    Fixed

  2. v0.14.02026-06-06 · 2026-06-06 05:52 UTC
    查看更新说明

    0.14.0 - 2026-06-06

    Added

    Changed

    • Bump rollup-plugin-typescript2 to 0.37.0.
    • Bump karma to 6.4.4.

    Security

    • Bump handlebars from 4.7.7 to 4.7.9 (#329).
    • Bump shipjs, tmp (#343).
    • Bump body-parser, qs (#337).
    • Bump rollup to 4.61.1.
    • Bump typedoc to 0.28.19.
    • Bump karma-jasmine to 5.1.0.
  3. v0.13.02026-03-18 · 2026-03-18 02:38 UTC
    查看更新说明

    0.13.0 - 2026-03-18

    Added

    • Movie#play() option onDraw() (#266).

    Changed

    • The type for KeyFrame.value has been updated from unknown[][] to (number|T|Interpolate)[][] (#259).

    Fixed

    • Shader effects producing solid black output in browsers whose GLSL linker does not assign a_VertexPosition to attribute location 0 (e.g., Firefox on macOS).

    Security

    • Bump ejs from 3.1.8 to 3.1.10 (#271).
    • Bump follow-redirects from 1.15.4 to 1.15.6 (#267).
    • Bump braces from 3.0.2 to 3.0.3 (#274).
    • Bump socket.io from 4.6.1 to 4.7.5 (#277).
    • Bump js-yaml from 4.1.0 to 4.1.1 (#309).
    • Bump @rollup/plugin-eslint from 8.0.2 to 9.2.0 (#309).
    • Bump validator from 13.11.0 to 13.15.20 (#308).
    • Bump pbkdf2 from 3.1.2 to 3.1.5 (#307).
    • Bump cipher-base from 1.0.4 to 1.0.6 (#305).
    • Bump rollup from 1.32.1 to 2.79.2 (#300).
    • Bump elliptic from 6.5.4 to 6.6.1 (#299).
    • Bump ws, socket.io-adapter (#281).
    • Bump cookie, socket.io (#283).
    • Bump body-parser from 1.20.1 to 1.20.3 (#285).
    • Bump shipjs from 0.26.3 to 0.27.0 (#314).
    • Bump basic-ftp from 5.0.4 to 5.2.0 (#320).
  4. v0.12.12024-02-19 · 2024-02-19 17:07 UTC
    查看更新说明

    [0.12.1] - 2024-02-19

    Fixed

    • Importing etro in the client-side code of a NextJS project causing a "module not found" error (#243).
    • Keyframes with values that are not numbers no longer result in type mismatches.
    • TypeError: this.data is undefined when applying a Transform effect with a dynamic matrix.
  5. v0.12.02024-01-15 · 2024-01-15 21:20 UTC
    查看更新说明

    [0.12.0] - 2024-01-15

    Added

    • stroke option for Text layer (#239).

    Security

    • Bump @babel/traverse from 7.18.13 to 7.23.2 (#244).
    • Bump browserify-sign from 4.2.1 to 4.2.2 (#245).
    • Bump follow-redirects from 1.14.9 to 1.15.4 (#247).
    • Bump gitmoji-cli from 8.4.0 to 9.0.0.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Etro

    Build Status Discord

    Etro is a framework-agnostic TypeScript library for programmatically editing videos. It lets you composite layers and add filters. Etro includes text, video, audio and image layers, along with a variety of GLSL filters. You can also define your own layers and filters with TypeScript and GLSL.

    Features

    • Composite video and audio layers
    • Use built-in hardware accelerated effects
    • Write your own effects in JavaScript and GLSL
    • Manipulate audio with the web audio API (audio effects coming soon)
    • Define layer and effect parameters as keyframes or custom functions
    • Render to a blob in realtime (offline rendering coming soon)
    • Serialize session to JSON and deserialize it back
    • UI framework agnostic

    Installation

    npm i etro
    

    Basic Usage

    Let's look at an example:

    import etro from 'etro'
    
    var movie = new etro.Movie({ canvas: outputCanvas })
    var layer = new etro.layer.Video({ startTime: 0, source: videoElement })  // the layer starts at 0s
    movie.addLayer(layer)
    
    movie.record({ frameRate: 24 })  // or just `play` if you don't need to save it
        .then(blob => ...)
    

    The blob could then be downloaded as a video file or displayed using a <video> element.

    See the documentation for a list of all built-in layers.

    Effects

    Effects can transform the output of a layer or movie:

    var layer = new etro.layer.Video({ startTime: 0, source: videoElement })
        .addEffect(new etro.effect.Brightness({ brightness: +100) }))
    

    See the documentation for a list of all built-in effects.

    Dynamic Properties

    Most properties also support keyframes and functions:

    // Keyframes
    layer.effects[0].brightness = new etro.KeyFrame(
      [0, -75],  // brightness == -75 at 0 seconds
      [2, +75]  // +75 at 2 seconds
    )
    
    // Function
    layer.effects[0].brightness = () => 100 * Math.random() - 50
    

    See the documentation for more info.

    Using in Node

    To use Etro in Node, see the wrapper:

    Running the Examples

    Start the development server (used for convenience during development; Etro does not require a server):

    npm i
    npm run build
    npm start
    

    Now you can open any example (such as http://127.0.0.1:8080/examples/introduction/hello-world1.html).

    Further Reading

    Contributing

    See the contributing guide

    License

    Distributed under GNU General Public License v3. See LICENSE for more information.