Skip to content

Instantly share code, notes, and snippets.

@hellekin
Created October 15, 2009 23:21
Show Gist options
  • Save hellekin/211382 to your computer and use it in GitHub Desktop.
Save hellekin/211382 to your computer and use it in GitHub Desktop.
Easy OGG stream to shoutcast using Gstreamer
#!/bin/sh
#
# Easy OGG stream to shoutcast using Gstreamer
usage()
{
echo "$(basename $0) host[:port] password [mount]"
echo " Defaults: port 8000, mount $(hostname -s).ogg"
}
cmd="gst-launch-0.10"
if [ $# -lt 2 ]
then
usage
exit 1
fi
if [ $(expr index "$1" ':') -gt 0 ]
then
host="${1%:*}"
port="${1#*:}"
else
host="$1"
port="8000"
fi
pass="$2"
mount="${3-$(hostname -s)}"
mount="${mount%.*}.ogg"
echo "Streaming to $host:$port/$mount"
test -x $cmd || { echo "Command $cmd not found in PATH: Aborted."; exit 1; }
$cmd alsasrc ! queue ! audioconvert ! vorbisenc ! oggmux ! shout2send ip=$host port=$port password=$pass mount=$mount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment