Maintaining aspect ratio with FFmpeg

前端 未结 8 1346
悲&欢浪女
悲&欢浪女 2021-01-29 22:39

I need to convert a bunch of video files using FFmpeg. I run a Bash file that converts all the files nicely, however there is a problem if a file converted is not in 16:9 format

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-29 22:58

    For example:

    1920x1080 aspect ratio 16:9 => 640x480 aspect 4:3:

    ffmpeg -y -i import.media -aspect 16:9 scale=640x360,pad=640:480:0:60:black output.media
    

    aspect ratio 16:9 , size width 640pixel => height 360pixel:
    With final output size 640x480, and pad 60pixel black image (top and bottom):

    "-vf scale=640x360,pad=640:480:0:60:black"
    

提交回复
热议问题