yusitnikov / fix-webm-duration

navigator.mediaDevices.getUserMedia + MediaRecorder create WEBM files without duration metadata. This library appends missing metadata section right to the file blob.
MIT License
248 stars 48 forks source link

Can this be used with a readable stream #7

Closed gregermendle closed 2 years ago

gregermendle commented 3 years ago

Hey!

I forked a different typescript version of this repo to change out Blob for an ArrayBuffer. I'm working with somewhat large webm files that have no duration and I'm wondering if there is any known way with the current implementation on how a readable stream could be used to do this instead. I was looking through the source and it looks like that may not be possible without changing how it searches for Sections and injects the duration metadata, but figured i'd ask.

Thanks!

yusitnikov commented 3 years ago

Hey @gregermendle ,

I'm not very familiar with the readable/writable streams in JS, but basically, the script needs random access to the contents to be fast, and I doubt that it's doable with the streams. And even if doable, it will require some refactoring. Also, the script was not optimized for memory usage yet, so I don't recommend using it with large files.