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

Memory Access out of bounds when executing commands on a lot of files #704

Open
MartinSalmon98 opened this issue Mar 13, 2024 · 0 comments

Comments

@MartinSalmon98
Copy link

When using this library to get thumbnails for videos, I get a memory out of bounds error after 60 to 70 videos.
The exec args are : "-i input.mp4 -vf scale:71:-1 -frames:v 1 thumbnail.jpg"
It works well until 50 files but then I have an error and the Web Page crashed. The size of the files doesn't matter, the error happens after the same number of files.

My goal would be to use it on > 500 files at a time.

I saw that the library is spawning Web Workers to execute the command. But after executing, the Web Workers stays and is not deleted. Even when using the ffmpeg.terminate() function (which should kill everything), the Web Workers are still there and keep some memory with them (thus when spawning the next one, the browser doesn't have enough memory).

To reproduce, you just need a loop and execute the command > 80 times and it will crash at some point.

I would expect the terminate() function to actually kill all the Web Workers and free their memory OR to only spawn one Web Worker and use the same one to execute all the commands.

I use a Windows laptop that has 32GB of memory and I'm running ffmpeg.wasm in Chrome version 122.0.6261.112.

Thank you in advance!

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

1 participant