diff --git a/CHANGELOG.md b/CHANGELOG.md index b7f3f91..c98f9d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,46 @@ +3.0.0-beta.1 (December 4, 2024) +=============================== + +* Web workers are now supported for Firefox and Safari. + +3.0.0-preview.2 (September 16, 2024) +==================================== + +* The web workers can now be hosted on a different domain than that of the application, provided the `Access-Control-Allow-Origin` response header points to the domain of the application. + ```ts + import { GaussianBlurBackgroundProcessor } from '@twilio/video-processors'; + + /* Application is running at https://appserver.com/app */ + + const processor = new GaussianBlurBackgroundProcessor({ + assetsPath: "https://assetsserver.com/path/to/assets" + }); + ``` + +3.0.0-preview.1 (August 13, 2024) +================================= + +*The 3.x version of the Video Processors SDK works with `twilio-video` SDK versions `2.29.0` and above.* + +API Changes +----------- + +* The VideoProcessors now run in web workers on Chromium-based browsers. Support for web workers on other supported browsers is upcoming. While adding a `VideoProcessor` to a `VideoTrack`, use the following `AddProcessorOptions`: + ```ts + videoTrack.addProcessor(processor, { + inputFrameBufferType: 'videoframe', + outputFrameBufferContextType: 'bitmaprenderer' + }); + ``` +* The `Canvas2D` and `WebGL2` pipelines are replaced by a single hybrid pipeline. Therefore, the following APIs are no longer available: + * `BackgroundProcessorOptions.pipeline` + * `Pipeline` enum exported by `@twilio/video-processors` + +Performance Improvements +------------------------ + +*TODO(mmalavalli)* + 2.2.0 (July 16, 2024) ===================== diff --git a/LICENSE.md b/LICENSE.md index d29b5f9..ecba1f6 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ The following license applies to all parts of this software except as documented below. - Copyright (C) 2022 Twilio Inc. + Copyright (C) 2025 Twilio Inc. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 7fbe7fa..aa69f53 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,11 @@ You can also copy `twilio-video-processors.js` from the `dist/build` folder and ### Assets -In order to achieve the best performance, the VideoProcessors use WebAssembly to run TensorFlow Lite for person segmentation. You need to serve the tflite model and binaries so they can be loaded properly. These files can be downloaded from the `dist/build` folder. Check the [API docs](https://twilio.github.io/twilio-video-processors.js/interfaces/VirtualBackgroundProcessorOptions.html#assetsPath) for details and the [examples](https://github.com/twilio/twilio-video-processors.js/tree/master/examples) folder for reference. +In order to achieve the best performance, the VideoProcessors use WebAssembly to run TensorFlow Lite for person segmentation. You need to serve the tflite model, binaries and web workers so they can be loaded properly. These files can be downloaded from the `dist/build` folder. Check the [API docs](https://twilio.github.io/twilio-video-processors.js/interfaces/VirtualBackgroundProcessorOptions.html#assetsPath) for details and the [examples](https://github.com/twilio/twilio-video-processors.js/tree/master/examples) folder for reference. + +#### CORS + +If you are serving the assets from a domain that is different from that of your application, then ensure that the `Access-Control-Allow-Origin` response header points to your application's domain. ## Usage diff --git a/assets/selfie_segmentation_landscape.tflite b/assets/selfie_segmentation_landscape.tflite index 4ea3f8a..3a508f8 100644 Binary files a/assets/selfie_segmentation_landscape.tflite and b/assets/selfie_segmentation_landscape.tflite differ diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..d397cf8 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,20 @@ +const globals = require("globals"); +const pluginJs = require("@eslint/js"); +const tseslint = require("typescript-eslint"); + + +module.exports = [ + { files: ["lib/**/*.ts"] }, + { languageOptions: { globals: globals.browser } }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, + { + rules: { + "@typescript-eslint/ban-ts-comment": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-namespace": "warn", + "no-unused-vars": "warn", + "no-undef": "warn", + }, + }, +]; diff --git a/examples/README.md b/examples/README.md index e410d1c..9fd6335 100644 --- a/examples/README.md +++ b/examples/README.md @@ -8,9 +8,10 @@ Go to `${PROJECT_ROOT}/examples` and run `npm install`. It will install the depe Open `http://localhost:3000` in a Chrome tab. The app captures your camera upon loading and plays it in a `