Timeline for How can I fit a video to a certain size, but don't upscale it with FFmpeg?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 29 at 13:38 | comment | added | Ryan Griffith |
@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.)
|
|
Jul 13, 2020 at 0:48 | comment | added | lawonga | 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. | |
Jun 7, 2019 at 19:05 | comment | added | user287352 | A+ Works out of the box. Selected answer's solution did not preserve aspect ratio. It squeezed the frames. | |
Aug 10, 2014 at 9:10 | review | Late answers | |||
Aug 10, 2014 at 9:23 | |||||
Aug 10, 2014 at 8:59 | history | edited | immerzl | CC BY-SA 3.0 |
edited body
|
Aug 10, 2014 at 8:53 | history | edited | immerzl | CC BY-SA 3.0 |
added 121 characters in body
|
Aug 10, 2014 at 8:51 | review | First posts | |||
Aug 10, 2014 at 20:09 | |||||
Aug 10, 2014 at 8:46 | history | answered | immerzl | CC BY-SA 3.0 |