Red5 and Xuggler in JBoss AS7

JBoss AS 7 is an amazing fast OSGi & J2EE compliant Application Server.
Red5 is a great Spring Framework based Media Server.
Xuggler is a great real-time media stream modifier tool.

OFLA Demo Web App

Until very recently, putting these two different beasts working together was quite a difficult and painful task due to dependencies conflicts. The OSGi compliant release of JBoss (AKA JBoss AS 7) came to make all this much easier since now the JBoss AS dependencies are isolated from the actual web application ones.

Video demo:

 

For simplicity, I’ve put together a ready-to-deploy Enterprise Archive (ear) file containing all you need to start and that you can download and deploy in JBoss AS 7.

The package includes all of the following ready-to-use Red5 example demos:

– VOD – Initial Red5 video (e.g. localhost:8080/Red5)
– OFLA Demo – Publish and Subscribe to media streams
– FITC Demo – Video Conference
– Echo Test
– SOSample – Shared Object example app – in sample app point your URI to rtmp://localhost/red5/SOSample
– Publisher
– Simple Broadcaster
– Simple Subscriber
– Simple Recorder
– Audio Transcoder – Audio Xuggler demo
– Video Transcoder – Video Xuggler demo

To run the Transcoder demos you’ll need to install Xuggler in your system. Everything else you need is already packed in the ear. Here’s a good guide on how to run the Xuggler test by Antoni Jakubiak.
 


 

Deployment Steps

  • Download the Enterprise Archive (ear) from here.
  • Rename the downloaded file to red5.ear.7z and use 7Zip to extract it.
  • Deploy the exploded contents under your jboss-as-web-7.0.0.Final\standalone\deployments directory.
  • Start your JBoss AS 7 server: jboss-as-web-7.0.0.Final\bin\standalone.bat (.sh for Posix flavours).
  • Point your browser to localhost:8080/red5 if running locally.
  • Enjoy…

To add or change the deployment war just edit the red5.ear/META-INF/application.xml and un/comment the desired web archives to be deployed.

I’ve also put together an article at JBoss.org that explains the process of getting Red5 working under JBoss AS 7. Test procedures are included. You can find it here. In that same page you can also find a better formatted PDF of the same article that might be easier to follow.

Kudos to Scott Kroll for having figured out how to circumnavigate around some issues, specially for figuring out what to put on red5-context.jar.

Next step… Red5 as an OSGi bundle. Stay posted!

Advertisements

About CrazyPenguin

Software Engineer
This entry was posted in AS3 (ActionScript3), BlazeDS, Flex 3, Flex 4 (Spark), J2EE, JBoss, MXML, Red5, Xuggle. Bookmark the permalink.

