user30152: I am using below command to create a slideshow using ffmpeg:
ffmpeg -r 1 -i IMG_%04d.jpeg -i audio.mp3 -c:v libx264 -c:a aac -pix_fmt yuv420p -r 24 -y output.mp4 -vf pad=ceil(iw/2)*2:ceil(ih/2)*2

I had to add pad=ceil(iw/2)*2:ceil(ih/2)*2 to make width or height even number because if one of the input image width/height is odd, ffmpeg throws error. Now my problem is; input images can be of different resolution and aspect ratio. I want to add padding (left/right or top/bottom) to all images to make them of equal size before they are converted into video frames. How can I achieve this in efficient way?
Edit:
It would be nice if I can specify output resolution and all images are either scaled down or up keeping their aspect ratio intact according to that resolution.

user1871: If your output resolution is AxB, then your filters would be
-vf "scale=A:B:force_original_aspect_ratio=decrease,pad=A:B:-1:-1"


30152: <p>I am using below command to create a slideshow using ffmpeg:</p>

<pre><code>ffmpeg -r 1 -i IMG_%04d.jpeg -i audio.mp3 -c:v libx264 -c:a aac -pix_fmt yuv420p -r 24 -y output.mp4 -vf pad=ceil(iw/2)*2:ceil(ih/2)*2
</code></pre>

<p>I had to add <code>pad=ceil(iw/2)*2:ceil(ih/2)*2</code> to make width or height even number because if one of the input image width/height is odd, ffmpeg throws error. Now my problem is; input images can be of different resolution and aspect ratio. I want to add padding (left/right or top/bottom) to all images to make them of equal size before they are converted into video frames. How can I achieve this in efficient way?</p>

<p><strong>Edit:</strong>
It would be nice if I can specify output resolution and all images are either scaled down or up keeping their aspect ratio intact according to that resolution.</p>
 1871: <p>If your output resolution is AxB, then your filters would be</p>

<pre><code>-vf "scale=A:B:force_original_aspect_ratio=decrease,pad=A:B:-1:-1"
</code></pre>
