title: How do I avoid batch video transcoding error when encountering whitespaces in filename using ffmpeg
body: <p>I am running a bash script to batch transcode videos on a LAMP server using find and ffmpeg </p>
  
  <pre><code>dir="/srv/videos"
  for OUTPUT in "$(find $dir -iname *.AVI -o -iname *.MOV)"
  do
      ffmpeg -i "$OUTPUT" "${OUTPUT%%.*}.mp4"  -hide_banner
  done
  </code></pre>
  
  <p>ffmpeg returns an error if file has whitespaces</p>
  
  <pre><code> /srv/videos/file with white spaces.MOV: No such file or directory
  </code></pre>
  
  <p>For files without white spaces it works fine.<br>
  If I print the filenames inside quotes it looks as though it should be working</p>
  
  <pre><code>for OUTPUT in "$(find $dir -iname *.MOV)"; do echo "$OUTPUT";done
  </code></pre>
  
  <p>returns </p>
  
  <pre><code>/srv/videos/file with white spaces.MOV
  </code></pre>
  
  <p>What do I need to alter to avoid the error please?</p>
  
  <p><strong>EDIT</strong>
  added "" to ${OUTPUT%%.*}.mp4, I get the same error and corrected extension capitalisation (mov to MOV)</p>