Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GaussianBlurBackgroundProcessor doesn't work with offscreencanvas on Safari 16.4+; Significant memory usage error #59

Open
7 tasks done
pzubar opened this issue Apr 25, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@pzubar
Copy link

pzubar commented Apr 25, 2023

Although Safari 16.4 supports OffscreenCanvas API and the VirtualBackgroundProcessor does its job, after switching to GaussianBlurBackgroundProcessor video becomes unprocessed. Moreover, after some time of using any processor with inputFrameBufferType: 'offscreencanvas', Safari shows the "This web page was reloaded because it was using significant memory" error and reloads the page.

Also, sometimes "VirtualBackgroundProcessor" shows only the background, not the person (I have no specific steps to reproduce, it seems to happen randomly after changing the video quality or processor, etc).

image

  • I have verified that the issue occurs with the latest twilio-video-processors.js release and is not marked as a known issue in the CHANGELOG.md.
  • I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

Code to reproduce the issue:

...
let blurProcessor = new GaussianBlurBackgroundProcessor({
  assetsPath: '/tflite',
  blurFilterRadius: 10,
  maskBlurRadius: 1,
  pipeline: Pipeline.Canvas2D,
  debounce: isSafari() // true
});
await blurProcessor.loadModel();
...
videoTrack.addProcessor(blurProcessor, {
    inputFrameBufferType: typeof OffscreenCanvas === 'undefined' ? 'canvas' : 'offscreencanvas',
    outputFrameBufferContextType: '2d',
};

Expected behavior:

Processed (blurred) video is shown. No error is shown. The page is not reloaded. A person is shown altogether with a virtual background.

Actual behavior:

The video is not blurred. The page is reloaded showing the "This web page was reloaded because it was using significant memory" error. A person is not shown.

Software versions:

  • Browser(s): Safari 16.4 (18615.1.26.11.23)
  • Operating System: macOS 13.3.1. (MacBook Pro, 2020)
  • twilio-video-processors.js: 2.0.0
  • Third-party libraries (e.g., Angular, React, etc.): Ember.js
@pzubar pzubar added the bug Something isn't working label Apr 25, 2023
@Talb2005
Copy link

Talb2005 commented Jul 5, 2023

Any update on this?

@luisrivas
Copy link
Collaborator

Hi @pzubar!

Thanks for reporting this issue.

We added some performance improvements to the version 3. To resolve this issue, we recommend updating to the newest video processor version. If you continue to experience problems after upgrading, please let us know, and we will be happy to assist you further.

https://github.com/twilio/twilio-video-processors.js/releases

Bests,
Luis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants