Closed k9p5 closed 1 month ago
As a sidenote, I've also watched Big Buck Bunny hundreds of times. It's part of the trade!
I see the bug, I'll investigate a fix later. It has to do with the description
field in the decoderConfig
of the meta
parameter to addAudioChunkRaw
(I assume you mean that method and not addVideoChunkRaw as you said). This field contains metadata for the Opus decoder to properly initialize. The format is described here:
https://www.rfc-editor.org/rfc/rfc7845#section-5
This data is naturally created by the browser when using AudioEncoder
, but since you're doing this manually, you'll have to manually provide it.
Are you able to extract this data from opuslib? It should be the header found at the start of the first encoded chunk. If you have access to it, pass it using the description
field.
I don't even think it's in the hundreds any more 🙈
Thank you so much, seems like the metadata field on the addAudioChunkRaw
method is not optional.
It is optional, which is why this error is still a bug that I need to fix in the case where you don't pass anything. But you should be passing something! Let me know when you've managed to fix your issue.
I was able to fix the error by providing the full meta object including the description as a opus head buffer. It works perfectly now, thanks again
Probably not relevant to you anymore, but I released an update that fixes the error you got with your initial code.
I've been trying to get the muxer work with an emscripten compiled version of opuslib (https://github.com/xiph/opus.git). Adding the chunks using
muxer.addVideoChunkRaw
works fine, however when I finalize the muxer I get the error:"mp4-muxer.js?v=a4bfc09b:511 Uncaught (in promise) RangeError: Offset is outside the bounds of the DataView"
The error is happening here: https://github.com/Vanilagy/mp4-muxer/blob/64fc8091db6fcff71d6edcdf247517e5e892a616/build/mp4-muxer.js#L542