Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    A+ Works out of the box. Selected answer's solution did not preserve aspect ratio. It squeezed the frames.
    – user287352
    Commented Jun 7, 2019 at 19:05
  • 1
    FYI for everyone else looking into this, if you run into issues where you get 'height not divisible by 2' do this one instead: ceil(iw*min(1\,min(640/iw\,360/ih))/2)*2:-1, it adds 1px if the concerning edge is odd.
    – lawonga
    Commented Jul 13, 2020 at 0:48
  • @lawonga, I would think you would want to use floor in most cases since typically you're downscaling. Using ceil allowed my final video to actually be a pixel larger than the max size set. This is the command I ended up using: -vf "scale=floor(iw*min(1\,min(640/iw\,360/ih))/2)*2:-1" (You can experience what I mentioned by setting the 640 and 360 values to odd values like 643 & 301 respectively, for example.) Commented May 29 at 13:38