Best strategy to keep aspect ratio consistent for all videos having any resolution 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 ?
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
"scale=1280:720:force_original_aspect_ratio=1,pad=1280:720:(ow-iw)/2:(oh-ih)/2"
output