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

Better performance in bigger video Width #13

Open
drenmullafetahu opened this issue May 27, 2021 · 4 comments
Open

Better performance in bigger video Width #13

drenmullafetahu opened this issue May 27, 2021 · 4 comments

Comments

@drenmullafetahu
Copy link

Very useful integration. Congrats on your implementation.

My question is:
Is there a way to increase the performance in bigger video size. I saw that right now it uses 640px video size. When you resize the video to 1980px the performance drops drastically.

So is there a way to bypass this issue .
Thanks in advance.

@Volcomix
Copy link
Owner

Yeah, even the 1280×720 video of this demo get a performance drop when resizing through WebGL. I tried to mitigate this by downloading the pixels asynchronously after resizing on GPU but uploading video textures to GPU with WebGL is also pretty slow. Maybe there is a way to improve it by mixing 2D Canvas for resizing and WebGL for post-processing only.

@benbro
Copy link

benbro commented Aug 13, 2021

Commercial sdk that improves the performance. Not sure how hard to implement.

@benbro
Copy link

benbro commented Nov 30, 2021

Can this improve performance for large videos with the WebGL2 pipeline?

  1. Add a new sourceCanvas with the size of the mask.
  2. Resize by copying from sourcePlayback.html to sourceCanvas with a 2d context.
  3. Use sourceCanvas instead of sourcePlayback.html when calling gl.texImage2D here:
  4. https://github.com/Volcomix/virtual-background/blob/main/src/pipelines/webgl2/webgl2Pipeline.ts#L170

@IDDD-Dennis
Copy link

Did anyone figure a way to increase the quality while keeping performance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants