项目作者: rust-av

项目描述 :
rav1e js/wasm bindings
高级语言: Rust
项目地址: git://github.com/rust-av/rav1e_js.git
创建时间: 2020-12-30T11:01:53Z
项目社区:https://github.com/rust-av/rav1e_js

开源协议:BSD 2-Clause "Simplified" License

下载


rav1e_js

The slowest and most dangerous AV1 encoder of the web.

About

rav1e_js aims to bring the power of rav1e to the web!

Usage

Api

  1. Clone + enter the repository
    1. git clone https://github.com/rust-av/rav1e_js
    2. cd rav1e_js
  2. Install wasm-pack
    1. curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
  3. Build package
    1. # Build (emits wasm-, js/ts-files to pkg/)
    2. wasm-pack build
  4. Add file dependency to package.json
    1. {
    2. // ...
    3. "dependencies": {
    4. "rav1e": "file:path/to/pkg",
    5. // ...
    6. },
    7. // ...
    8. }
  5. Use it in your project:

    1. import { ChromaSampling, EncoderConfig, VideoEncoder } from "rav1e";
    2. // ...

Example Website

Run rebuild.sh:

  1. bash rebuild.sh

or run:

  1. wasm-pack build
  2. cd www/
  3. npm install
  4. npm start
  5. # website served at localhost:3000

Please first enter the developer console and then start playing the video. You should see logging about the data collection and encoding.

Note!: This can take quite a while.

If it doesn’t start, please try:

  1. reload the webpage

Testing

  1. # test in browser
  2. wasm-pack test --headless --[firefox, chrome, safari]
  3. # test in node
  4. wasm-pack test --node