I have several vertical videos which I would like to display in the 16/9 or 4/3 format.

I would like to have the video centered and have a black Background.

I normally use Handbrake to compress my videos but did not find an option to do that.

Is there another Video compressor (open source) who allows to do that? Other wise I have to compress it with handbrake and add the background with Premiere, which takes ages.

Really would like an easier solution.

Thanks in advance for any response.


You can use ffmpeg*, a command-line tool, to do this.

Let's say your source video is 360x640, then to make it 4:3, use

ffmpeg -i input.mp4 -vf pad=854:640:247:0 -c:v libx264 -crf 20 -c:a copy output.mp4

where 854 is used because it's 4/3 of 640, and 247 places the video in the center of the padded canvas. See details for the pad filter here.

Similarly for 16:9, use

ffmpeg -i input.mp4 -vf pad=1138:640:389:0 -c:v libx264 -crf 20 -c:a copy output.mp4

where 1138 is used because it's 16/9 of 640, and 389 for centering.

The width value you specify should be an even integer, so you may have to round up/down your calculated width.

*get the latest nightly or snapshot binary for your platform.

  • If there is audio it doesn't need to be transcoded. – user12174 Feb 16 '16 at 14:35
  • @Mulvya Thanks for the reply. I will try that later on and accept the answer once I did it :) – Serge Inácio Feb 16 '16 at 15:09
  • I tried it out. didn't have success yet, but I guess this is the way to do it. – Serge Inácio Feb 18 '16 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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