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

Allow pre-allocating bytes for eventual Duration section? #17

Open
somebee opened this issue Nov 22, 2022 · 0 comments
Open

Allow pre-allocating bytes for eventual Duration section? #17

somebee opened this issue Nov 22, 2022 · 0 comments

Comments

@somebee
Copy link

somebee commented Nov 22, 2022

Great library! It would be very nice if it was possible to run the first chunk received from MediaRecorder through this library to get a blob that has pre-allocated place for duration (and possibly cues?). This way, the final file would be the exact same length++ as the raw blob from MediaRecorder, but with a certain byte-range at the start replaced (where we inject the cues).

Then, after receiving the last chunk it should be possible to run the whole blob through library and essentially just replace a chunk of the start of the file?

See functionality from webm-muxer.js:

The constructor takes an optional options object with a single property, metadata_reserve_size. This is the number of extra bytes to leave at the start of the file for the header so it can be fixed up after writing stops. The default is 1024, which is enough to rewrite the header. WebMWriter will try to put the cues into this space too if they’re small enough, otherwise they’re appended to the end of the file, after the track data. You can increase metadata_reserve_size to leave more space for the cues at the start of the file, but remember the longer the recording, the larger the cues section will be.

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