Use ffmpeg to resize image

后端 未结 4 2008
挽巷
挽巷 2021-01-30 21:17

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 messa

4条回答
  •  时光取名叫无心
    2021-01-30 21:27

    If you want to retain aspect ratio 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, let's 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
    

提交回复
热议问题