Vanilagy/webm-muxer

Stream to web storage

nsharma1396 opened this issue ยท 2 comments

Hi @Vanilagy

Just wanted to check if there is any way that we can use the streaming option to stream data to web storage like IndexedDB.
I would like to avoid array buffer target as the in-memory usage may increase for larger videos but I do not have the flexibility to prompt for saving to a file hence was wondering if an in-memory streaming option is available somehow

Thanks,
Neeraj

You can't really "stream" to IndexedDB sadly, which is the problem here. Of course, we could chunk it up and write multiple ArrayBuffers into IndexedDB, but reading the file and playing it back is the issue then in that case. If we had an entire Blob storing the media in the IndexedDB, that would solve the problem (because the browser intelligently reads from the Blob), but to write the Blob we need to have the entire video in memory, so that's no option here.

I suggest you look into using the OPFS instead of IndexedDB! This will solve your problem and does not require you to ask for user permission, and you can use it to store large files you can incrementally write to.

Awesome! Thanks, will take a look into it ๐Ÿ‘