#!/bin/sh # # realprod-initd broadcast to realserver at groovefactory # # chkconfig: 345 97 24 # description: broadcast to realserver at groovefactory # # written by jwz, 3-Jul-2000 # # Note that this script must run later than "liveaudio", since realprod # depends on "asd" having been launched already. # Source function library. . /etc/rc.d/init.d/functions dir=/home/jwz/src/realproducer homedir=/home/realprod run_as=realprod devices="/dev/video* /dev/audio* /dev/dsp* /dev/mixer*" PATH=/sbin:$PATH PATH=/usr/local/bin:$PATH PATH=$dir:$PATH export PATH user=dnalounge pass=`cat $dir/.password` #host=bigstream.groovefactory.com #host=sfr1.streams.groovefactory.com host=svr1.streams.groovefactory.com port=4040 path=groovefactory/dnalounge/live.rm # testing #host=cerebrum.dnalounge.com #user=x #pass=x #path=live.rm audio=1 video=1 # "realproducer --help" says 2:1 means "Line In" #audiodev="2:1" # jwz, 5-Aug-2005: on FC4, this is the device it wants: #audiodev="3:1" # jwz: 12-May-2006: added the second video card, so numbers changed: audiodev="4:1" # "realprod --help" says 0 means "WAV file" #audiodev="0" #audiofile="-i /tmp/realprod-wavpipe.wav" # RH 6.0 needed this: videodev="8:0" # after upgrade to 6.2.4, we need this: # "realprod --help" says 4:0 means "Television" #videodev="4:0" # okay, after getting sound to work, suddenly these are 6:x --fgmr, 2001-07-10 #videodev="6:0" # jwz, 5-Aug-2005: on FC4 with no sound, this is the device it wants: #videodev="2:1" # jwz: 12-May-2006: added the second video card, so numbers changed: videodev="2:1" # Target Audience: # 0: 28K; 1: 56K; 2: ISDN; 3: 2-ISDN; # 4: DSL; 5: LAN; 6: 256K; 7: 384K; 8: 512K # overridden by the "-m" file: #audience="0,1,2,5" # Audio Format: # 0: Voice Only; 1: Voice with Background Music; # 2: Music; 3: Stereo Music # # overridden by the "-m" file: #audiofmt="1" # Video Format: # 0: Normal Motion Video; 1: Smoothest Motion Video # 2: Sharpest Image Video; 3: Slide Show # videoq=0 # Audio Codec IDs: # sipr0 6.5 Kbps Voice # sipr1 8.5 Kbps Voice # sipr2 5 Kbps Voice # sipr3 16 Kbps Voice # cook7 32 Kbps Voice # cook14 64 Kbps Voice # cook8 6 Kbps Music # cook0 8 Kbps Music # cook1 11 Kbps Music # cook2 16 Kbps Music # cook3 20 Kbps Music # cook15 20 Kbps Music, High Response # cook4 32 Kbps Music # this file (-m) overrides -t ($audience) and -a ($audiofmt) conf_file="$dir/realprod.conf" # 5: rp 5+; 6: rp G2 playvers=6 # 0: UDP; 1: TCP serverconn=1 # FileType: 0 - Single Rate, 1 - SureStream filetype=1 # Emphasize Audio/Video 0-1 - SureStream encoding only ( 0 ) emphasize=1 allow_rec=0 allow_download=0 # to allow RealPlayer 7 to work: #vcodec="RV201" # overridden by the "-m" file: #vcodec="RV300" title="DNA Lounge Live Webcast" author="http://www.dnalounge.com/" copyright="DNA Lounge, 375 Eleventh Street, San Francisco" #description="DNA Lounge nightclub in San Francisco: streaming live, 24/7!" geom="320,240" #LD_PRELOAD='/usr/local/lib/libasddsp.so /usr/lib/libglib.so' #export LD_PRELOAD # See how we were called. case "$1" in start) /sbin/modprobe bttv if [ `whoami` != "$run_as" ]; then echo "$0: running as `whoami`; switching to user $run_as..." sleep 1 #set -x chown $run_as.$run_as $devices exec su "$run_as" -s /bin/sh -c "$0 $@" fi if [ "$pass" = "" ]; then echo "$0: unable to read realprod password file?" >&2 exit 1 fi cd $homedir echo -n "Starting realproducer for $host..." #-vc "$vcodec" \ # -t "$audience" \ # -a "$audiofmt" \ realproducer -vx "$geom" -sc "$serverconn" \ -w "$emphasize" \ -r "$allow_rec" -k "$allow_download" \ -l "$audiodev","$videodev" \ -y "$audio" -z "$video" -s "$host:$port/$path" \ -u "$user" -p "$pass" \ -v "$videoq" -g "$playvers" \ -f "$filetype" \ -m "$conf_file" \ -h "$author" -b "$title" -c "$copyright" & # -q "$description" echo "done." ;; stop) echo -n "Stopping realproducer..." # killall realproducer RealProducer rprod_helper killall realproducer echo "done." ;; restart) $0 stop sleep 6 $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac