Caveat: I've never used ffmpeg
, but in working with other questions concerning the program, it appears that, like ssh
, ffmpeg
reads from standard input without actually using it, so the first call to Convert
is consuming the rest of the file list after read
gets the first line. Try this
Convert() {
ffmpeg -i "$1" -vcodec mpe4 -sameq -acodec aac
-strict experimental "$1.mp4" < /dev/null
}
This way, ffmpeg
will not "hijack" data from standard input intended for read
command.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…