Vertical to Horizontal Video Conversion with Blur Sides by using FFmpeg

How to turn vertical video into standard 16:9 horizontal video with echo pillarboxing

When you’re publishing videos on a platform like YouTube, you mostly want it to make it to standard 16:9 horizontal video. Most video recorders already produce that. But sometimes, one of your video section will contain a vertical video. For example, if you want to show an Android or iOS app demo.

Putting a vertical video directly into a wide video doesn’t look good. Especially with that wide area for pillar box sides.

One of the techniques that are widely used to display vertical video with a better aesthetic is to fill it with a blurred version of the same video. This technique is also called “stylized pillarboxing” or “echo pillarboxing”.

A screenshot of a vertical video with blurred pillarbox
A screenshot of a vertical video with blurred pillarbox

In this tutorial, I’ll show you how to do the technique with the video swiss-army knife tool: FFmpeg.

For those who don’t know, FFmpeg is a cross-platform video manipulation command-line tool. On macOS, you can simply install it using homebrew.

brew install ffmpeg

To follow this tutorial, you’re going to need a vertical video. You can use any vertical video. It’s either you record it yourself or download it from the internet. For this tutorial, I’ll use a free video from called Maple Plane Wing.

The following shell snippet will convert your vertical video into a horizontal video with a 16:9 aspect ratio. The input.mp4 parameter is your vertical video. The output.mp4 is your output filename. That will be your newly created horizontal video with blurred sides.

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' \

The process can take a long time, depend on your video duration. After the process is finished, check your output.mp4 file.

Make it easier to memorize

You might be wondering it’s really hard to memorize that long command line. But you actually can make a shortcut for it.

If you’re familiar with the bash function, the command can be memorized easily. I write the following bash function on my macOS.

function ffmpeg-fill-blur()
  ffmpeg -i $1 \
    -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' \

With that function, using it is very simple. Instead of writing a verbose command as I show you earlier, I can now just type the command like the following snippet.

ffmpeg-fill-blur input.mp4 output.mp4

The following video is an example of before and after FFmpeg conversion. As you can see, the newly created horizontal video has blurred sides instead of black pillarbox.

That’s all I can write today. Thanks for reading!