java Red5 RTMP 流媒体

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2127348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 19:35:22  来源:igfitidea点击:

Red5 RTMP Streaming

javaflashred5rtmp

提问by SyntaxError

I'm very new to RTMP streaming and am seeking help. Just enough to get me started.

我对 RTMP 流很陌生,正在寻求帮助。足以让我开始。

I have been Googling for about 5-7 hours now and still cannot determine my answer!

我已经在谷歌上搜索了大约 5-7 个小时,但仍然无法确定我的答案!

The documentation of Red5 is limited and cannot find any support at all! Even similar questions to mine are unanswered on stackoverflow :(

Red5 的文档有限,根本找不到任何支持!甚至与我类似的问题在 stackoverflow 上也没有答案:(

My questions are:

我的问题是:

  1. Why can't I simply place an .mp3 inside red5's server root and play it?
  2. To serve a simple MP3 file over RTMP. Do I need to write a Java application?
  3. If so, any pointers?
  1. 为什么我不能简单地将 .mp3 放在 red5 的服务器根目录中并播放它?
  2. 通过 RTMP 提供简单的 MP3 文件。我需要编写 Java 应用程序吗?
  3. 如果是这样,任何指针?

To make matters worse, I have little to none Java experience.

更糟糕的是,我几乎没有 Java 经验。

Please help ST.

请帮助ST。

回答by Paul Gregtheitroade

The easiest way to do what you want to is to install the oflaDemo. Start your red5 server and go to http://localhost:5080/installer
You need to select "oflaDemo" there and install it, if you don't already have it installed. Next place your mp3's or whatever in the following location

做你想做的最简单的方法是安装oflaDemo。启动您的 red5 服务器并转到http://localhost:5080/installer
如果您还没有安装它,您需要在那里选择“oflaDemo”并安装它。接下来将您的 mp3 或任何内容放在以下位置

%RED5_HOME%/webapps/oflaDemo/streams

Red5 home will be the directory where you installed Red5. So if you used an installer it may look like this:

Red5 home 将是您安装 Red5 的目录。因此,如果您使用安装程序,它可能如下所示:

C:\Program Files\Red5\webapps\oflaDemo\streams

To play your mp3 without writing any code flash or java, next go to this url: http://localhost:5080/demos/ofla_demo.html
Connect and select your file from the list and thats it.

要在不编写任何代码 flash 或 java 的情况下播放您的 mp3,请访问此 url: http://localhost:5080/demos/ofla_demo.html
Connect 并从列表中选择您的文件,就是这样。

回答by Thiago

for streaming an mp3 file you don't need any functionality of the red5 server, a webserver should be enough.

对于流式传输 mp3 文件,您不需要 red5 服务器的任何功能,网络服务器就足够了。

if you still have to load it from the red5 server:

如果您仍然需要从 red5 服务器加载它:

  • is the file accessible in your browser? e.g. http://[red5-server]/file.mp3
  • then just use this url when loading the mp3 file in flash as this is not working i want to include url in my jsp how can i do that and what player i have to use
  • 该文件是否可以在您的浏览器中访问?例如http://[red5-server]/file.mp3
  • 然后在 Flash 中加载 mp3 文件时只使用这个 url 因为这不起作用我想在我的 jsp 中包含 url 我该怎么做以及我必须使用什么播放器

回答by chips

have you got the Demos that come with RED5 installed? You won't have to code in java but you will have to open up a connection in flash in order to stream the mp3, the demos that comes with RED5 installation should have those examples.

你安装了 RED5 附带的 Demos 吗?您不必用 java 编写代码,但必须在 flash 中打开连接才能流式传输 mp3,RED5 安装附带的演示应该有这些示例。

回答by Prashant

I felt Wowza easier. There is a free version of Wowza which allows upto 10 connections. But after that you have start shelling money. But definitely lesser than FMS! And it is very easy. Just a few steps to setup and you can have your very own RTMP application streaming mp3 :) And if you do find the answer of how to stream RTMP on Red5, please do let me know!

我觉得Wowza更容易。Wowza 有一个免费版本,最多允许 10 个连接。但在那之后你就开始炮轰钱了。但绝对比FMS少!这很容易。只需设置几个步骤,您就可以拥有自己的 RTMP 应用程序流式传输 mp3 :) 如果您确实找到了如何在 Red5 上流式传输 RTMP 的答案,请告诉我!