FFmpeg - Change resolution of the video with aspect ratio

感情迁移 提交于 2019-12-03 02:40:03

ffmpeg -i <input> -vf scale=720x406,setdar=16:9 <output>

Learn more about it,

Changing-resolution-video-using-ffmpeg

Mark Gerolimatos

Doesn't work with video. That page only deals with still images.

For reasons not completely understood, FFMPEG monkeys around with the Sample/Pixel Aspect Ratio to turn the video back to the original aspect ratio. For instance, if you stretch the video out twice as wide, it will make the aspect ratio 1:2, or something similar (2:1?)

Thus, if you REALLY want to stretch a video out "Stretch Armstrong" style, you need to force the SAR (Sample Aspect Ratio):

ffmpeg -i <something> -vf scale=iw*55:ih,setsar=1:1 ...

This is not really well described in the FFMPEG manual, here's a video.stackexchange answer that puts it all in one place.

Use magic number -1 to resize video proportionally and setdar need to use slash / as separator not colons :.

ffmpeg -i <input> -vf "scale=100:-1,setdar=16/9" <output>

the command will resize video 200x400 to 100x200 and 400x700 to 100x175 with aspect ratio 16:9

Below metion both option: with Scale:

ffmpeg -i source.mp4 -r 15 -s 320x240 -strict -2 destination.mp4

With Aspect ratio:

ffmpeg -i source.mp4 -r 15 -aspect 1:1 -strict -2 destination.mp4
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!