When I run the following code, that is supposed to print out the filename and redirect ffmpeg's stderr information to stdout:
#!/bin/bash
while read -r filename; do
echo $filename
cmd_out=$(ffmpeg -i "$filename" -f null - 2>&1)
done < inputs.txt
With the following inputs.txt
:
intro.mp3
silence.mp3
outro.mp3
intro2.mp3
I get
intro.mp3
ilence.mp3
outro.mp3
ntro2.mp3
Notice the first letter of the filename is missing in both the 2nd and 4th lines.
This happens only if the inputs.txt
entries are existing audio files, and ffmpeg is used.