- Dec 28, 2018
- Reaction score
Yeah, the best option would be MediaStream but unfortunately I haven't found a way in Node.js to create them from a custom source. WebRTC is really meant as a peer to peer (browser to browser) protocol and using it on the server is kind of a bastardization. At the moment, I haven't found a library that implements creating MediaStreams from custom sources on the server, only DataChannels. At least not in Node.js and I'm pretty set on using Node.js for this project, even if it's not the ideal tech. It is one of the constraints I have decided to put on myself for this project and I'm sticking with it.I would try to use the media streams. They will deal with the other part of the problem which is getting the frames displayed as quickly as possible. The browsers media player isnt designed for that. Unless you really are able to decode to canvas. Even then make sure the decoder supports delivering the frame at once or skipping.