Resize videos with different widths to a fixed height preserving aspect ratio with ffmpeg
- by Axarydax
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.