Home > Java > Maven2 + Red5 + Xuggle

Maven2 + Red5 + Xuggle

 

This time I would like to invite you to my project jakubiak-red5, the purpose of which is the combination of the following technologies : Red5, Xuggle and Maven2. Xuggle is a tool for the conversion of video images in real-time. Red5 is a server of multimedia applications. Maven2 is the most efficient tool for organizing the process of building applications. My goal is to combine them all together.

 

My project is ,in fact it is a building script. It is supposed to be an instruction for Maven2 on how to build server Red5 and a (Java) part of Xuggle library. Let’s have a look on how it works. In SVN repository there is a structure of the Maven project, along with the files pom.xml. The source code of Red5 and Xuggle libraries does not change because it is connected to the source code of the original projects using svn:externals. All you need to do in order to build a project is to write mvn clean install. I assume that each Java programmer is already a fan of Maven or will become such in a future, so there is no need to dwell on it any more.

The results of work are the dependencies that can be used in a new project – a new Red5 based application (or Red5 and Xuggle based).

Welcome to a battle-field!

What we need is Xuggle. The installation of Xuggle Instalacja Xuggle jest prosta seems to be suprisingly simple, compared to the capability of this library (at least for Windows) Setup.exe.

The next installation is Red5. I recommend you to try wersje 0.8RC2 version. Again, follow the procedure setup.exe. For Windows you will need a 32-bit Java.

One more thing – a binary Maven2. Download, unzip and try out.

Finally, you need to download the sources of my project:

svn checkout http://jakubiak-red5.googlecode.com/svn/trunk/ jakubiak-red5-read-only

 

This command is supposed to download the sources of my project as well as the sources of Red5 server, and partly the sources of Xuggle project. Now it’s time for a testing compilation:

cd jakubiak-red5-pom/
mvn clean install
cd ../jakubiak-xuggle-pom/
mvn clean install

 

Yet, before we can finally see this long expected message, we need to use the Internet to download a few dependencies which, for a couple of reasons, might not be found in depositories and they are not downloaded automatically.

It’s a testing time now. You need to publish on the Red5 server the examples build by my script ; in other words, just copy the directories:

cp -r jakubiak-red5-oflaDemo/target/jakubiak-red5-oflaDemo-0.8-SNAPSHOT/ ../../Program Files (x86)/Red5/webapps/
cp -r jakubiak-xuggle-xuggler-red5-videotranscoder/target/jakubiak-xuggle-xuggler-red5-videotranscoder-1.0-SNAPSHOT/ ../../Program Files (x86)/Red5/webapps/
net start Red5

 

Once we start up the internet browser, we can try out a few examples:

If we want to see Xuggle “in action”, we need to connect to the application videotranscoder: rtmp://localhost/videotranscoder using the Publisher program. The name of the stream should be preceded by a prefix “xuggle_“.

My library Jakubiak-red5 to some extend replaces the usual building process. Red5 and Xuggle are built by means of Apache Ant and Ivy (I am genuinely thrilled hearing these names). I, on the other hand, prefer building them using Maven2. It is quite a complex and time-consuming process, yet it is definitely worth the shot, because it enables me to create applications combining lots of fascinating technologies, for example: JPA, Spring. I can also create the WAR application including Red5 and Xuggle, which will then be started up on Apache Tomcat 6. Moreover, I can enjoy working with Eclipse IDE. To sum up, it offers lots of opportunities.

However, the most significant fact is that my library does not modify the sources of Xuggle and Red5 projects.

One of the alternatives to my building script would be to add the libraries of JAR, Red5 and Xuggle straight to the Maven repository. But, this method will not be sufficient in building WAR version of Red5 application. WAR version is extremely useful, but I will return to this issue next time.

Categories: Java Tags: , , ,
  1. March 21st, 2009 at 13:37 | #1

    great effort, and definitely needed, especially to have a proper modularization in separated jars of the red5 project, I just miss a remoting only jar and a perfect thing would be to also reproduce the release tags, like te current 0.8.RC2 – there are a few typos in trunk poms, where can I submit correction or file issues, on the google code proj?

  2. March 21st, 2009 at 13:56 | #2

    Thank you for your interest. I agree with you. I also thought about modules. It is especially important to make separate modules for scripting languages – particularly for Groovy. I add some improvement of red5 (or bugfixes) to http://code.google.com/p/jakubiak-red5/source/browse/#svn/trunk/jakubiak-red5-patches. If you are interested, you can join the project on google code.

  3. kocka
    June 5th, 2009 at 21:09 | #3

    This is a cool project! Thank you for your work, Antoni!

  4. July 9th, 2009 at 08:54 | #4

    I made some updates today. For me works fine: Red5-0.8.0, Xuggle-3.660, Tomcat-6.0.18

    Get stable branches from SVN:

    http://jakubiak-red5.googlecode.com/svn/branches/0.8.0/
    http://jakubiak-red5.googlecode.com/svn/branches/xuggle-3.660-red5-0.8.0/

    mvn clean install

    Install Xuggle-3.660.

    Deploy: jakubiak-xuggle-xuggler-red5-videotranscoder on Tomcat 6.0.18

  5. December 7th, 2009 at 07:56 | #5

    Thanks for taking the time to make this project! It greatly simplifies red5 development to have a maven artifact to point to.

    I found that red5-core on trunk doesn’t compile anymore, though–you need to add a tomcat dependency.

    I also added the maven-source-plugin to the parent POM, because digging through the red5 code can be a necessity when the javadocs are missing or wrong.

    Here’s the svn diff for these two changes:

    $ svn diff
    Index: jakubiak-red5-core/pom.xml
    ===================================================================
    — jakubiak-red5-core/pom.xml (revision 418)
    +++ jakubiak-red5-core/pom.xml (working copy)
    @@ -282,6 +282,13 @@
    6.1.9
    compile

    +
    +
    + org.apache.tomcat
    + coyote
    + 6.0.20
    +
    +

    org.apache.tomcat
    catalina
    Index: jakubiak-red5-pom/pom.xml
    ===================================================================
    — jakubiak-red5-pom/pom.xml (revision 418)
    +++ jakubiak-red5-pom/pom.xml (working copy)
    @@ -28,6 +28,20 @@
    UTF-8

    +
    + org.apache.maven.plugins
    + maven-source-plugin
    + 2.1.1
    +
    +
    + attach-sources
    + verify
    +
    + jar-no-fork
    +
    +
    +
    +

  6. James
    August 12th, 2010 at 11:06 | #6

    Hi

    I checked out the project and everything compiled fine – very neat.

    When it came to deploying a war file (e.g. jakubiak-red5-demo-war.war) to tomcat, it appears that the red5.jar is missing – in the localhost.log I get this error:

    SEVERE: Error configuring application listener of class org.red5.server.war.WarL
    oaderServlet
    java.lang.ClassNotFoundException: org.red5.server.war.WarLoaderServlet

    I imagine that this is because there is no red5.jar in the war file – what is involved in deploying a red5 war file to tomcat?

    I noticed that red5 version 0.9.1 does not have a war distribution.

    James

  1. No trackbacks yet.