Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stream getUserMedia to an Icecast server?

Is there a way to stream the local blob created by webrtc's getUserMedia (vidio and audio) to an Icecast server, making it possible to live broadcast using HTML5?

Specifically in the following example (from Justin Uberti's 2012 Google I/O video) I can capture audio/video and play it locally in a video element:

<script type="text/javascript">
var onGotStream = function(stream) {
  var url = webkitURL.createObjectURL(stream);
  video.src = url; //
}
navigator.webkitGetUserMedia({video: true, audio: true}, onGotStream, null);
<script>

<video = id='video' autoplay='autoplay'/>

But instead of setting the video src to the local blob I'd like to send the stream to an Icecast server and then play that live stream using video elements pointing to the Icecast server.

Is this possible? How would I go about it?

Thanks!!

like image 809
Bob Smith Avatar asked Nov 13 '22 00:11

Bob Smith


1 Answers

Take a look at this

https://github.com/webcast/webcaster

it captures getUserMedia PCM, encodes it to MP3 format using JavaScript right in your browser, sends encoded MP3 data to Liquidsoap http://liquidsoap.fm/ via Websockets and then Liquidsoap can broadcast that stream to Icecast server.

like image 160
Alex Paramonov Avatar answered Jan 23 '23 18:01

Alex Paramonov