title: Use ffmpeg to generate video thumbnail without any distortion
body: <p>To get a <code>200x100</code> thumbnail from a video, I do <code>ffmpeg -ss 100 -i /tmp/video.mp4 -frames:v 1 -s 200x100 image.jpg</code>. But if the source video isn't in the same aspect ratio as <code>200x100</code>, the thumbnail gets distorted (either stretched or squished, horizontally or vertically) and it looks bad.</p>
  
  <p>Is there a way that <code>ffmpeg</code> can figure out for example that a <code>500x200</code> video is <code>100px</code> too wide, and remove <code>50px</code> from the right and <code>50px</code> from the left, making the video <code>400x200</code>? And because <code>400x200</code> is the same aspect ratio as <code>200x100</code>, the thumbnail would have no distortion.</p>
  
  <p>I know there are other tools that can do this to the thumbnails generated by <code>ffmpeg</code>, but I'd prefer doing it within <code>ffmpeg</code> and not having to process the thumbnails again.</p>