mp3 Convertieren.
Hallo,
Ich habe mir ein Script geschieben mit den ich MP3's Convertiere (Ändern
der Sample-Rate wegen ein HW-MP3-Player).
Das Wandeln klappt auch so. Nur habe ich ein Problem die Dateien mit
ID3-Tags zu versehen.
Die Ursprungsdateien haben Tags, die ich unverändert in die Zieldatei
übernehmen will.
Hier der Script:
#!/bin/sh
myid3()
{
echo "id3 "
id3 -lR "$1"|while read a; do
b=`echo $a|cut -d ' ' -f 1`
c=`echo $a|cut -d ' ' -f 2-`
if [ "$b" == "$c" ]; then
c="";
fi
case "$b" in
"Filename:"|"")
;;
"Title:")
echo -n "-t \"$c\" ";;
"Artist:")
echo -n "-a \"$c\" ";;
"Album:")
echo -n "-A \"$c\" ";;
"Year:")
echo -n "-y \"$c\" ";;
"Genre:")
gen=`echo $c|cut -d '(' -f 2`
gen=`echo $gen|sed -e 's/)//'`
echo -n "-g $gen ";;
"Track:")
echo -n "-T $c ";;
"Comment:")
echo -n "-c \"$c\" ";;
*)
echo >/dev/stderr "Unknown ID3 Tag in $1: $a";;
esac
done
echo "\"$1\""
}
mkdir "$1.new"
dir=`pwd`
cd "$1"
for i in *; do
cd "$dir"
cd "$1"
id3str=`myid3 "$i"`
lame -m j -V 4 --resample 44.1 "$i" -o "../$1.new/$i"
cd "../$1.new"
$id3str
cd ..
done
Augaben bei Ausführung:
dd8pz@mein_pc:/mp3/B/Beatles, The$ ./convert The\ Beatles\ -\ A\ Hard\
Day\'s\ Night
ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding.
LAME 3.98.2 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE
Resampling: input 22.05 kHz output 44.1 kHz
Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz
Encoding 01 - A Hard Day's Night.mp3
to ../The Beatles - A Hard Day's Night.new/01 - A Hard Day's Night.mp3
Encoding as 44.1 kHz single-ch MPEG-1 Layer III VBR(q=4)
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
5825/5826 (100%)| 0:07/ 0:07| 0:08/ 0:08| 20.816x| 0:00
32 [ 9] *
40 [ 57] ****
48 [ 123] *******
56 [1192]
********************************************************************
64 [2096]
************************************************************************************************************************
80 [2339]
*************************************************************************************************************************************
96 [ 3] *
112 [ 3] *
128 [ 1] *
160 [ 2] *
192 [ 0]
224 [ 0]
256 [ 0]
320 [ 0]
------------------------------------------------------------------------------------------------------------------------------------------------
kbps mono % long switch short %
68.3 100.0 99.7 0.2 0.1
Writing LAME Tag...done
ReplayGain: -7.4dB
id3: fopen: Hard: No such file or directory
id3: fopen: Day's: No such file or directory
id3: fopen: Night": No such file or directory
id3: fopen: Beatles": No such file or directory
id3: fopen: Beatles: No such file or directory
id3: fopen: -: No such file or directory
id3: fopen: A: No such file or directory
id3: fopen: Hard: No such file or directory
id3: fopen: Day's: No such file or directory
id3: fopen: Nig": No such file or directory
id3: fopen: "01: No such file or directory
id3: fopen: -: No such file or directory
id3: fopen: A: No such file or directory
id3: fopen: Hard: No such file or directory
id3: fopen: Day's: No such file or directory
id3: fopen: Night.mp3": No such file or directory
ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding.
LAME 3.98.2 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE
Resampling: input 22.05 kHz output 44.1 kHz
Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz
Encoding 02 - I Should Have Known Better.mp3
to ../The Beatles - A Hard Day's Night.new/02 - I Should Have
Known Better.mp3
Encoding as 44.1 kHz single-ch MPEG-1 Layer III VBR(q=4)
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
300/6247 ( 5%)| 0:00/ 0:07| 0:00/ 0:08| 21.180x| 0:08
32 [ 6] ********
40 [ 12] ***************
48 [ 19] ************************
56 [ 47] ***********************************************************
64 [ 96]
************************************************************************************************************************
80 [108]
**************************************************************************************************************************************
96 [ 8] **********
112 [ 1] **
128 [ 1] **
160 [ 1] **
192 [ 0]
224 [ 1] **
256 [ 0]
320 [ 0]
-------02:35------------------------------------------------------------------------------------------------------------------------------------
kbps mono % long switch short %
68.0 100.0 97.2 1.8 1.0^C
Drücken Sie eine Taste zum Fortfahren...
id3: fopen: Hard: No such file or directory
id3: fopen: Day's: No such file or directory
id3: fopen: Night": No such file or directory
id3: fopen: Beatles": No such file or directory
...
Meine Frage: Wieso Zerlegt der Script den Argumente-String von id3 so
komisch?
--
Gruß Jochen
Reply to: