0

I'm trying to execute a ffmpeg command on a list of video files, stored in an ascii file.

I simply tried to combine the reading of filenames with a while loop but it seems not to work. For some reason every video filename gets cropped

while read p; do 
    ffmpeg -i "$p" [some options] ;
done < filelist.txt

Any idea why this is happening?

filelist.txt looks like this:

video1.mp4
video2.mp4
video3.mp4
[...]
4
  • Could you provide an example of filelist.txt ? Commented May 20, 2020 at 12:36
  • weirdly the same command is working fine when I use for f in $(find .); do ... instead. I used both commands frequently and interchangeably, it's weird that while fails in this situation Commented May 20, 2020 at 12:41
  • 3
    I have seen this problem before: ffmpeg reads the same stdin while is reading. Use ffmpeg ... < /dev/null or -nostdin. There should be a duplicate somewhere out there. If you find it, please link it. Commented May 20, 2020 at 12:46
  • 4
    Found the duplicate: bash script stops execution in while loop - why? and execute ffmpeg command in a loop Commented May 20, 2020 at 12:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.