title: Bash loop over files in directory outputting non existent files
body: <p>I am making mp4 files from a series of images. The images should run about 1 hour but I cannot get a full video because FFMPEG looks for a file it should not have.</p>
  <pre><code>[image2 @ 0x55fe14bef700] Could not open file : /mnt/run/image-005437.jpeg
  </code></pre>
  <p>What is confusing is that the list that I pass to ffmpeg <em>should</em> not include that file. If my script does not like the result it sends the file to a sub directory in the target folder called failed</p>
  <p>the location of the file with that number</p>
  <pre><code>$ pwd
  run/failed
  ]$ ls
  failed-005437.jpeg 
  </code></pre>
  <p>the command I use to launch ffmpeg is the following</p>
  <pre><code>image_folder=$1
  singularity exec --bind $work_dir:/mnt $work_dir/longleaf2.sif ffmpeg -f concat -safe 0 -y -i &lt;(for f in /mnt/processed_images/$image_folder/image-%06d.jpeg; do echo &quot;file '$f'&quot;;done) -vf &quot;crop=trunc(iw/3)*2:trunc(ih/2)*2&quot; -movflags +faststart /mnt/run/summary_files/${image_folder}.mp4
  </code></pre>
  <p>I have checked processed images and it is not there so why is ffmpeg looking for it?</p>
  <p>pastebin of the failed run</p>
  <p><a href="https://pastebin.com/pF5ZefLf" rel="nofollow noreferrer">https://pastebin.com/pF5ZefLf</a></p>
  <p>My check that the file is not in the folder reference by the for loop so that it should never cause an error</p>
  <pre><code>$ ls image-005437.*
  ls: cannot access image-005437.*: No such file or directory
  </code></pre>