StreamTranscoderV3 linux aac patch

I managed to get aac encoding working with StreamTranscoder V3 in Linux!

I tried to send this information directly to the developer but I didn't got an answer. Also I have problems to get an account for his forum, so I post my stuff here and hope that people find it.

_Installation Manual for aac support for StreamTranscoderV3_

For debian based distributions.

Add the following repository to your /etc/apt/sources.list file:

deb http://www.debian-multimedia.org stable main

Install all the necessary libraries and there HEADER files too:

apt-get install libogg0 libogg-dev libvorbis0a libvorbis-dev liblame0
liblame-dev libfaac0 libfaac-dev libfaad0 libfaad-dev libmad0 
libmad0-dev libflac8 libflac-dev automake libtool

Now we have to patch the StreamTranscoder configure.in file: the patch was produced with this command:

diff -u old/configure.in new/configure.in

Save the following patch to a file called “streamTranscoder-aac.patch”:

--- old/configure.in	2006-08-09 06:17:39.000000000 +0200
+++ new/configure.in	2009-10-24 19:26:40.000000000 +0200
@@ -5,9 +5,10 @@
 AM_INIT_AUTOMAKE

 AC_PROG_CC
-#AC_PROG_CXX
+AC_PROG_CXX
 AC_CANONICAL_HOST
 AM_PROG_LIBTOOL
+AC_PROG_RANLIB

 dnl Set some options based on environment
 
@@ -100,6 +101,7 @@
   FAAC_CFLAGS=""
 else
   FAAC_CFLAGS="-DHAVE_FAAC"
+  AC_DEFINE(HAVE_FAAC)
 fi

 CFLAGS="$OLDCFLAGS"

Extract the sources:

tar -xzf streamtranscoderv3-3.1.11.tar.gz

Change directory to the extracted streamTranscoder sources:

cd streamtranscoderv3-3.1.11

Apply the patch:

patch -p1 < ../streamTranscoder-aac.patch

Regenerate the build files:

aclocal -I m4/
autoconf
automake

Compile and install in the normal way:

./configure
make
make install

Change the encoder setting in your config file (in my case /etc/streamTranscoder/streamTranscoder_3.cfg): Encode=AAC

Restart streamtranscoderv3 and check the logfiles for errors.

Finished!

I post here also a nice init script written by me, changes the UID/GID and sets a the nice level to a higher priority than default: /etc/init.d/streamTranscoder restart

Here is my /etc/init.d/streamTranscoder

#! /bin/sh
#
# streamTranscoder
#
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#               Modified for Debian 
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
#               Further modified by Keegan Quinn <ice@thebasement.org>
#               for use with Icecast 2
#               
#               adopted to use with streamTranscoder v3 from oddsock
#               by christoph zimmermann <christoph@bigbeat.ch>
#
### BEGIN INIT INFO
# Provides:          streamTranscoder
# Required-Start:    $net $syslog
# Required-Stop:     $net $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starting StreamTranscoder
# Description:       StreamTranscoder is the swiss army knife of the
streaming server user. ### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/streamTranscoderv3
CONF=/etc/streamTranscoder
NAME=streamTranscoderv3
DESC=streamTranscoderv3

test -x $DAEMON || exit 0

# Defaults
USERID=transcoder
GROUPID=transcoder

#set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
                --background --chdir $CONF --nicelevel -3 --exec $DAEMON
        echo "$NAME."
        ;;
  stop)
      echo -n "Stopping $DESC: "
        start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
        echo "$NAME."
        ;;
  restart)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
                 --background --chdir $CONF --nicelevel -3 --exec
$DAEMON echo "$NAME."
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}" >&2
        exit 1
        ;;
esac

exit 0

Discussion

Rodrigo Moglia, 2012/07/16 06:56

Tried On Squeeze:

apt-get install libogg0 libogg-dev libvorbis0a libvorbis-dev libmp3lame0 libmp3lame-dev libfaac0 libfaac-dev libfaad2 libfaad-dev libmad0 libmad0-dev libflac8 libflac-dev automake libtool

