rav1e js/wasm bindings
The slowest and most dangerous AV1 encoder of the web.
rav1e_js
aims to bring the power of rav1e
to the web!
git clone https://github.com/rust-av/rav1e_js
cd rav1e_js
wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# Build (emits wasm-, js/ts-files to pkg/)
wasm-pack build
package.json
{
// ...
"dependencies": {
"rav1e": "file:path/to/pkg",
// ...
},
// ...
}
Use it in your project:
import { ChromaSampling, EncoderConfig, VideoEncoder } from "rav1e";
// ...
Run rebuild.sh
:
bash rebuild.sh
or run:
wasm-pack build
cd www/
npm install
npm start
# 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:
# test in browser
wasm-pack test --headless --[firefox, chrome, safari]
# test in node
wasm-pack test --node