diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-14 13:06:42 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-02-14 13:06:42 +0100 |
commit | c520edc59f12eea97f2213326d43cbe6ca09f169 (patch) | |
tree | d72c39e50edba6ac348462b82952b9341c57d4cf | |
parent | e998a68308e5cde70bbd156107ae692f26753946 (diff) | |
download | mmbtools-aux-c520edc59f12eea97f2213326d43cbe6ca09f169.tar.gz mmbtools-aux-c520edc59f12eea97f2213326d43cbe6ca09f169.tar.bz2 mmbtools-aux-c520edc59f12eea97f2213326d43cbe6ca09f169.zip |
encoding scripts improvements
-rwxr-xr-x | encode-fbplus.sh | 18 | ||||
-rwxr-xr-x | encode-url-gst-dabplus.sh | 6 |
2 files changed, 17 insertions, 7 deletions
diff --git a/encode-fbplus.sh b/encode-fbplus.sh index e8cfaf8..e83f7f1 100755 --- a/encode-fbplus.sh +++ b/encode-fbplus.sh @@ -3,9 +3,17 @@ # Encode Frequence Banane to ZMQ tcp://*:2720 # -WITH_GSTREAMER=1 +WITH_GSTREAMER=0 URL=http://fbpc5.epfl.ch:8000/fb_192 -BITRATE=64 +BITRATE=$1 +DSTPORT=$2 + +if [ "$DSTPORT" == "" ] +then + echo "Usage:" + echo " $0 <bitrate> <zmq destination>" + exit 1 +fi if [ "$WITH_GSTREAMER" == "1" ] then @@ -16,9 +24,11 @@ then audioconvert ! \ audio/x-raw-int, 'rate=48000,format=S16LE,channels=2' ! \ filesink location="/dev/stdout" | \ - ../fdk-aac-dabplus/aac-enc-dabplus-zmq -i /dev/stdin -b $BITRATE -f raw -a -o 'tcp://*:2720' + ../fdk-aac-dabplus/aac-enc-dabplus-zmq -i /dev/stdin \ + -b $BITRATE -f raw -a -o $DSTPORT else mpg123 -s $URL |\ sox -t raw -r 44100 -e signed -b 16 -c 2 - -t raw - rate 48k |\ - ../fdk-aac-dabplus/aac-enc-dabplus-zmq -i /dev/stdin -b $BITRATE -f raw -a -o 'tcp://*:2720' + ../fdk-aac-dabplus/aac-enc-dabplus-zmq -i /dev/stdin \ + -b $BITRATE -f raw -a -o $DSTPORT fi diff --git a/encode-url-gst-dabplus.sh b/encode-url-gst-dabplus.sh index bbe3d59..da16851 100755 --- a/encode-url-gst-dabplus.sh +++ b/encode-url-gst-dabplus.sh @@ -12,7 +12,7 @@ GSTREAMER_VERSION="1" if [ "$DSTPORT" == "" ] then echo "Usage:" - echo " $0 <url> <bitrate> <zmq destination port>" + echo " $0 <url> <bitrate> <zmq destination>" exit 1 fi @@ -27,7 +27,7 @@ then audio/x-raw, 'rate=48000,format=S16LE,channels=2' ! \ filesink location="/dev/stdout" | \ ../fdk-aac-dabplus/aac-enc-dabplus-zmq \ - -i /dev/stdin -b $BITRATE -f raw -a -o "tcp://*:${DSTPORT}" + -i /dev/stdin -b $BITRATE -f raw -a -o "${DSTPORT}" elif [ "$GSTREAMER_VERSION" == "0" ] then @@ -39,6 +39,6 @@ then audio/x-raw-int, 'rate=48000,format=S16LE,channels=2' ! \ filesink location="/dev/stdout" | \ ../fdk-aac-dabplus/aac-enc-dabplus-zmq \ - -i /dev/stdin -b $BITRATE -f raw -a -o "tcp://*:${DSTPORT}" + -i /dev/stdin -b $BITRATE -f raw -a -o "${DSTPORT}" fi |