user34243: I want to make a horizontal video get converted to vertical video using FFMPEG for automation purposes. I tried with this, which works for vertical to horizontal
    ffmpeg -i input.mp4 \
  -vf 'split[original][copy];[copy]scale=ih*16/9:-1,crop=h=iw*9/16,gblur=sigma=20[blurred];[blurred][original]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2' \
  output.mp4

And tried to change the "16/9" and "9/16" parameters backwards so it makes the reverse procedure, but i get an error.
I don't really need the blur thing, because i want to put some images on the black boxes that will result from doing this process.

user36247: For the blur effect command, you needed to swap a few widths with heights then rescale it so the original video fits in properly above the blurred video:
ffmpeg -i input.mp4 -vf 'split[original][copy];[copy]scale=-1:ih*(16/9)*(16/9),crop=w=ih*9/16,gblur=sigma=20[blurred];[blurred][original]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2' output.mp4


If you want black bars instead, it was covered in this post, but for the tl;dr, it's this:
ffmpeg -i input.mp4 -vf "pad=iw:2*trunc(iw*16/18):(ow-iw)/2:(oh-ih)/2,setsar=1" -c:a copy output.mp4


34243: <p>I want to make a horizontal video get converted to vertical video using FFMPEG for automation purposes. I tried with this, which works for vertical to horizontal</p>
<pre><code>    ffmpeg -i input.mp4 \
  -vf 'split[original][copy];[copy]scale=ih*16/9:-1,crop=h=iw*9/16,gblur=sigma=20[blurred];[blurred][original]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2' \
  output.mp4
</code></pre>
<p>And tried to change the &quot;16/9&quot; and &quot;9/16&quot; parameters backwards so it makes the reverse procedure, but i get an error.</p>
<p>I don't really need the blur thing, because i want to put some images on the black boxes that will result from doing this process.</p>
 36247: <p>For the blur effect command, you needed to swap a few widths with heights then rescale it so the original video fits in properly above the blurred video:</p>
<pre><code>ffmpeg -i input.mp4 -vf 'split[original][copy];[copy]scale=-1:ih*(16/9)*(16/9),crop=w=ih*9/16,gblur=sigma=20[blurred];[blurred][original]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2' output.mp4
</code></pre>
<hr />
<p>If you want black bars instead, <a href="https://stackoverflow.com/questions/55383442/ffmpeg-how-to-convert-horizontal-video-169-to-vertical-video-916-with-black">it was covered in this post</a>, but for the tl;dr, it's this:</p>
<pre><code>ffmpeg -i input.mp4 -vf &quot;pad=iw:2*trunc(iw*16/18):(ow-iw)/2:(oh-ih)/2,setsar=1&quot; -c:a copy output.mp4
</code></pre>
