With the following code in NodeJS I\'m able to play a webm file served from server:
app.get(\'/video\', function(req, res){
res.writeHead(200,{
\'Con
Thanks to key help from Brad's FB sample, I was able to put together a working version that sends an audio/video stream to icecast, which then can easily be played back in a browser. Since the audio and video codecs are directly copied, it's only 5 - 10 seconds of lag.
Here's the link:
https://gitlab.com/jamie/icecast-web-source-client
You can't just needle-drop into the WebM stream. WebM/Matroska require some setup to initialize the track info and what not. After that, you'll have Clusters, and you have to start on a Cluster. Additionally, Chrome is going to require that each Cluster start on a keyframe, which you're not going to be able to guarantee with the data from MediaRecorder. Therefore, server-side transcoding (or at least, some nasty hacking on the VP8 stream) is needed.
SFMediaStream could help you splitting media stream into chunk and play it back to the browser, or maybe on the server's speaker for Raspberry. And also adding effect on your stream, it would be fun enough to try the available effects.
//* Broadcaster
var presenterMedia = new ScarletsMediaPresenter(/*{options}*/);
// Send the packet below somewhere
presenterMedia.onRecordingReady = function(bufferHeader){};
presenterMedia.onBufferProcess = function(packet){};
//* Streamer
var audioStreamer = new ScarletsAudioStreamer();
audioStreamer.playStream();
// Receive from somewhere
audioStreamer.setBufferHeader(/* bufferHeader */);
audioStreamer.receiveBuffer(/* packet */);
There are some example on the repository if you want more detail on how to use it.