Comparing version
{ | ||
"name": "webm-wasm", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "webm-wasm lets you create webm videos in JavaScript via WebAssembly.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -5,3 +5,3 @@ # webm-wasm | ||
The wasm module was created by [emscripten’ing][Emscripten] [libvpx], [libwebm] and [libyuv]. | ||
The wasm module was created by [emscripten’ing][emscripten] [libvpx], [libwebm] and [libyuv]. | ||
@@ -13,2 +13,3 @@ ## Usage | ||
### Quickstart | ||
```js | ||
@@ -28,3 +29,3 @@ // 1. Load the `webm-wasm.js` file in a worker | ||
// 5. Start sending frames! | ||
while(hasNextFrame()) { | ||
while (hasNextFrame()) { | ||
// ArrayBuffer containing RGBA data | ||
@@ -50,2 +51,3 @@ const buffer = getFrame(); | ||
- `realtime` (default: `false`): Prioritize encoding speed over compression ratio and quality. With realtime mode turned off the worker will send a single `ArrayBuffer` containing the entire webm video file once input stream has ended. With realtime mode turned on the worker will send an `ArrayBuffer` in regular intervals. | ||
- `kLive` (default: `true`): Set the webm writer to `kLive` mode when true, or to `kFile` mode when false. I am still not sure what the difference is except that `kLive` files are slightly smaller and work with MSE 🤷♂️ | ||
@@ -76,3 +78,3 @@ ### WebAssembly | ||
Because the build process is completely [Dockerized][Docker], Docker is required for building webm-wasm. | ||
Because the build process is completely [Dockerized][docker], Docker is required for building webm-wasm. | ||
@@ -85,10 +87,11 @@ ``` | ||
--- | ||
Apache 2.0 | ||
[Docker]: https://www.docker.com/ | ||
[Transferable Streams]: https://www.chromestatus.com/features/5298733486964736 | ||
[docker]: https://www.docker.com/ | ||
[transferable streams]: https://www.chromestatus.com/features/5298733486964736 | ||
[embind]: https://developers.google.com/web/updates/2018/08/embind | ||
[Emscripten]: https://kripken.github.io/emscripten-site/ | ||
[emscripten]: https://kripken.github.io/emscripten-site/ | ||
[libvpx]: https://github.com/webmproject/libvpx | ||
[libwebm]: https://github.com/webmproject/libwebm | ||
[libyuv]: https://chromium.googlesource.com/libyuv/libyuv/ |
@@ -44,10 +44,3 @@ /** | ||
const defaultConfig = { | ||
width: 300, | ||
height: 150, | ||
timebaseNum: 1, | ||
timebaseDen: 30, | ||
bitrate: 200, | ||
realtime: false | ||
}; | ||
import defaultConfig from "./defaults.js"; | ||
@@ -66,2 +59,3 @@ function createTransformStream(module, userParams) { | ||
params.realtime, | ||
params.kLive, | ||
chunk => { | ||
@@ -68,0 +62,0 @@ const copy = new Uint8Array(chunk); |
@@ -69,10 +69,5 @@ /** | ||
} | ||
const defaultConfig = { | ||
width: 300, | ||
height: 150, | ||
timebaseNum: 1, | ||
timebaseDen: 30, | ||
bitrate: 200, | ||
realtime: false | ||
}; | ||
import defaultConfig from "./defaults.js"; | ||
async function init() { | ||
@@ -91,2 +86,3 @@ const wasmPath = await nextMessage(parentPort, "message"); | ||
params.realtime, | ||
params.kLive, | ||
chunk => { | ||
@@ -93,0 +89,0 @@ const copy = new Uint8Array(chunk); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2798515
0.07%34
3.03%3014
0.3%92
3.37%16
-5.88%