Stream getUserMedia to an Icecast server?

徘徊边缘 提交于 2019-11-27 16:51:01

问题


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!!


回答1:


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.



来源:https://stackoverflow.com/questions/11973597/stream-getusermedia-to-an-icecast-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!