ffmpegaspect-ratiosocial-video

Convert vertical to horizontal video (and back) for social formats

·Javid Jamae·6 min read
Convert vertical to horizontal video (and back) for social formats

Vertical and horizontal are different aspect ratios, not rotations

You shot a video in portrait (9:16) and now you need it landscape (16:9) for YouTube, or you have a 16:9 clip that has to run as a 9:16 Reel. The frames don't fit each other, so something has to give. You either crop the sides off, add bars, or fill the empty space. This post covers the three ways to do that conversion, the FFmpeg commands behind each, and how to run the same job as one API call when you're doing it inside an automation.

First, clear up a common mix-up. Turning a vertical video into a horizontal one is reframing, not rotating. If you rotate a 1080x1920 portrait clip 90 degrees, you get footage lying on its side, not a proper landscape video. Rotation changes orientation. Aspect ratio conversion changes the canvas the picture sits in. Keep those separate and the rest gets easier.

The common social targets:

FormatAspect ratioTypical resolutionUsed by
Vertical9:161080x1920TikTok, Reels, Shorts
Square1:11080x1080Instagram feed
Portrait4:51080x1350Instagram feed
Horizontal16:91920x1080YouTube, LinkedIn

Three ways to convert portrait to landscape (and back)

1. Crop to fill the new frame

Cropping keeps the picture edge-to-edge with no bars, but you lose whatever falls outside the new frame. Going from 9:16 to 16:9 this way throws away most of the height, so it only works when your subject sits in the center band.

ffmpeg -i portrait.mp4 -vf "crop=ih*16/9:ih,scale=1920:1080" landscape.mp4

That crops a 16:9 window out of the full height, then scales to 1080p. For the reverse (landscape to vertical), crop a tall center slice:

ffmpeg -i landscape.mp4 -vf "crop=iw*9/16:ih,scale=1080:1920" vertical.mp4

2. Pad with bars (letterbox or pillarbox)

Padding keeps the entire original picture and adds black bars to fill the gap. Vertical into a 16:9 frame gives you pillarbox (bars on the sides). Horizontal into 9:16 gives you letterbox (bars top and bottom).

ffmpeg -i vertical.mp4 -vf "scale=-1:1080,pad=1920:1080:(ow-iw)/2:0" landscape.mp4

This is the safe, lossless-framing option. The pad filter has a lot of edge cases around even dimensions and centering, and we walk through all of them in the pad filter guide.

3. Blurred-background fill

Instead of flat black bars, scale a copy of the video to fill the whole frame, blur it, and lay the sharp original on top. This is the look most creators reach for when repurposing a landscape talk into a Reel, because it fills the screen without cropping the subject.

ffmpeg -i landscape.mp4 -filter_complex \
"[0:v]scale=1080:1920,boxblur=20[bg];[0:v]scale=1080:-1[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2" \
vertical.mp4

Pick your method by intent: crop when the subject is centered and you want full-bleed, pad when nothing can be lost, blur-fill when you want a polished social look.

The manual way vs one API call

Running these commands locally works fine for one file. The friction shows up when the conversion is a step in a pipeline: a Zapier zap that grabs new uploads, an n8n workflow assembling faceless-channel clips, or a batch of 300 UGC videos that each need a 9:16 and a 1:1 version.

Manual FFmpegFFmpeg Micro API
Install and update FFmpeg binariesNo FFmpeg to install
Run a server or worker for long jobsNo servers to run
Handle queuing and retries yourselfSubmit a job, poll or webhook
Scale your own compute for batchesUsage-based, scales for you

With FFmpeg Micro you send the same filter logic as a job and download the output. Here's a pad-based portrait-to-landscape conversion:

curl -X POST https://api.ffmpeg-micro.com/v1/jobs \
  -H "Authorization: Bearer $FFMPEG_MICRO_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "https://example.com/vertical.mp4",
    "filters": "scale=-1:1080,pad=1920:1080:(ow-iw)/2:0",
    "output": { "format": "mp4" }
  }'

You get a job ID back, then poll or receive a webhook when the output is ready. The same call works from code, from n8n, Make, and Zapier, or from an AI agent through the MCP server. No binary setup, no worker to babysit.

Common pitfalls when converting aspect ratios

  • Odd dimensions break H.264. The libx264 encoder needs even width and height. If a scale or crop math produces an odd number, add scale=trunc(iw/2)*2:trunc(ih/2)*2 or the encode fails.
  • Confusing rotate with reframe. As covered above, a 90-degree rotate is not a portrait-to-landscape conversion. If your source actually has a rotation metadata flag set backwards, that's a separate fix, not an aspect ratio change.
  • Stretching instead of fitting. Forcing scale=1920:1080 on a 9:16 source squishes faces. Always crop or pad to change shape, and only scale to change size within the same ratio.
  • Skipping the metadata check. Guessing the source dimensions leads to wrong crop math. Run ffprobe first to read the real width, height, and rotation before you build the filter.
  • Losing the audio track. A -vf chain only touches video. Your audio carries through by default, but if you use -filter_complex and map streams, remember to map 0:a too.

FAQ

Can I convert vertical to horizontal without black bars?

Yes. Use the crop method to fill the frame edge-to-edge, or the blurred-background fill to cover the empty space with a soft copy of the video. Padding is the only method that adds visible bars.

Does converting aspect ratio reduce quality?

Reframing itself doesn't degrade the picture, but re-encoding does slightly. Cropping discards pixels, and scaling up a small source softens it. Start from the highest-resolution master you have and encode once.

How do I batch-convert many videos to 9:16?

Loop the same filter over your files. For anything beyond a handful, send each as a job to a hosted FFmpeg API so the conversions run in parallel instead of tying up one machine.

What's the difference between flipping and rotating a video?

Flipping mirrors the image (hflip/vflip). Rotating turns it around a corner. Neither changes aspect ratio. The flip filter guide covers those if that's what you actually need.

If you'd rather wire this conversion into a workflow than manage FFmpeg yourself, the free tier lets you run real jobs today. Sign up free and convert your first vertical-to-horizontal job with one API call.

About Javid Jamae

Founder & CEO at FFmpeg Micro

Javid is a software engineer, author, and entrepreneur with over 25 years of professional software development experience across enterprise, startup, and consulting environments. He founded FFmpeg Micro to make video processing accessible to developers through a simple, automation-first REST API.

Software EngineeringVideo ProcessingFFmpegCloud ArchitectureAPI DesignAutomation

Ready to process videos at scale?

Start using FFmpeg Micro's simple API today. No infrastructure required.

Get Started Free