title: Bash script stops execution of ffmpeg in while loop - why?
body: <p>I have this bash script for converting <code>.mp4</code> video to <code>.mp3</code> audio.
  It runs, but does the loop only once, though there are more mp4 files in <code>/home/myname/mp4dir</code>.</p>
  
  <p>The script converts the first <code>.mp4</code> file it finds to <code>.mp3</code>, unless there is already an <code>.mp3</code> file. This should be done in a loop, but after the first call to ffmpeg the script stops.</p>
  
  <p>Why?</p>
  
  <pre><code>#!/bin/bash
  find /home/myname/mp4dir -name "*.mp4" | while read f
  do
          fOut=`echo $f | sed s/mp4/mp3/`
          echo "convert $f =&gt; $fOut"
          if ! test -f $fOut
          then
                  ffmpeg -i $f -vn -f mp3 $fOut
          fi
  done
  </code></pre>