I wrote a skript to quickly create short preview clips from vides I recorded on timestamps that I found worth checking out later for cutting. My file with the timestamps is
ffmpeg
reads from standard input, consuming data from $1
that was intended for the read
command at the top of the loop. Redirect its standard input from /dev/null
:
while IFS="#" read file timestamps; do
filename="$file.MP4"
for time in $timestamps; do
ffmpeg -ss 00:${time}.0 -i "orig/${filename}" \
-c copy -t 10 "preview/${file}_${time}.MP4" < /dev/null
done
done < "$1"
echo
does not read from standard input, which is why your modification made it appear to be working correctly.