Making all in liboddcast make[1]: Entering directory `/usr/src/streamtranscoderv3-3.1.11/liboddcast' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/usr/src/streamtranscoderv3-3.1.11/liboddcast' make[1]: Entering directory `/usr/src/streamtranscoderv3-3.1.11' /bin/bash ./libtool –tag=CXX –mode=link g++ -g -O2 -o streamTranscoderv3 streamTranscoderv3.o cbuffer.o sourcethread.o decodethread.o reconnectthread.o mp3decoder.o vorbisdecoder.o socket_client.o liboddcast/liboddcast.a -lpthread -logg -lvorbis -lmad -lmp3lame -lm -lvorbisenc -lvorbisfile -lfaac -lm -L -lFLAC -logg -lm make[1]: Leaving directory `/usr/src/streamtranscoderv3-3.1.11' ne 800: libtool: ignoring unknown tag : command not found ./libtool: line 767: X–mode=link: command not found ./libtool: line 917: * Warning: inferring the mode of operation is deprecated.: command not found ./libtool: line 918: * Future versions of Libtool will require –mode=MODE be specified.: command not found gcc: no input files gcc: no input files gcc: no input files gcc: no input files ./libtool: line 2115: X-g: command not found ./libtool: line 2115: X-O2: command not found ./libtool: line 1853: X-L: command not found ./libtool: line 2279: XstreamTranscoderv3: command not found ./libtool: line 2284: X: command not found ./libtool: line 2291: XstreamTranscoderv3: command not found ./libtool: line 2427: X-lpthread: command not found ./libtool: line 2427: X-logg: command not found ./libtool: line 2427: X-lvorbis: command not found ./libtool: line 2427: X-lmad: command not found ./libtool: line 2427: X-lmp3lame: command not found ./libtool: line 2427: X-lm: command not found ./libtool: line 2427: X-lvorbisenc: command not found ./libtool: line 2427: X-lvorbisfile: command not found ./libtool: line 2427: X-lfaac: command not found ./libtool: line 2427: X-lm: command not found ./libtool: line 2427: X-lFLAC: command not found ./libtool: line 2427: X-logg: command not found ./libtool: line 2427: X-lm: command not found ./libtool: line 2427: X-lpthread: command not found ./libtool: line 2427: X-lvorbis: command not found ./libtool: line 2427: X-lmad: command not found ./libtool: line 2427: X-lmp3lame: command not found ./libtool: line 2427: X-lvorbisenc: command not found ./libtool: line 2427: X-lvorbisfile: command not found ./libtool: line 2427: X-lfaac: command not found ./libtool: line 2509: X-L/usr/src/streamtranscoderv3-3.1.11: No such file or directory ./libtool: line 2427: X-lFLAC: command not found ./libtool: line 2427: X-logg: command not found ./libtool: line 2427: X-lm: command not found ./libtool: line 2427: X-lpthread: command not found ./libtool: line 2427: X-lvorbis: command not found ./libtool: line 2427: X-lmad: command not found ./libtool: line 2427: X-lmp3lame: command not found ./libtool: line 2427: X-lvorbisenc: command not found ./libtool: line 2427: X-lvorbisfile: command not found ./libtool: line 2427: X-lfaac: command not found ./libtool: line 2509: X-L/usr/src/streamtranscoderv3-3.1.11: No such file or directory ./libtool: line 2427: X-lFLAC: command not found ./libtool: line 2427: X-logg: command not found ./libtool: line 2427: X-lm: command not found ./libtool: line 4933: Xg++ ”” ”” -o @OUTPUT@ streamTranscoderv3.o cbuffer.o sourcethread.o decodethread.o reconnectthread.o mp3decoder.o vorbisdecoder.o socket_client.o liboddcast/liboddcast.a -lpthread -lvorbis -lmad -lmp3lame -lvorbisenc -lvorbisfile -lfaac -L/usr/src/streamtranscoderv3-3.1.11 -lFLAC -logg -lm: No such file or directory ./libtool: line 4934: Xg++ ”” ”” -o @OUTPUT@ streamTranscoderv3.o cbuffer.o sourcethread.o decodethread.o reconnectthread.o mp3decoder.o vorbisdecoder.o socket_client.o liboddcast/liboddcast.a -lpthread -lvorbis -lmad -lmp3lame -lvorbisenc -lvorbisfile -lfaac -L/usr/src/streamtranscoderv3-3.1.11 -lFLAC -logg -lm: No such file or directory ./libtool: line 4939: X: command not found ./libtool: line 4943: : command not found

Christoph Zimmermann, 2012/09/12 18:02

All the tools from Oddsock are not suported anymore. So it is better TO NOT USE THEM ANYMORE!

Have a look at liquidsoap: http://savonet.sourceforge.net/index.html

I use it since 2 years on our radio servers and it works very reliable now and it supports also AAC+

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International