Red5 installation guide (RTMP & RTMPT)

Introduction:

Red5 is an Open Source Flash Server written in Java that supports:

  • Streaming Video (FLV, F4V, MP4, 3GP)
  • Streaming Audio (MP3, F4A, M4A, AAC)
  • Recording Client Streams (FLV and AVC+AAC in FLV container)
  • Shared Objects
  • Live Stream Publishing
  • Remoting
  • Protocols: RTMP, RTMPT, RTMPS, and RTMPE

 

Media server setup steps:

1.       Download red5 from: http://code.google.com/p/red5/

2.       Download JDK from:  http://www.oracle.com/technetwork/java/javase/downloads/index.html

3.       Install JDK and deploy the “JAVA_HOME” environment variable.

Add

=====================================================================

CLASSPATH:

.;%%JAVA_HOME%\bin;JAVA_HOME%\bin\dt.jar;%JAVA_HOME%\bin\tools.jar

JAVA_HOME:

C:\Program Files (x86)\Java\jdk1.6.0_10-Your JAVA installation path.

======================================================================

Edit

PATH:

Add “%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;” at the beginning.

======================================================================

4.       Install Red5 and set ports for HTTP,RTMP and RTMPT

 

5.       Start red5

6.       Testing
Copy one testing file to “webapps\oflaDemo\streams”, Open testing page: http://localhost:5080/.




7.       Click [HERE]in testing page, and select [oflaDemo]

test the media file you added just now, make sure the file can be played normally.


8.        Copy your media files to oflaDemo\streams folder. And you can access these media files by: rtmp://localhost/oflaDemo/XXX.flv.

9.       How to support RTMPT prococal:

 

RTMP is default protocol in red5it’s opened by default, but rtmp has limited in some network environment.

Connect Method: nc.connect( "rtmp://x.x.x.x:port/myapp");

 

RTMPT protocol is wrap the RTMP HTTP protocolCan penetrate the firewall.

Connect Method : nc.connect( "rtmpt://x.x.x.x:port/myapp");

 

RTMPS agreement using HTTPS security connection

Connect Method : nc.connect( "rtmps://x.x.x.x:port/myapp");

 

Below is the way to open rtmpt:

 

In “conf/red5-core.xml”,delete comments of bean on the description of rtmpt.server.

 

Before Update

<!-- RTMPT -->

<!--

    <bean id="rtmpt.server" class="org.red5.server.tomcat.rtmpt.RTMPTLoader" init-method="init" lazy-init="true">

   

       <property name="webappFolder" value="${red5.root}/webapps" />

      

       <property name="connector">

           <bean class="org.apache.catalina.connector.Connector">

              <constructor-arg type="java.lang.String" value="org.apache.coyote.http11.Http11NioProtocol" />  

              <property name="port"><value>${rtmpt.port}</value></property>

              <property name="enableLookups"><value>false</value></property>

           </bean>

       </property>

 

 

       <property name="connectionProperties">

           <map>

              <entry key="maxKeepAliveRequests" value="${rtmpt.max_keep_alive_requests}"/>

              <entry key="useExecutor" value="true"/>

              <entry key="maxThreads" value="${rtmpt.max_threads}"/>

              <entry key="acceptorThreadCount" value="${rtmpt.acceptor_thread_count}"/>

              <entry key="processorCache" value="${rtmpt.processor_cache}"/>

           </map>

       </property>

      

       <property name="host">

           <bean class="org.apache.catalina.core.StandardHost">

              <property name="name" value="${rtmpt.host}" />

              <property name="unpackWARs" value="false" />

              <property name="autoDeploy" value="false" />

              <property name="xmlValidation" value="false" />

              <property name="xmlNamespaceAware" value="false" />

           </bean>      

       </property>      

 

 

    </bean>

-->

 

 

After Update:

 

 

 

<!-- RTMPT -->

 

 

    <bean id="rtmpt.server" class="org.red5.server.tomcat.rtmpt.RTMPTLoader" init-method="init" lazy-init="true">

 

   

       <property name="webappFolder" value="${red5.root}/webapps" />

 

      

       <property name="connector">

 

           <bean class="org.apache.catalina.connector.Connector">

 

              <constructor-arg type="java.lang.String" value="org.apache.coyote.http11.Http11NioProtocol" />  

 

              <property name="port"><value>${rtmpt.port}</value></property>

 

              <property name="enableLookups"><value>false</value></property>

 

           </bean>

       </property>

 

 

       <property name="connectionProperties">

 

           <map>

              <entry key="maxKeepAliveRequests" value="${rtmpt.max_keep_alive_requests}"/>

 

              <entry key="useExecutor" value="true"/>

 

               <entry key="maxThreads" value="${rtmpt.max_threads}"/>

 

              <entry key="acceptorThreadCount" value="${rtmpt.acceptor_thread_count}"/>

 

              <entry key="processorCache" value="${rtmpt.processor_cache}"/>

 

           </map>

       </property>

      

       <property name="host">

 

           <bean class="org.apache.catalina.core.StandardHost">

 

              <property name="name" value="${rtmpt.host}" />

 

              <property name="unpackWARs" value="false" />

 

              <property name="autoDeploy" value="false" />

 

              <property name="xmlValidation" value="false" />

 

              <property name="xmlNamespaceAware" value="false" />

 

           </bean>      

       </property>      

     </bean>

 

So you can access the media files by RTMPT protocol:

rtmpt://Localhost:8088/oflaDemo/XXX.flv

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值