This is, IMO, the simplest way to be able to go from a modern browser to an RTMP endpoint. You could try and do server-side WebRTC using a project like Pions[2], or use headless Chrome and be a peer, but both of those come with their own headaches. This just uses the MediaRecorder API to send chunks of video as it’s available via a WebSocket, then the server pipes those messages into FFmpeg via stdin. It’s lightweight enough that it even runs incredibly well on Glitch[3].
Also, if you’re curious, the videos that come out of the MediaRecorder are all over the place between browsers, but they’re all varying degrees of “barely qualifying as playable video”. Incredibly fun to play with, but you will absolutely need to encode any output from it.
[1] https://mux.com/blog/the-state-of-going-live-from-a-browser