pa_encoder 0.2.8 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -7
- package/dist/browser/index.js +2 -2
- package/dist/index.js +219 -69
- package/dist/ui/encoder.html +38 -1
- package/dist/ui/encoder.js +121 -11
- package/dist/ui/preview.js +159 -18
- package/dist/worker.js +11 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
HTML canvas frame encoder made for personal use
|
|
1
|
+
HTML canvas frame encoder made for personal use.
|
|
2
2
|
|
|
3
3
|
# Installation
|
|
4
4
|
|
|
@@ -31,6 +31,11 @@ pa_encoder --url http://localhost:5173 --entry /src/main.js
|
|
|
31
31
|
|
|
32
32
|
The UI shows a live preview, capture controls, and progress logs.
|
|
33
33
|
|
|
34
|
+
Live mode UI tips:
|
|
35
|
+
- `Duration=0` means manual stop
|
|
36
|
+
- `PendingCap` limits concurrent canvas snapshot tasks
|
|
37
|
+
- `Stats(ms)` controls status update interval to keep UI lightweight
|
|
38
|
+
|
|
34
39
|
---
|
|
35
40
|
|
|
36
41
|
## JavaScript API
|
|
@@ -43,15 +48,21 @@ import { startLiveCapture, createZipExporter } from "pa_encoder";
|
|
|
43
48
|
const canvas = document.querySelector("canvas");
|
|
44
49
|
const exporter = await createZipExporter({ zipName: "frames.zip" });
|
|
45
50
|
|
|
46
|
-
const
|
|
51
|
+
const session = await startLiveCapture({
|
|
47
52
|
canvas,
|
|
48
53
|
exporter,
|
|
49
54
|
fps: 30,
|
|
55
|
+
maxPendingCaptures: 2,
|
|
50
56
|
});
|
|
51
57
|
|
|
52
|
-
await stop();
|
|
58
|
+
await session.stop();
|
|
53
59
|
```
|
|
54
60
|
|
|
61
|
+
`startLiveCapture()` returns `{ stop, stats, done }`:
|
|
62
|
+
- `stop()` finalizes capture/export
|
|
63
|
+
- `stats` is the live mutable stats object
|
|
64
|
+
- `done` resolves when capture fully stops/finalizes
|
|
65
|
+
|
|
55
66
|
---
|
|
56
67
|
|
|
57
68
|
### Deterministic frame capture (virtual time)
|
|
@@ -133,7 +144,3 @@ Uses File System export when available, otherwise ZIP.
|
|
|
133
144
|
- `createImageBitmap`
|
|
134
145
|
- ZIP export works in most modern browsers
|
|
135
146
|
- File System export requires Chromium + secure context
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)(ツ)^0^
|