Webcodecs mux with Ffmpeg.wasm

I am currently creating a video editor with webcodecs. I would like to use FFmepg/Wasm for muxing, as I previously worked with mp4box.js and encountered many problems.

The question I have is how best to give FFMPEG the encoded chunks.

Unfortunately, I have never worked with WASM and FFMPEG before.

How I imagined the pipeline:

I saved all encodedChunks in arrays like:

encodedVideoChunks: EncodedVideoChunk[];
encodedAudioChunks: EncodedAudioChunk[];

A Muxer_FFmpeg class should now handle the encoded Chunks. Thats where I am stuck.