https://github.com/rust-av/rav1e_js
rav1e js/wasm bindings
https://github.com/rust-av/rav1e_js
av1 rav1e
Last synced: about 1 year ago
JSON representation
rav1e js/wasm bindings
- Host: GitHub
- URL: https://github.com/rust-av/rav1e_js
- Owner: rust-av
- License: bsd-2-clause
- Created: 2020-12-30T11:01:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-25T07:56:07.000Z (over 5 years ago)
- Last Synced: 2025-01-20T22:52:52.425Z (over 1 year ago)
- Topics: av1, rav1e
- Language: Rust
- Homepage:
- Size: 2.07 MB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rav1e_js
The slowest and most dangerous AV1 encoder of the web.
- [About](#about)
- [Usage](#usage)
- [Api](#api)
- [Example Website](#example-website)
- [Testing](#testing)
## About
`rav1e_js` aims to bring the power of [`rav1e`](https://github.com/xiph/rav1e) to the web!
## Usage
### Api
1. Clone + enter the repository
```bash
git clone https://github.com/rust-av/rav1e_js
cd rav1e_js
```
2. Install [`wasm-pack`](https://github.com/rustwasm/wasm-pack)
```bash
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
```
3. Build package
```bash
# Build (emits wasm-, js/ts-files to pkg/)
wasm-pack build
```
4. Add file dependency to `package.json`
```ts
{
// ...
"dependencies": {
"rav1e": "file:path/to/pkg",
// ...
},
// ...
}
```
5. Use it in your project:
```ts
import { ChromaSampling, EncoderConfig, VideoEncoder } from "rav1e";
// ...
```
### Example Website
Run [`rebuild.sh`](./rebuild.sh):
```bash
bash rebuild.sh
```
or run:
```bash
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:
1. reload the webpage
### Testing
```bash
# test in browser
wasm-pack test --headless --[firefox, chrome, safari]
# test in node
wasm-pack test --node
```