将getUserMedia流式传输到Icecast服务器? [英] Stream getUserMedia to an Icecast server?

查看:195
本文介绍了将getUserMedia流式传输到Icecast服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将webrtc的getUserMedia(视频和音频)创建的本地blob流式传输到Icecast服务器,从而可以使用HTML5进行直播?

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?

特别是在下面的例子中(来自Justin Uberti的2012年Google I / O视频)我可以捕获音频/视频并在视频元素中本地播放:

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'/>

但是我不想将视频src设置为本地blob,而是将流发送到Icecast服务器,然后使用指向Icecast服务器的视频元素播放实时流。

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?

谢谢!!

推荐答案

看看这个

https://github.com / webcast / webcaster

它捕获getUserMedia PCM,在浏览器中使用JavaScript将其编码为MP3格式,将编码的MP3数据发送到Liquidsoap http://liquidsoap.fm/ 通过Websockets,然后Liquidsoap可以将该流广播到Icecast服务器。

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.

这篇关于将getUserMedia流式传输到Icecast服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