Open Rock-N-Troll opened 3 years ago
writeFrame is a little misleading. I think the muxer needs compressed data. After your "decode" operation, the data is uncompressed. If you run through an encoder again, it will be compressed again, and can then send to the muxer. The "packet" you are using is still compressed straight out of the demuxer, so it works.
I have been trying to get the muxer.writeFrame function to accept uncompressed audio Frames instead of compressed audio Packets.
Performing await muxer.writeFrame(packet); works. No errors. Performing await muxer.writeFrame({frame: dec_result.frames[0]}); does not work. It leads to a segfault.
https://github.com/Streampunk/beamcoder/blob/20e28d29d3bf7933b8a250005c7f43fc6c73cc9d/types/Muxer.d.ts
The documentation suggests muxer.writeFrame should work with frames unless I'm missing something. Maybe it actually means video frames? Any input or sample code for using muxer.writeFrame with an audio frame object would be much appreciated.