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

Using WebMWriter inside a WebWorker #39

Open
dayaftereh opened this issue Jan 27, 2022 · 3 comments
Open

Using WebMWriter inside a WebWorker #39

dayaftereh opened this issue Jan 27, 2022 · 3 comments

Comments

@dayaftereh
Copy link

I would like to use the WebMWriter inside a WebWorker, but I get the exception

'window' is not defined

Some digging in the code I found that window is used at:

return window.atob(url.substring("data:image\/webp;base64,".length));

Changing the line to:

return self.atob(url.substring("data:image\/webp;base64,".length)); 

solved the issue.

@nuthinking
Copy link

@dayaftereh Do you get better performances?

@dayaftereh
Copy link
Author

@nuthinking I haven't measured the performance yet. I'm transfering a video frame by frame to the WebWorker. A the WebWorker I run some green screen removing and 2d particle simulation by redraw everything with an offscreen canvas. I do all the stuff at the WebWorker to keep the Main-Loop responsive.

@nuthinking
Copy link

nuthinking commented Feb 8, 2022

I don't need the main loop to be responsive, but I really need to find ways to speed up the recording. See #40 . Any tips on how to move it to a WebWorker so that I can test it? If passing the same frame to multiple workers doesn't take many milliseconds. I might be able to cut the time needed by half. Thanks!

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

2 participants