实时音频流 [英] Live Audio Stream

查看:310
本文介绍了实时音频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用icecast服务器设置实时互联网广播电台,并希望我的视频流在所有现代浏览器中都能正常工作.我的客户仅产生.ogg流.所有浏览器均不播放.ogg流.例如,我设置的.ogg流在chrome中起作用,但在IE中不起作用.我应该如何使其在所有浏览器中运行?

I am trying to setup live internet radio station using icecast server and want my stream to work in all modern browsers. My client only produces .ogg stream. All browsers doesn't play .ogg stream. For eg the .ogg stream I have setup works in chrome but doesn't work in IE. How should I make it run in all browsers?

  1. 有没有一种方法可以将.ogg流实时转换为.mp3或任何其他格式
  2. 在浏览器中嵌入了可以播放.ogg流的音频播放器.

或者其他任何建议都将有所帮助.

Or Any other advice would be helpful.

关于, Hitesh Bhutani

Regards, Hitesh Bhutani

推荐答案

您有几种选择:

  1. 在您的Virtual DJ软件中将编码格式从OGG更改为MP3.请记住,由于许可限制,Firefox无法在某些使用HTML5音频标签的平台上播放mp3流.

  1. Change encoding format from OGG to MP3 in your Virtual DJ software. Keep in mind that Firefox will not be able to play mp3 streams on some platforms using HTML5 audio tag due to licensing limitations.

在您的服务器(已安装并运行Icecast的服务器)上安装某种转码软件,例如liquidosap( http://yourserver.com:8000/stream.aac ,然后您可以创建一个小的JavaScript,以检测浏览器版本并选择合适的流.

Install some kind of transcoding software on your server (where you have Icecast installed and running), for example liquidosap (https://www.liquidsoap.info/). Liquidsoap can (among other things) take your stream as an input and transcode it to sereveral formats, for example - mp3, aac, ogg and then your Icecast server will have several mount points available, for example http://yourserver.com:8000/stream.mp3, http://yourserver.com:8000/stream.ogg, http://yourserver.com:8000/stream.aac and then you can create a small javascript that wil detect browser version and choose suitable stream.

使用HTML5媒体播放器,例如jPlayer( http://jplayer.org/)或Soundmanager2( http://www.schillmania.com/projects/soundmanager2/).这些播放器可以自动检测浏览器版本并选择合适的流类型,如果它们不能使用HTML5 <audio>标签播放流,它们将退回到基于Flash的内部播放器中.

Use HTML5 media player like jPlayer (http://jplayer.org/) or Soundmanager2 (http://www.schillmania.com/projects/soundmanager2/). These players can automatically detect browser version and select suitable stream type, also if they can't play the stream using HTML5 <audio> tag, they will fall back to internal Flash based player.

最高级的方法是组合(2)和(3)方法,这将为您提供最多的浏览器支持.

The most advanced way is to combine (2) and (3) methods, that will give you the most browser support.

支持的音频编码格式

这篇关于实时音频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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