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

Too much memory for large files #393

Open
tiuvi opened this issue Apr 8, 2024 · 1 comment
Open

Too much memory for large files #393

tiuvi opened this issue Apr 8, 2024 · 1 comment

Comments

@tiuvi
Copy link

tiuvi commented Apr 8, 2024

Library uses too much memory for large files

image

In this case the file weighs 500 MB and uses 700 MB, I think the memory could be lowered to 0 using this api.

https://developer.mozilla.org/en-US/docs/Web/API/File_System_API

This api lets you create a virtual file where you can save the data and then obtain it through the demux by reading the file.

I have already made progress in demux webm, ffmpeg and webCodecs by reducing memory.
I would only be missing the mp4 demuxer.

I don't know exactly where the memory expenditure is, it could be when reading the file that everything is stored in memory and then reading it to process it or it could be when creating the chunks that it stores them in memory and that is why it uses so much memory.

In either case you could use this api to read directly from the file.

image

If you use it, I recommend using this one, which is compatible with webview
https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle

image

You only need to save the file's offsets and then read them.

Someone who knows the library well could implement it quickly, greetings.

@rbouqueau
Copy link
Member

Hi there, I think you'll have more chance if you write in English. Thanks

@tiuvi tiuvi changed the title Nueva function add sample Too much memory for large files Jul 5, 2024
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