#!/bin/sh
if [ $# -lt 1 ] ; then
    echo "Usage: `basename $0` <videofile>"
    exit
fi

set -x

outname=`echo $1 | sed -e 's/\.[^.]\{3,4\}$/.mp3/'`
# pacpl sometimes creates quite large output files
#pacpl --to mp3 "$1" 
#if [ ! -e "$outname" ] ; then
    outname=`echo $outname | sed -e 's/ /_/g'`
    echo $outname
    ffmpeg -i "$1" -vn -ab 128k -ar 44100 -y "$outname"
#else
#    outnamenospace=`echo $outname | sed -e 's/ /_/g'`
#    mv "$outname" "$outnamenospace"
#fi
