@stream-io/video-filters-web 0.3.0 → 0.5.0
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/CHANGELOG.md +12 -0
- package/README.md +27 -24
- package/dist/index.cjs.js +1099 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.es.js +1096 -7
- package/dist/index.es.js.map +1 -1
- package/dist/src/FallbackGenerator.d.ts +17 -0
- package/dist/src/FallbackProcessor.d.ts +38 -0
- package/dist/src/VirtualBackground.d.ts +42 -0
- package/dist/src/WebGLRenderer.d.ts +80 -0
- package/dist/src/compatibility.d.ts +5 -0
- package/dist/src/{createRenderer.d.ts → legacy/createRenderer.d.ts} +1 -2
- package/dist/src/{webgl2 → legacy/webgl2}/backgroundBlurStage.d.ts +1 -1
- package/dist/src/{webgl2 → legacy/webgl2}/webgl2Pipeline.d.ts +1 -1
- package/dist/src/mediapipe.d.ts +4 -0
- package/dist/src/types.d.ts +45 -0
- package/index.ts +6 -3
- package/mediapipe/models/selfie_segmenter.tflite +0 -0
- package/mediapipe/wasm/vision_wasm_internal.js +20 -0
- package/mediapipe/wasm/vision_wasm_internal.wasm +0 -0
- package/mediapipe/wasm/vision_wasm_nosimd_internal.js +20 -0
- package/mediapipe/wasm/vision_wasm_nosimd_internal.wasm +0 -0
- package/package.json +5 -2
- package/src/FallbackGenerator.ts +90 -0
- package/src/FallbackProcessor.ts +132 -0
- package/src/VirtualBackground.ts +276 -0
- package/src/WebGLRenderer.ts +1187 -0
- package/src/compatibility.ts +22 -0
- package/src/{createRenderer.ts → legacy/createRenderer.ts} +1 -2
- package/src/{tflite.ts → legacy/tflite.ts} +1 -1
- package/src/{webgl2 → legacy/webgl2}/backgroundBlurStage.ts +1 -1
- package/src/{webgl2 → legacy/webgl2}/webgl2Pipeline.ts +1 -1
- package/src/mediapipe.ts +25 -0
- package/src/types.ts +62 -0
- /package/dist/src/{helpers → legacy/helpers}/webglHelper.d.ts +0 -0
- /package/dist/src/{segmentation.d.ts → legacy/segmentation.d.ts} +0 -0
- /package/dist/src/{tflite.d.ts → legacy/tflite.d.ts} +0 -0
- /package/dist/src/{webgl2 → legacy/webgl2}/backgroundImageStage.d.ts +0 -0
- /package/dist/src/{webgl2 → legacy/webgl2}/jointBilateralFilterStage.d.ts +0 -0
- /package/dist/src/{webgl2 → legacy/webgl2}/resizingStage.d.ts +0 -0
- /package/dist/src/{webgl2 → legacy/webgl2}/softmaxStage.d.ts +0 -0
- /package/src/{helpers → legacy/helpers}/webglHelper.ts +0 -0
- /package/src/{segmentation.ts → legacy/segmentation.ts} +0 -0
- /package/src/{tflite-simd.js → legacy/tflite-simd.js} +0 -0
- /package/src/{webgl2 → legacy/webgl2}/backgroundImageStage.ts +0 -0
- /package/src/{webgl2 → legacy/webgl2}/jointBilateralFilterStage.ts +0 -0
- /package/src/{webgl2 → legacy/webgl2}/resizingStage.ts +0 -0
- /package/src/{webgl2 → legacy/webgl2}/softmaxStage.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.5.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-filters-web-0.4.0...@stream-io/video-filters-web-0.5.0) (2025-11-17)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- **react:** Improved Video Filters ([#1977](https://github.com/GetStream/stream-video-js/issues/1977)) ([f8831f1](https://github.com/GetStream/stream-video-js/commit/f8831f152a716ebf4e9656f32a8f83b707db779f))
|
|
10
|
+
|
|
11
|
+
## [0.4.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-filters-web-0.3.0...@stream-io/video-filters-web-0.4.0) (2025-10-30)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- Migrate logger to js-toolkit logger implementation ([#1959](https://github.com/GetStream/stream-video-js/issues/1959)) ([5a424f7](https://github.com/GetStream/stream-video-js/commit/5a424f72cec2a8cbc0bfa23147d9988ab9bfbdc1))
|
|
16
|
+
|
|
5
17
|
## [0.3.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-filters-web-0.2.2...@stream-io/video-filters-web-0.3.0) (2025-10-14)
|
|
6
18
|
|
|
7
19
|
### Features
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @stream-io/video-filters-web
|
|
2
2
|
|
|
3
|
-
A helper library
|
|
3
|
+
A helper library that provides the core functionality for video filters in the [Stream Video SDK](https://getstream.io/video/sdk/react/).
|
|
4
4
|
|
|
5
|
-
This library borrows a lot of code and concepts from the amazing [virtual-background](https://github.com/
|
|
5
|
+
This library borrows a lot of code and concepts from the amazing [virtual-background](https://github.com/vpalmisano/virtual-background) library.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -14,34 +14,37 @@ yarn add @stream-io/video-filters-web
|
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
16
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
isMediaPipePlatformSupported,
|
|
18
|
+
loadMediaPipe,
|
|
19
|
+
VirtualBackground,
|
|
20
20
|
} from '@stream-io/video-filters-web';
|
|
21
21
|
|
|
22
|
-
// 1.
|
|
23
|
-
const isSupported = await
|
|
22
|
+
// 1. Check if the platform is supported
|
|
23
|
+
const isSupported = await isMediaPipePlatformSupported();
|
|
24
24
|
if (!isSupported) {
|
|
25
25
|
throw new Error('Platform not supported');
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// 2.
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
|
|
28
|
+
// 2. Load the MediaPipe model
|
|
29
|
+
const mediaPipeModel = await loadMediaPipe();
|
|
30
|
+
|
|
31
|
+
// 3. Create the processor
|
|
32
|
+
const processor = new VirtualBackground(
|
|
33
|
+
track,
|
|
34
|
+
{
|
|
35
|
+
modelPath: mediaPipeModel.modelPath,
|
|
36
|
+
backgroundBlurLevel: blurLevel, // 'low' | 'medium' | 'high' | number
|
|
37
|
+
backgroundImage: backgroundImage, // string (URL or data URI)
|
|
38
|
+
backgroundFilter: 'image', // or 'blur'
|
|
39
|
+
},
|
|
40
|
+
{ onError, onStats },
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// 4. Start the processor and use the processed track
|
|
44
|
+
const processedTrack = await processor.start();
|
|
45
|
+
|
|
46
|
+
// 5. Stop the processor
|
|
47
|
+
processor.stop();
|
|
45
48
|
```
|
|
46
49
|
|
|
47
50
|
## Known limitations
|