You might not even need ffmpeg.js for that anymore. WebCodecs API is well supported nowadays.

https://developer.mozilla.org/en-US/docs/Web/API/VideoEncode...