1

So I recently installed a Red5 Docker image/container on my computer and trying to get the red5-hls-plugin built/compiled to add it to the plugins

I followed the instructions as instructed on https://github.com/Red5/red5-hls-plugin#tiagos-step-by-step-guide but all I get when running mvn -Dmaven.test.skip=true in the red5-hls-plugin/plugin/ directory is

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org:jaudiotagger

Reason: Error getting POM for 'org:jaudiotagger' from the repository: Unable to read local copy of metadata: Cannot read metadata from '/root/.m2/repository/org/jaudiotagger/2.0.4-SNAPSHOT/maven-metadata-sonatype-snapshots.xml': end tag name </body> must match start tag name <hr> from line 5 (position: TEXT seen ...</center>\r\n</body>... @6:8)
  org:jaudiotagger:pom:2.0.4-SNAPSHOT


 for project org:jaudiotagger

Additional Information

I don't know if your suppose to build the hls plugin to the version you have installed which I have 1.0.4 but when I edit the pom.xml file and change <red5-server.version>1.0.2-SNAPSHOT</red5-server.version> to <red5-server.version>1.0.4-RELEASE</red5-server.version> and add the following repositories:

<repository>
    <id>sonatype-releases</id>
    <url>https://oss.sonatype.org/content/repositories/releases</url>
</repository>
<repository>
    <id>sonatype-snapshots</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>

I get the following error now when trying to compile/build:

