user13828: 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.

user1871: 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.

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

<p>I would like to have the video centered and have a black Background.</p>

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

<p>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.</p>

<p>Really would like an easier solution.</p>

<p>Thanks in advance for any response.</p>
 1871: <p>You can use <a href="https://ffmpeg.org/download.html" rel="nofollow">ffmpeg</a>*, a command-line tool, to do this.</p>

<p>Let's say your source video is <code>360x640</code>, then to make it 4:3, use</p>

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

<p>where <code>854</code> is used because it's <code>4/3</code> of <code>640</code>, and <code>247</code> places the video in the center of the padded canvas. See details for the pad filter <a href="https://ffmpeg.org/ffmpeg-filters.html#pad-1" rel="nofollow">here</a>.</p>

<p>Similarly for 16:9, use</p>

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

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

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

<p>*get the latest nightly or snapshot binary for your platform.</p>
