Resize videos with different widths to a fixed height preserving aspect ratio with ffmpeg
Posted
by
Axarydax
on Super User
See other posts from Super User
or by Axarydax
Published on 2010-10-19T13:07:45Z
Indexed on
2011/02/02
7:28 UTC
Read the original article
Hit count: 611
I'd like to convert a lot of video files to flash video for our company's website. I have a requirement that all of the videos must be in 360p format, so their size would be Nx360.
FFMpeg uses -s argument to specify target resolution as WxH. I don't know Width, as it depends on source file aspect ratio. If source is 640x480, target will be 480x360. If source is 848x480, target will be 636x360.
Is there a way to do it with some switch of ffmpeg? That it will preserve aspect ratio and I'll only specify the height of target video?
I could easily solve it by making a program that will launch ffprobe to get source video size, calculate aspect ratio and then calculate a new width.
© Super User or respective owner