Then, I created this bash script which extracts audio content from music videos.
#!/bin/bash
OUTPUT=""
if [ $# = 1 ] ; then
OUTPUT=${1%.*}.mp3
elif [ $# = 2 ] ; then
OUTPUT=${2}
else
echo "Usage:"
echo " ${0} video_filename output.mp3"
exit
fi
/usr/bin/ffmpeg -i "${1}" -vn -ar 44100 -ac 2 -ab 192 -f mp3 "${OUTPUT}"
OUTPUT=""
if [ $# = 1 ] ; then
OUTPUT=${1%.*}.mp3
elif [ $# = 2 ] ; then
OUTPUT=${2}
else
echo "Usage:"
echo " ${0} video_filename output.mp3"
exit
fi
/usr/bin/ffmpeg -i "${1}" -vn -ar 44100 -ac 2 -ab 192 -f mp3 "${OUTPUT}"
Cut and paste it into your preferred editor (VI). This link explains how to retrieve just the file name without its extension.
No comments:
Post a Comment