Apache flex 如何使用Flex将视频流发送到Red5服务器?
我正在尝试使用Flex将视频流发送到Red5服务器 我的Red5设置似乎适用于远程方法调用和共享对象,但我还没有成功地使视频正常工作 这是连接到Red5的AS3代码:Apache flex 如何使用Flex将视频流发送到Red5服务器?,apache-flex,flash,actionscript-3,red5,Apache Flex,Flash,Actionscript 3,Red5,我正在尝试使用Flex将视频流发送到Red5服务器 我的Red5设置似乎适用于远程方法调用和共享对象,但我还没有成功地使视频正常工作 这是连接到Red5的AS3代码: # connect to RTMP server netConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); netConnection.connect("rtmp://localhost/context_name"); # omitte
# connect to RTMP server
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
netConnection.connect("rtmp://localhost/context_name");
# omitted code for waiting for connection success, and setting up shared
# objects (which works fine - the Red5 setup is hence OK)
当收到NetConnection.Connect.Success
时,将运行以下代码以开始发送流:
# when NetConnection.Connect.Success then the following code is run:
var netStream:NetStream = new NetStream(netConnection);
netStream.publish("name_of_stream", "live");
netStream.attachCamera(Camera.getCamera());
但是,这不起作用,所以我做错了什么
这是绑定到我要连接的Red5上下文的Java应用程序:
package com.company;
public class NameOfApplication extends ApplicationAdapter {
// Empty class.
}
我正在运行Red5 0.9.1,我所做的唯一配置是通过编辑WEB-INF/Red5 WEB.xml
并添加以下内容来设置我的应用程序:
<bean id="context_name.context" class="org.red5.server.Context" autowire="byType" />
<bean id="context_name.scope" class="org.red5.server.WebScope" init-method="register">
<property name="server" ref="red5.server" />
<property name="parent" ref="global.scope" />
<property name="context" ref="context_name.context" />
<property name="handler" ref="context_name.handler" />
<property name="contextPath" value="/context_name" />
<property name="virtualHosts" value="*,localhost, localhost:5080, 127.0.0.1:5080" />
</bean>
<bean id="context_name.handler" class="com.company.NameOfApplication" />
我做错了什么?如前所述,请注意,Red5设置对于远程方法调用和共享对象来说是完美的,但对于奇怪的视频来说却不是完美的。只是一个想法,但是你知道你的相机使用的是什么编解码器吗 我已经成功地启动了一个简单的Flex应用程序&运行到一个Red5示例服务器应用程序上,从中我可以看出,它所做的与您所做的几乎相同
如果您将“live”更改为“record”,您的服务器应用程序的streams目录中是否保存了任何内容?只是一个想法,但您知道您的相机使用的是什么编解码器吗 我已经成功地启动了一个简单的Flex应用程序&运行到一个Red5示例服务器应用程序上,从中我可以看出,它所做的与您所做的几乎相同
如果您将“live”更改为“record”,您的服务器应用程序的streams目录中是否保存了任何内容?从您的配置/类中没有任何内容跳出,一切看起来都正常。您是否尝试过发布到其中一个演示以排除您的客户?是Lademo还是live?从您的配置/类中看不到任何东西,一切看起来都正常。您是否尝试过发布到其中一个演示以排除您的客户?拉德莫还是活着
org.red5.server.net.rtmp.RTMPHandler - Connecting to: [WebScope@68e0ada6 Depth = 1, Path = '/default', Name = 'application_name']
org.red5.server.net.rtmp.RTMPHandler - Remembering client buffer on stream: 0
org.red5.server.stream.ClientBroadcastStream - Provider connect
org.red5.server.stream.ClientBroadcastStream - Stream start
org.red5.server.stream.ClientBroadcastStream - Provider connect
org.red5.server.stream.ClientBroadcastStream - Close
org.red5.server.stream.ClientBroadcastStream - Provider disconnect
org.red5.server.stream.ClientBroadcastStream - Provider disconnect