I am using the following ffmpeg command to create multiple resolutions for the same video content.

ffmpeg -i ${f} -c:v libx264 -keyint_min 150 \
-g 150 -profile:v main -f h264 -dash 1 \
-an -vf scale=640:360 -b:v 750k ${streamsdirectory}/${filename}_640x360_750k.mp4 \
-an -vf scale=1280:720 -b:v 2000k ${streamsdirectory}/${filename}_1280x720_2000k.mp4 \
-an -vf scale=1920:1080 -b:v 4000k ${streamsdirectory}/${filename}_1920x1080_4000k.mp4

What is the best strategy to keep respect for the aspect ratio for any video content ?

2 Answers 2


If you want the output resolution to be 1280x720 and the video keeps its original ratio aspect as well:

ffmpeg  -v error -stats -i input -vf

To keep aspect ratio change:

-vf scale=640:360
-vf scale=1280:720
-vf scale=1920:1080


-vf scale=-2:360
-vf scale=-2:720
-vf scale=-2:1080

See scale filter documentation for more info.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.