Use ffmpeg to resize image

2019-03-25 03:22发布

Is it possible to resize an image using FFMPEG?

I have this so far:

ffmpeg. -i 1.jpg -vf scale=360:240 > 2.jpg

I get the error message that 'At least one output file must be specified'

Is it possible?

2条回答
对你真心纯属浪费
2楼-- · 2019-03-25 03:51

If you want to retain aspect ration you can do -

./ffmpeg -i 1.jpg -vf scale="360:-1" 2.jpg

or if you want to resize based on input width and height. Eg. lets say half of input width and height you can do -

./ffmpeg -i 1.jpg -vf scale="iw/1:ih/2" 2.jpg

where

iw : input width
ih : input height
查看更多
混吃等死
3楼-- · 2019-03-25 03:54

You can try this:

ffmpeg -i input.jpg -vf scale=320:240 output_320x240.png

I got this from source

Note: The scale filter can also automatically calculate a dimension while preserving the aspect ratio: scale=320:-1, or scale=-1:240

查看更多
登录 后发表回答