# StreamTranscoder

I have installed streamTranscoderv3 in Arch Linux and I made an init script based on other scripts

it requires that there is a user transcoder with a valid shell set in /etc/passwd, and read permission in /etc/streamTranscoder where the config files must be located

    #!/bin/bash

    . /etc/rc.conf
    . /etc/rc.d/functions

    PID=`pidof -o %PPID /usr/bin/streamTranscoderv3`
    case "$1" in
      start)
        stat_busy "Starting StreamTranscoder Daemon"
        [ -z "$PID" ] && su -l transcoder -c 'cd /etc/streamTranscoder; /usr/bin/streamTranscoderv3 -b' > /dev/null
        if [ $? -gt 0 ]; then
          stat_fail
        else
          echo $PID > /var/run/streamTranscoder.pid
          add_daemon streamTranscoder
          stat_done
        fi
        ;;
      stop)
        stat_busy "Stopping StreamTranscoder Daemon"
        [ ! -z "$PID" ]  && kill $PID &> /dev/null
        if [ $? -gt 0 ]; then
          stat_fail
        else
          rm /var/run/streamTranscoder.pid
          rm_daemon streamTranscoder
          stat_done
        fi
        ;;
      restart)
        $0 stop
        sleep 1
        $0 start
        ;;
      *)
        echo "usage: $0 {start|stop|restart}"
    esac
    exit 0

Category:

- Audio/Video