4 Responses to Red5 and Xuggler in JBoss AS7

  1. Hi,

    My guide about Xuggle and Red5 is old and has to be updated to new products versions.

    Regards
    Antek

  2. guru says:

    Hi,
    I followed the steps that you have posted and i am able to see the Red5 Demo Apps on my Jboss AS 7. I have few questions.
    I want to configure RTMPT. Please tell me where should I configure the port details for RTMPT.
    Thanks for the wonderful article

    • CrazyPenguin says:

      Guru,

      Good catch! After looking at the Red5 source tree, it seems that the red5.properties file is missing. Please try the following and let me know the results since I do not have the time to test it myself at this stage.

      Create a red5.properties with the following details:

      # HTTP
      http.host=0.0.0.0
      http.port=8080
      # RTMP
      rtmp.host=0.0.0.0
      rtmp.port=1935
      rtmp.event_threads_core=16
      rtmp.event_threads_max=32
      # event threads queue: -1 unbounded, 0 direct (no queue), n bounded queue
      rtmp.event_threads_queue=-1 
      rtmp.event_threads_keepalive=60
      rtmp.send_buffer_size=271360
      rtmp.receive_buffer_size=65536
      rtmp.ping_interval=5000
      rtmp.max_inactivity=60000
      rtmp.tcp_nodelay=true
      # RTMPT
      rtmpt.host=0.0.0.0
      rtmpt.port=8080
      rtmpt.ping_interval=5000
      rtmpt.max_inactivity=60000
      # MRTMP
      mrtmp.host=0.0.0.0
      mrtmp.port=9035
      mrtmp.event_threads_core=16
      mrtmp.event_threads_max=32
      # event threads queue: -1 unbounded, 0 direct (no queue), n bounded queue
      mrtmp.event_threads_queue=-1 
      mrtmp.event_threads_keepalive=60
      mrtmp.send_buffer_size=271360
      mrtmp.receive_buffer_size=65536
      mrtmp.ping_interval=5000
      mrtmp.max_inactivity=60000
      # Debug proxy (needs to be activated in red5-core.xml)
      proxy.source_host=127.0.0.1
      proxy.source_port=1936
      proxy.destination_host=127.0.0.1
      proxy.destination_port=1935
      

      and check if it works under any of the following location (I think it only needs to be somewhere in the war classpath) try to place it under red5.ear/red5.war/WEB-INF or red5.ear/red5.war/WEB-INF/classes.

      If it does not work, then create this other red5.properties file:

      # Socket policy
      policy.host=0.0.0.0
      policy.port=843
      
      # HTTP
      http.host=0.0.0.0
      http.port=5080
      https.port=8443
      
      # RTMP
      rtmp.host=0.0.0.0
      rtmp.port=1935
      rtmp.io_threads=16
      rtmp.connect_threads=4
      rtmp.send_buffer_size=271360
      rtmp.receive_buffer_size=65536
      rtmp.ping_interval=1000
      rtmp.max_inactivity=60000
      rtmp.tcp_nodelay=true
      
      # RTMPS
      rtmps.host=0.0.0.0
      rtmps.port=8443
      rtmps.ping_interval=5000
      rtmps.max_inactivity=60000
      rtmps.max_keep_alive_requests=-1
      rtmps.max_threads=20
      rtmps.acceptor_thread_count=2
      rtmps.processor_cache=20
      # RTMPS Keystore Password
      rtmps.keystorepass=password
      
      # RTMPT
      rtmpt.host=0.0.0.0
      rtmpt.port=8088
      rtmpt.ping_interval=5000
      rtmpt.max_inactivity=60000
      rtmpt.max_keep_alive_requests=-1
      rtmpt.max_threads=20
      rtmpt.acceptor_thread_count=2
      rtmpt.processor_cache=20
      
      # MRTMP
      mrtmp.host=0.0.0.0
      mrtmp.server=localhost
      mrtmp.port=9035
      mrtmp.event_threads_core=4
      mrtmp.event_threads_max=32
      # event threads queue: -1 unbounded, 0 direct (no queue), n bounded queue
      mrtmp.event_threads_queue=0
      mrtmp.event_threads_keepalive=60
      mrtmp.send_buffer_size=271360
      mrtmp.receive_buffer_size=65536
      mrtmp.ping_interval=5000
      mrtmp.max_inactivity=60000
      mrtmp.tcp_nodelay=true
      
      # Debug proxy (needs to be activated in red5-core.xml)
      proxy.source_host=127.0.0.1
      proxy.source_port=1936
      proxy.destination_host=127.0.0.1
      proxy.destination_port=1935
      
      # JMX
      jmx.rmi.port.registry=9999
      jmx.rmi.port.remoteobjects=
      jmx.rmi.host=0.0.0.0
      jmx.rmi.ssl=false
      
      

      This one is very similar to the one above and to be honest I did not check the differences – this is all coming straight from the Red5 source repository. Place it in a “red5.jar:/conf” directory. For this, you will have to expand the red5.jar in red5.ear/lib, create a conf directory at the root, move the above red5.properties into it and repackage it again into red5.jar. Once ready, just replace the new jar with the old one in the red5.ear/lib directory.

      Let me know how it goes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s