Use ffmpeg to resize image

后端 未结 4 2000
挽巷
挽巷 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:23

    It is also possible to resize an image to fit inside some dimensions and letterbox the rest.

    Example command:

    ffmpeg -i IN.png -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" OUT.jpg
    

    See this answer for more details.

提交回复
热议问题