while-loop stops looping
From: Roeland Ordelman (ordelman_at_cs.utwente.nl)
Date: 03/23/04
- Next message: Ann: "Newb request: scripts"
- Previous message: Francesco: "Re: searching through multiple files"
- Next in thread: Brian Gough: "Re: while-loop stops looping"
- Reply: Brian Gough: "Re: while-loop stops looping"
- Reply: Brian Gough: "Re: while-loop stops looping"
- Reply: 10001053-
- Reply: Icarus Sparry: "Re: while-loop stops looping"
- Reply: Stachu 'Dozzie' K.: "Re: while-loop stops looping"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 23 Mar 2004 10:41:26 +0100
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
- Next message: Ann: "Newb request: scripts"
- Previous message: Francesco: "Re: searching through multiple files"
- Next in thread: Brian Gough: "Re: while-loop stops looping"
- Reply: Brian Gough: "Re: while-loop stops looping"
- Reply: Brian Gough: "Re: while-loop stops looping"
- Reply: 10001053-
- Reply: Icarus Sparry: "Re: while-loop stops looping"
- Reply: Stachu 'Dozzie' K.: "Re: while-loop stops looping"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|