title: How to extract frames from all videos in a folder using ffmpeg
body: <p>I'm currently able to extract images from a file using the following line</p>
  
  <pre><code>ffmpeg -i inputfile.avi -r 1 image-%d.jpeg
  </code></pre>
  
  <p>However, I want to apply this to all the files in a folder, and place it in an output folder.</p>
  
  <p>Suppose I have the current folder holding all videos:</p>
  
  <p>input-videos/</p>
  
  <p>----subfolder1/</p>
  
  <p>------video.avi</p>
  
  <p>----subfolder2/</p>
  
  <p>------video.avi</p>
  
  <p>I want everything in the output folder:</p>
  
  <p>output/</p>
  
  <p>----subfolder1/</p>
  
  <p>------video/</p>
  
  <p>----------*.jpeg</p>
  
  <p>----subfolder2/</p>
  
  <p>------video/</p>
  
  <p>----------*.jpeg</p>
  
  <p>What is the simplest way to go about this using a bash script? (or something else better)</p>