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