Hallo,
ich habe mir nachfolgendes Skript aus dem Forum kopiert, doch bei der Ausführung kommen Fehlermeldungen:
#!/bin/bash
#
# wmv to mp3 (was: wma to mp3)
# a script that MAYBE extracts all audio data from
# wmv files and converts them to mp3, lol
function wmv2mp3 () {
if [ ! -f "$1" ]; then
echo "File $1 not found!"
else
wav=`ls "$1" | sed -e 's/.wmv/.wav/' | tr -d "*"`
mplayer -ao pcm "${1%%.[Ww][Mm][Vv]}.wav" "$1" &&
mv audiodump.wav "$wav" && unset wav &&
lame -h -b 192 "${1%%.[Ww][Mm][Vv]}.wav" "${1%%.[Ww][Mm][Vv]}.mp3" &&
rm -f "${1%%.[Ww][Mm][Vv]}.wav" ||
echo "There was a problem with the conversion process!"
fi
}
# convert all wmv files in directory
if [ $# -eq 1 -a -d "$1" ]; then
for file in $1/*.[Ww][Mm][Vv]; do
wmv2mp3 "$file"
done
exit
fi
# One or more wmv files were given
for file in $*; do
wmv2mp3 "$file"
done
# Not enough information
if [ $# -lt 1 ]; then
echo
echo "Usage: wmv2mp3 myfile.wmv"
echo " wmv2mp3 /directory/containing/wmv/files"
echo " wmv2mp3 myfile.wmv myfile2.wmv myfile3.wmv"
# You have to use quotations for the arguement below.
# Failure to do so will result in only one file being
# converted. Namely, the first one it comes across...
echo ' wmv2mp3 "*.wmv"'
echo
echo "For converting .wmv's that have spaces in the"
echo 'name, use the directory option OR "*.wmv"'
echo
exit
fi
exit
Die Fehlermeldungen sind:
./WMA2MP3: line 16: mplayer: command not found
There was a problem with the conversion process!
Dann würde mich noch interessieren, ob man auch Ordnerinhalte rekursiv umwandeln kann?
Danke für Eure Hilfe.
Michael
ich habe mir nachfolgendes Skript aus dem Forum kopiert, doch bei der Ausführung kommen Fehlermeldungen:
#!/bin/bash
#
# wmv to mp3 (was: wma to mp3)
# a script that MAYBE extracts all audio data from
# wmv files and converts them to mp3, lol
function wmv2mp3 () {
if [ ! -f "$1" ]; then
echo "File $1 not found!"
else
wav=`ls "$1" | sed -e 's/.wmv/.wav/' | tr -d "*"`
mplayer -ao pcm "${1%%.[Ww][Mm][Vv]}.wav" "$1" &&
mv audiodump.wav "$wav" && unset wav &&
lame -h -b 192 "${1%%.[Ww][Mm][Vv]}.wav" "${1%%.[Ww][Mm][Vv]}.mp3" &&
rm -f "${1%%.[Ww][Mm][Vv]}.wav" ||
echo "There was a problem with the conversion process!"
fi
}
# convert all wmv files in directory
if [ $# -eq 1 -a -d "$1" ]; then
for file in $1/*.[Ww][Mm][Vv]; do
wmv2mp3 "$file"
done
exit
fi
# One or more wmv files were given
for file in $*; do
wmv2mp3 "$file"
done
# Not enough information
if [ $# -lt 1 ]; then
echo
echo "Usage: wmv2mp3 myfile.wmv"
echo " wmv2mp3 /directory/containing/wmv/files"
echo " wmv2mp3 myfile.wmv myfile2.wmv myfile3.wmv"
# You have to use quotations for the arguement below.
# Failure to do so will result in only one file being
# converted. Namely, the first one it comes across...
echo ' wmv2mp3 "*.wmv"'
echo
echo "For converting .wmv's that have spaces in the"
echo 'name, use the directory option OR "*.wmv"'
echo
exit
fi
exit
Die Fehlermeldungen sind:
./WMA2MP3: line 16: mplayer: command not found
There was a problem with the conversion process!
Dann würde mich noch interessieren, ob man auch Ordnerinhalte rekursiv umwandeln kann?
Danke für Eure Hilfe.
Michael