0

私の質問は、ライブ ビデオ ストリーミングを必要とする Web サイトを構築しています。red5 がインストールされた arvixe の VPS がありますが、rtmp で red5 に接続できません。これが私の側のコードエラーなのか、それともアクションスクリプトで接続するための適切な rtmp アドレスを見つけるのに助けが必要なのかを知る必要があります 3.

これまでの私のコードは次のとおりです。

import flash.media.Camera;
import flash.media.Video;
import flash.media.Microphone;
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.*;
import flash.display.MovieClip;
import flash.net.*;
import flash.text.*;


var nc:NetConnection = new NetConnection();
nc.connect("rtmp://198.58.95.110:1935/");
var ns:NetStream = new NetStream(nc);
var camera:Camera = Camera.getCamera();
var video:Video = new Video();
video.smoothing = true;
video.attachCamera(camera);
ns.attachCamera(camera);
ns.publish("cam1");
addChild(video);

次に、これを次のように変更しました。

import flash.media.Camera;
import flash.media.Video;
import flash.media.Microphone;
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.*;
import flash.display.MovieClip;
import flash.net.*;
import flash.text.*;


var nc:NetConnection = new NetConnection();
var ns:NetStream = new NetStream(nc);
var camera:Camera = Camera.getCamera();
var video:Video = new Video();
video.smoothing = true;
video.attachCamera(camera);
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nc.connect("rtmp://cam320.arvixevps.com:5080");

function netStatusHandler(event:NetStatusEvent):void {
 if (event.info.code == "NetConnection.Connect.Success") {
      ns.attachCamera(camera);
      ns.publish("livecam1");
 }
}

私が試した次のコード:

import flash.media.Camera;
import flash.media.Video;
import flash.media.Microphone;
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.*;
import flash.display.MovieClip;
import flash.net.*;
import flash.text.*;


var nc:NetConnection = new NetConnection();
nc.connect("rtmp://cam320.arvixevps.com/webapps/oflaDemo");
var ns:NetStream = new NetStream(nc);
var camera:Camera = Camera.getCamera();
var video:Video = new Video();
video.smoothing = true;
video.attachCamera(camera);
nc.addEventListener(NetStatusEvent.NET_STATUS, publish);
addChild(video);
function publish(event:NetStatusEvent):void {
if (event.info.code == "NetConnection.Connect.Success"){
ns.attachCamera(camera);
ns.publish("cam1");
}
}

red5.log ファイルは次のようになります。

