I have 45 videos of varying aspect ratios and resolutions. I need to scale all of them so that they fit neatly inside a 640x360 (16x9) container with the following specs:
16x9, 640x360, 1600kbps, H.264, MP4, progressive, 29.97
For example, some videos might be 512x12, others might be 480x320, but they all have to fit, scaled and centred, inside a new 640x360 output video. If a video is not wide enough to fill that space, black bars should be added on the left and right.
Is this possible with ffmpeg?
Here's the code I've been toying with so far:
ffmpeg -i "input.mov" -b:v 1600k -bufsize 1600k -r 29.97 -vf scale=640:360 -vcodec libx264 output.mp4
This seems to do everything I need, except for dynamically scaling to that fixed resolution.
Does anyone know how to achieve the result I'm looking for?