[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 26 source files to /src/red5-hls-plugin/plugin/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /src/red5-hls-plugin/plugin/src/main/java/org/red5/service/httpstream/model/VideoFrame.java:[25,35] error: package org.red5.server.stream.codec does not exist
[ERROR] /src/red5-hls-plugin/plugin/src/main/java/org/red5/service/httpstream/model/VideoFrame.java:[58,34] error: package VideoCodec does not exist
[ERROR] /src/red5-hls-plugin/plugin/src/main/java/org/red5/service/httpstream/model/VideoFrame.java:[60,41] error: package VideoCodec does not exist
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
Jeff Wilbert
  • 4,400
  • 1
  • 20
  • 35
  • The plugin hasn't been updated to work with the newer server jars, that's why you get the failure. – Paul Gregoire Jun 23 '15 at 15:13
  • @Mondain Do you know how to go about getting it to work, I saw in the google group someone with 1.5 that supposidly got the hls plugin working. I've managed to get the hls plugin compiled and to build somehow after trying a bunch of things changing versions, adding repos, disabling some repos, etc.. but now red5 crashes when I add the plugin. – Jeff Wilbert Jun 23 '15 at 19:16
  • This is the error I get after adding the compiled hls plugin to red5 now `[ERROR] [Launcher:/hlsapp] org.red5.server.scope.Scope - Could not start scope Scope [name=hlsapp, path=/default, type=APPLICATION, autoStart=true, creationTime=143506218 2052, depth=1, enabled=true, running=false] {} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'segmenter.service' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Inv ocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/xuggle/mediatool/ToolFactory ` – Jeff Wilbert Jun 23 '15 at 19:21
  • That error means that xuggler cant be located; make sure the xuggler jar is in red5/lib directory – Paul Gregoire Jun 24 '15 at 16:03
  • I've managed to get 1.0.5 running with the HLS plugin thanks to some help from someone on the google group. The only issue I'm running into now is I can't playback to work on my android device by using the m3u8 link for a livestream; all I get is a black screen. I have an AMS server setup and running and it works on my phone using the m3u8 link from AMS so I know my phone can playback streams through it. – Jeff Wilbert Jun 24 '15 at 20:19
  • As far as I recall, Android doesn't playback hls unless you use a nonstandard player. Ams probably looks at the user agent and switches support accordingly. – Paul Gregoire Jun 24 '15 at 21:59
  • android has hls support, i guess sometimes it can be finicky according to some articles online but i've never had any problems really with AMS, all I'm using to play my livestream on all platforms is a html5 video tag with 2 sources, the m3u8 source (for mobile) and the rtmp source (for desktop) and it works good across all platforms with ams but with red5 i can't get the m3u8 to work, just produces a black screen. I get constantly in the error log `org.red5.xuggler.writer.HLSStreamWriter - Video packet was not complete` while streaming, so maybe that has something to do with it.. – Jeff Wilbert Jun 25 '15 at 01:44
  • To @JeffWilbert : How did you succeed to make it work? – akatran Jun 26 '15 at 14:06
  • @akatran http://pastebin.com/tbkebUwB – Jeff Wilbert Jun 26 '15 at 18:06

1 Answers1

1

Just to answer this old question to preserve it in the Stack Overflow nature of things. I ended up fixing my build problem by pretty much using certain versions of build tools at that time that were older then the current versions; more specifically using gcc 3.6 or lower vs the 3.7+ that came with the linux distro at the time.

The instructions I received at the time of help was from a user in the red5 board, he told me how he got his to compile which I will share below that worked for me:

Instructions courtesy of Frans Gouverne off the google red5 group

Below are the steps I made to get it up and running with latest release RED5 1.0.5.
My server is running CentOS 6.6, 64-bits.
Not sure if it is all 100% accurate, but it will come close to it.

Hopefully it is of any help for you,

Regards Frans

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

Install compiler and other tools:
  yum install git -y
  yum install gcc make gcc-c++ -y
  yum install libtool -y
  yum install automake -y
  yum install autoconf -y
  yum install openssl openssl-devel -y
  yum install yasm nasm -y

Install JAVA:
  yum -y install java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64
  yum -y install java-1.8.0-openjdk-devel.x86_64
  export JAVA_HOME=/usr/lib/jvm/java

Install Maven:
  cd /tmp/
  wget  http://mirrors.supportex.net/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
  tar -xfz apache-maven-3.3.3-bin.tar.gz
  mv apache-maven-3.3.3/ /opt/maven
  ln -s /opt/maven/bin/mvn /usr/bin/mvn

Install Ant:
  cd /tmp/
  wget http://ftp.tudelft.nl/apache//ant/binaries/apache-ant-1.9.5-bin.tar.gz
  tar -xfz apache-ant-1.9.5-bin.tar.gz
  cp -r apache-ant-1.9.5 /usr/local/ant
  export ANT_HOME=/usr/local/ant
  export PATH=$PATH:/usr/local/ant/bin

Build RED5 1.0.5 from source:
  cd /tmp/
  wget https://github.com/Red5/red5-server/archive/v1.0.5-RELEASE.tar.gz
  tar -xfz v1.0.5-RELEASE.tar.gz
  cd red5-server-1.0.5-RELEASE
  mvn -Dmaven.test.skip=true install
  mvn -Dmaven.test.skip=true clean package -P assemble
  cp target/red5-server-1.0.5-RELEASE-server.tar.gz /usr/local/
  cd /usr/local/
  tar -xfz red5-server-1.0.5-RELEASE-server.tar.gz

Install xuggler:
  cd /tmp/
  git clone git://github.com/xuggle/xuggle-xuggler.git
  cd xuggle-xuggler
  ant  (or "ant install", not sure about that...)
  cp -r dist/lib/xuggle-xuggler-noarch.jar /usr/local/red5-server-1.0.5-RELEASE/plugins/
  cp -r dist/lib/xuggle-xuggler-arch-x86_64-unknown-linux-gnu.jar /usr/local/red5-server-1.0.5-RELEASE/plugins/

Build Red5 HLS plugin:
  cd /tmp/
  git clone https://github.com/mondain/red5-hls-plugin.git
  cd red5-hls-plugin/plugin/
  mvn -Dmaven.test.skip=true

  cp red5-hls-plugin/plugin/target/hls-plugin-1.1.jar red5-hls-plugin/example/lib/
  cd red5-hls-plugin/example/
  mvn eclipse:eclipse
  mvn -Dmaven.test.skip=true

  cp /tmp/red5-hls-plugin/example/target/hlsapp-1.1.war /usr/local/red5-server-1.0.5-RELEASE/webapps/
  cp /tmp/red5-hls-plugin/plugin/target/hls-plugin-1.1.jar  /usr/local/red5-server-1.0.5-RELEASE/plugins/

Finally restart red5 and add the segments directory!!
Jeff Wilbert
  • 4,400
  • 1
  • 20
  • 35