Search code examples
ffmpeg

ffmpeg - generating thumbs results in different aspect ratio


My ffmpeg command looks like

ffmpeg -i "/tmp/assets/input.mov" -y -ss 00:00:05 -vf fps=1/5,scale=300:-1 /tmp/output/thumbs/thumb%03d.jpg

input.mov has a display resolution of 16:9 even though the source resolution looks to be 1440x1080. i.e. the video plays in a player at 16:9 (not really sure how this happens)

the generated thumbs in this case are 300x225 (4:3) and look distorted.

How can i have it generate the thumb according to the display aspect ratio? I was hoping for 300x169 (16:9)


Solution

  • Use:

    ffmpeg -i "/tmp/assets/input.mov" -y -ss 00:00:05 -vf fps=1/5,scale=300:ow/dar,setsar=1 /tmp/output/thumbs/thumb%03d.jpg
    

    the video plays in a player at 16:9 (not really sure how this happens)

    See https://stackoverflow.com/a/50347465/