title: Quickly check the integrity of video files inside a directory with ffmpeg
body: <p>I'm desperately searching for a convenient method to check the integrity of .mp4 files inside a specific directory with folders in it. Both the names of the .mp4 files and the folders contain spaces, special characters and numbers.</p>
  
  <p>I've already found a proper ffmpeg command to quickly identify a damaged .mp4 file, taken from <a href="https://superuser.com/questions/100288/how-can-i-check-the-integrity-of-a-video-file-avi-mpeg-mp4#comment1367300_100290">here</a>:
  <code>ffmpeg -v error -i filename.mp4 -map 0:1 -f null - 2&gt;error.log</code></p>
  
  <p>If the created error.log contains some entries, then the file is obviously corrupted. The opposite would be an empty error.log.</p>
  
  <p>The next step would be to apply this command to every .mp4 file within the folder and its subfolders. Some guides, like <a href="https://stackoverflow.com/questions/5784661/ffmpeg-convert-entire-directory">here</a> and <a href="https://unix.stackexchange.com/questions/114908/bash-script-to-convert-all-flac-to-mp3-with-ffmpeg">here</a>, do describe how to apply a ffmpeg command recursively, but my coding skills are limited, so therefore I can't find a way to combine these commands to get the following:</p>
  
  <p>A way to test all .mp4 files inside a folder (recursively) with the aforementioned ffmpeg command, that should create .log files, only if a video file does contain errors (read has some content) and it should inherit the name of the broken file, to know which file is corrupted.</p>
  
  <p>Using Ubuntu Gnome 15.10.</p>