-
-
Notifications
You must be signed in to change notification settings - Fork 338
Write output to Blob #54
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
Comments
Unfortunately Blobs don't work this way. I added a write function to WORKERFS to test it and found out that a Blob only references other objects like Uint8Arrays. So data doesn't get cached to disk just by using Blobs (personally I think browsers should actually do that)... |
Hi @CodeFetch, I am looking into the IDBFS solution as well. Have you made any progress? |
@jfizz No, the problem is that IDBS only has an asynchronous API, but the read/write functions need to be synchronous. It won't work with asyncify as you can't return anything from an asynchronous library function as far as I know. So you need to use the emterpreter and the whole call stack of read/write functions needs to be emterpreted (added to the emterpretify whitelist) or ffmpeg will be unusably slow. At the moment I don't know how to properly implement asynchronous library functions. |
This should be handled by the app. What if you don't want it written to blob? |
@goatandsheep Blobs are the "correct" way to store big binary data in JavaScript. The whole reason for this issue was the idea:
On some devices the memory for JavaScript is very limited and ffmpeg.js easily runs out of memory. |
For sure! I'm just wondering if it needs to be done in this library specifically. That's a really good point re: memory! I was actually considering trying the library in node which doesn't have blob support |
MEMFS stores all its contents in memory. I don't think you can somehow swap it to disk. |
It'd be nice if there was a way to have the output written to a
Blob
instead of returning aUint8Array
, because browsers are able to put aBlob
on disk if it gets too big for memory.Writing to the end of a blob is straightforward:
Writing to the middle is a bit more complicated, but still doable:
The text was updated successfully, but these errors were encountered: