3 ms·
Awesome to see this on the front page! I’ve been chatting with the OP for a few days and this is based on a Node.js PoC I wrote for a blog post on the state of
by mmcclure 7y ago
Awesome to see this on the front page! I’ve been chatting with the OP for a few days and this is based on a Node.js PoC I wrote for a blog post on the state of broadcasting live from a browser[1].
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 https://mux.com/blog/the-state-of-going-live-from-a-browser
[2] https://github.com/pion/webrtc https://github.com/pion/webrtc
[3] https://glitch.com/~mmcc-next-streamr https://glitch.com/~mmcc-next-streamr
- chipneverdies 7y agoHey Matthew, thanks for the insights you've been providing to me thus far, I've added [1] to the references in the project's README! Meanwhile, there's another well-explained tutorial that complements [1] along with a code walkthrough to implement something similar in Node.js. https://github.com/fbsamples/Canvas-Streaming-Example/blob/master/README.md https://github.com/fbsamples/Canvas-Streaming-Example/blob/m...
- mmcclure 7y agoThank you! Really appreciate the link. I'm really interested to see where this project goes, please keep me in the loop!
- chipneverdies 7y agoWill do!