user29683: 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 ?

user1760: To keep aspect ratio change:
-vf scale=640:360
-vf scale=1280:720
-vf scale=1920:1080

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

See scale filter documentation for more info.

user30085: 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


29683: <p>I am using the following ffmpeg command to create multiple resolutions for the same video content.</p>

<pre><code>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
</code></pre>

<p>What is the best strategy to keep respect for the aspect ratio for any video content ?</p>
 1760: <p>To keep aspect ratio change:</p>

<pre><code>-vf scale=640:360
-vf scale=1280:720
-vf scale=1920:1080
</code></pre>

<p>to:</p>

<pre><code>-vf scale=-2:360
-vf scale=-2:720
-vf scale=-2:1080
</code></pre>

<p>See <a href="https://ffmpeg.org/ffmpeg-filters.html#scale" rel="nofollow noreferrer">scale filter documentation</a> for more info.</p>
 30085: <p>If you want the output resolution to be 1280x720 and the video keeps its original ratio aspect as well:</p>

<pre><code>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
</code></pre>