2013-02-02 14:07:34,612 [main] INFO  org.red5.server.Launcher - Red5 Server 0.9.0 $Rev: 4030 $ (http://code.google.com/p/red5/)
2013-02-02 14:07:34,726 [main] INFO  o.s.c.s.FileSystemXmlApplicationContext - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@5ff06dc3: startup date [Sat Feb 02 14:07:34 PST 2013]; root of context hierarchy
2013-02-02 14:07:35,281 [main] INFO  o.s.b.f.c.PropertyPlaceholderConfigurer - Loading properties file from class path resource [red5.properties]
2013-02-02 14:07:35,293 [main] INFO  o.s.b.f.s.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@69d95da8: defining beans [placeholderConfig,red5.common,red5.core,context.loader,pluginLauncher,tomcat.server]; root of factory hierarchy
2013-02-02 14:07:35,326 [main] INFO  o.s.c.s.FileSystemXmlApplicationContext - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@7cf01771: startup date [Sat Feb 02 14:07:35 PST 2013]; root of context hierarchy
2013-02-02 14:07:35,546 [main] INFO  o.s.b.f.c.PropertyPlaceholderConfigurer - Loading properties file from class path resource [red5.properties]
2013-02-02 14:07:35,552 [main] INFO  o.s.b.f.s.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1118fa47: defining beans [placeholderConfig,red5.server,jmxFactory,jmxAgent,serializer,deserializer,statusObjectService,rtmpCodecFactory,rtmptCodecFactory,remotingCodecFactory,streamableFileFactory,filePersistenceThread,sharedObjectService,streamService,providerService,consumerService,bandwidthFilter,schedulingService,warDeployService,remotingClient,object.cache,keyframe.cache,flv.impl,flvreader.impl,mp4reader.impl,mp3reader.impl,org.springframework.beans.factory.config.MethodInvokingFactoryBean#0,org.springframework.beans.factory.config.MethodInvokingFactoryBean#1,streamExecutor,playlistSubscriberStream,clientBroadcastStream]; root of factory hierarchy
2013-02-02 14:07:35,717 [main] WARN  o.s.b.GenericTypeAwarePropertyDescriptor - Invalid JavaBean property 'enableRmiAdapter' being accessed! Ambiguous write methods found next to actually used [public void org.red5.server.jmx.JMXAgent.setEnableRmiAdapter(java.lang.String)]: [public void org.red5.server.jmx.JMXAgent.setEnableRmiAdapter(boolean)]
2013-02-02 14:07:35,717 [main] WARN  o.s.b.GenericTypeAwarePropertyDescriptor - Invalid JavaBean property 'enableSsl' being accessed! Ambiguous write methods found next to actually used [public void org.red5.server.jmx.JMXAgent.setEnableSsl(java.lang.String)]: [public void org.red5.server.jmx.JMXAgent.setEnableSsl(boolean)]
2013-02-02 14:07:35,717 [main] WARN  o.s.b.GenericTypeAwarePropertyDescriptor - Invalid JavaBean property 'enableMinaMonitor' being accessed! Ambiguous write methods found next to actually used [public void org.red5.server.jmx.JMXAgent.setEnableMinaMonitor(java.lang.String)]: [public void org.red5.server.jmx.JMXAgent.setEnableMinaMonitor(boolean)]
2013-02-02 14:07:36,400 [main] INFO  org.red5.server.service.WarDeployer - War deployer service created
2013-02-02 14:07:36,493 [main] INFO  o.s.c.s.FileSystemXmlApplicationContext - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@9c6a99d: startup date [Sat Feb 02 14:07:36 PST 2013]; parent: ApplicationContext 'red5.common'
2013-02-02 14:07:36,683 [main] INFO  o.s.b.f.c.PropertyPlaceholderConfigurer - Loading properties file from class path resource [red5.properties]
2013-02-02 14:07:36,691 [main] WARN  o.s.b.f.c.CustomEditorConfigurer - Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [java.net.SocketAddress; offending editor instance: org.apache.mina.integration.beans.InetSocketAddressEditor@77a9f87c
2013-02-02 14:07:36,695 [main] INFO  o.s.b.f.s.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7bbf68a9: defining beans [customEditorConfigurer,placeholderConfig,rtmpMinaConnManager,rtmpHandler,rtmpMinaIoHandler,rtmpTransport,rtmpMinaConnection,rtmptConnManager,rtmptHandler,rtmptServlet,rtmptConnection,rtmpsMinaIoHandler,rtmpsTransport]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1118fa47
2013-02-02 14:07:36,718 [main] INFO  o.r.s.net.rtmp.RTMPMinaTransport - RTMP Mina Transport bound to /0.0.0.0:1935
2013-02-02 14:07:36,719 [main] INFO  o.r.s.net.rtmp.RTMPMinaTransport - RTMP Mina Transport Settings
2013-02-02 14:07:36,719 [main] INFO  o.r.s.net.rtmp.RTMPMinaTransport - Connection Threads: 4
2013-02-02 14:07:36,719 [main] INFO  o.r.s.net.rtmp.RTMPMinaTransport - I/O Threads: 16
2013-02-02 14:07:36,785 [main] INFO  o.r.s.net.rtmp.RTMPMinaTransport - TCP No Delay: true
2013-02-02 14:07:36,785 [main] INFO  o.r.s.net.rtmp.RTMPMinaTransport - Receive Buffer Size: 65536
2013-02-02 14:07:36,785 [main] INFO  o.r.s.net.rtmp.RTMPMinaTransport - Send Buffer Size: 271360
2013-02-02 14:07:36,795 [main] INFO  o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7bbf68a9: defining beans [customEditorConfigurer,placeholderConfig,rtmpMinaConnManager,rtmpHandler,rtmpMinaIoHandler,rtmpTransport,rtmpMinaConnection,rtmptConnManager,rtmptHandler,rtmptServlet,rtmptConnection,rtmpsMinaIoHandler,rtmpsTransport]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1118fa47
2013-02-02 14:07:36,796 [main] INFO  o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@69d95da8: defining beans [placeholderConfig,red5.common,red5.core,context.loader,pluginLauncher,tomcat.server]; root of factory hierarchy
2013-02-02 14:07:36,796 [main] INFO  o.s.c.s.FileSystemXmlApplicationContext - Closing ApplicationContext 'red5.common': startup date [Sat Feb 02 14:07:35 PST 2013]; root of context hierarchy
2013-02-02 14:07:36,796 [main] INFO  o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1118fa47: defining beans [placeholderConfig,red5.server,jmxFactory,jmxAgent,serializer,deserializer,statusObjectService,rtmpCodecFactory,rtmptCodecFactory,remotingCodecFactory,streamableFileFactory,filePersistenceThread,sharedObjectService,streamService,providerService,consumerService,bandwidthFilter,schedulingService,warDeployService,remotingClient,object.cache,keyframe.cache,flv.impl,flvreader.impl,mp4reader.impl,mp3reader.impl,org.springframework.beans.factory.config.MethodInvokingFactoryBean#0,org.springframework.beans.factory.config.MethodInvokingFactoryBean#1,streamExecutor,playlistSubscriberStream,clientBroadcastStream]; root of factory hierarchy
2013-02-02 14:09:12,350 [NioProcessor-1] INFO  o.red5.server.net.rtmp.RTMPHandler - Connecting to: [WebScope@218c6982 Depth = 1, Path = '/default', Name = 'installer']
2013-02-02 14:09:39,316 [NioProcessor-1] INFO  o.red5.server.net.rtmp.RTMPHandler - Connecting to: [WebScope@218c6982 Depth = 1, Path = '/default', Name = 'installer']
2013-02-02 14:15:10,259 [NioProcessor-1] INFO  o.red5.server.net.rtmp.RTMPHandler - Connecting to: [WebScope@218c6982 Depth = 1, Path = '/default', Name = 'installer']
2013-02-02 14:34:34,089 [NioProcessor-1] INFO  o.red5.server.net.rtmp.RTMPHandler - Scope webapps/oflaDemo not found on cam320.arvixevps.com
2013-02-02 14:34:36,935 [Red5_Scheduler_Worker-11] WARN  o.r.server.net.rtmp.RTMPConnection - Closing RTMPMinaConnection from 184.63.74.33 : 11053 to cam320.arvixevps.com (in: 3433 out 3266 ), with id 415926013 due to long handshake
2013-02-02 14:34:55,728 [NioProcessor-1] INFO  o.red5.server.net.rtmp.RTMPHandler - Scope webapps/oflaDemo not found on cam320.arvixevps.com
2013-02-02 14:34:58,998 [Red5_Scheduler_Worker-12] WARN  o.r.server.net.rtmp.RTMPConnection - Closing RTMPMinaConnection from 184.63.74.33 : 11081 to cam320.arvixevps.com (in: 3433 out 3266 ), with id 814254349 due to long handshake
2013-02-02 15:59:32,847 [NioProcessor-1] INFO  o.red5.server.net.rtmp.RTMPHandler - Scope webapps/oflaDemo not found on cam320.arvixevps.com
2013-02-02 15:59:35,845 [Red5_Scheduler_Worker-10] WARN  o.r.server.net.rtmp.RTMPConnection - Closing RTMPMinaConnection from 184.63.74.33 : 13181 to cam320.arvixevps.com (in: 3433 out 3266 ), with id 2104928456 due to long handshake
2013-02-02 16:00:27,050 [NioProcessor-1] INFO  o.red5.server.net.rtmp.RTMPHandler - Scope webapps/oflaDemo not found on cam320.arvixevps.com
2013-02-02 16:00:30,974 [Red5_Scheduler_Worker-11] WARN  o.r.server.net.rtmp.RTMPConnection - Closing RTMPMinaConnection from 184.63.74.33 : 13226 to cam320.arvixevps.com (in: 3433 out 3266 ), with id 9885998 due to long handshake

それを機能させるにはまだ運がなく、アクションスクリプトにネット接続とネットストリームコードを追加する前にウェブカメラが表示されていた場所もわかりません。もちろん、私は数日間理解しようとしてきましたが、運がありません. 問題は nc.connect("rtmp://cam320.arvixevps.com:5080"); にあると思います。しかし、red5 のデフォルト rtmp の適切なアドレスがわからないので、ここに何を入力すればよいかわかりません。さらに、アクション スクリプトを長時間使用していないため、コードにエラーがあるかどうかもわかりません。残念ながら、このウェブサイトを構築する期限があり、時間が足りません。しかし、誰かが少なくとも私を正しい方向に向けたり、私がどこを間違えたかを教えてくれたりすることができれば、私はそれを修正してこのウェブサイトを完成させることができます. ああ、VPS は Linux centos 5 を実行しています。ここで誰かが私を助けてくれることを願っています。このred5 rtmp接続の問題は私を怒らせています。これを修正して、flex で webapp を作成せずに red5 に正しく接続する方法を知りたいだけです。Actionscript3 を使用して red5 に接続し、ライブ ビデオをストリーミングできれば、flex でアプリケーションを作成する必要はありません。ライブ Web カメラ ビデオをストリーミングするには、red5 とアクション スクリプト以外に何か必要ですか? cam320.arvixevps.com で見つからないスコープ weapps/oflaDemo とはどういう意味ですか?

4

1 に答える 1

0

red5はrtmpにポート1935を使用します。ポート5080はhttpアクセス用です(red5コントロールパネルとrtmpt)。

于 2013-02-02T20:35:02.710 に答える