1. while-loop stops looping
Hello all,
given the shell script below (it converts a bunch of mp3 files to
wav), the while loop DOES loop when I only echo filenames, but DOES
NOT loop when the conversion program 'ffmpeg' is executed: it
processes only one single file and then stops. So, only echoing gives:
processing 000003.mp3
done
processing 000004.mp3
done
processing 000005.mp3
done
processing 000006.mp3
done
processing 000007.mp3
done
processing 000008.mp3
done
processing 000008.mp3
done
all done
After uncommenting the conversion program I get:
processing 000003.mp3
Input #0, mp3, from '000003.mp3':
Duration: 00:41:27.3, bitrate: 64 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, mono, 64 kb/s
Output #0, wav, to '000003.wav':
Stream #0.0: Audio: pcm_s16le, 16000 Hz, mono, 256 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
size= 77729kB time=2487.3 bitrate= 256.0kbits/s
0
done
all done
ffmpeg seems to work okay, at least it does not give any error messages and
the conversion has been accomplished succesfully. While debugging, all
mp3 files have been converted to wav now, but I am puzzled about this
behavior. Has anyone an idea what might go wrong? I looks like if the
find job is killed by ffmpeg, how can that be? By the way, I run this
script on linux with suse8.2.
#############################################
#!/bin/sh
DIR=$HOME/whatever
DATA=$DIR/data
find $DATA -follow -name "*.mp3" -print |\
while read i
do
base=$DATA/`basename $i .mp3`
if [ ! -s $base.wav ]
then
echo "processing $i"
ffmpeg -i $i -ab 16 -ar 16000 -ac 1 $base.wav
echo $?
echo "done"
fi
done
echo "all done"
-- roeland
2. can't route from en1
3. redirect interactive program's stdin, stdout
4. Modifying Redhat Boot Disk to accomodate PXE initiation and deploying via NFS
5. csh: redirect script's stdin to command?
6. Just curious, how do I do this in Windows?
7. Redirecting to a terminal's stdin
8. copy the output from wc -l <file.txt> into a shell variable.
9. Problem with 'while' loop in 'sh'
10. different behaviour of 'while read' and 'for' loops in bash
11. 4 a5200's in AL_PA 'split loop'
12. 'Socket destroy delayed...' loop on console - what's going on ?
13. namespace of variable in while-loop