Masoud92m
Masoud92m

Reputation: 622

Auto resize video with ffmpeg based on input video resolution

I wrote a Bash script to convert all video files in a directory. Some videos are 1280 x 720 resolution, and others are 720 x 1280.

How can I write a ffmpeg command that converts 1280 x 720 videos to 640 x 360 and 720 x 1280 videos to 360 x 640?

Upvotes: 1

Views: 807

Answers (1)

Gyan
Gyan

Reputation: 93329

Basic syntax is

ffmpeg -i in -vf scale=iw/2:-2 out

The scale filter will halve the input width, scale the height proportionally and ensure it is even.

Upvotes: 3

Related Questions