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:
| Format | Aspect ratio | Typical resolution | Used by |
|---|---|---|---|
| Vertical | 9:16 | 1080x1920 | TikTok, Reels, Shorts |
| Square | 1:1 | 1080x1080 | Instagram feed |
| Portrait | 4:5 | 1080x1350 | Instagram feed |
| Horizontal | 16:9 | 1920x1080 | YouTube, 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 FFmpeg | FFmpeg Micro API |
|---|---|
| Install and update FFmpeg binaries | No FFmpeg to install |
| Run a server or worker for long jobs | No servers to run |
| Handle queuing and retries yourself | Submit a job, poll or webhook |
| Scale your own compute for batches | Usage-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
scaleorcropmath produces an odd number, addscale=trunc(iw/2)*2:trunc(ih/2)*2or 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:1080on 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
-vfchain only touches video. Your audio carries through by default, but if you use-filter_complexand map streams, remember to map0:atoo.
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.
You might also like

How to Add a Blurred Background to Vertical Video (9:16 Fill) with FFmpeg
Add a blurred 9:16 background behind landscape footage with one FFmpeg filter_complex, then batch it across your whole clip library.

How to Compress Video for WhatsApp Business API (Under 16 MB)
Compress video for WhatsApp Business API under the 16 MB limit with one API call. Add a compression step before your n8n or Make WhatsApp send node.

Supabase Edge Functions Can't Run FFmpeg: Offload It to a Video API
Supabase Edge Functions can't spawn FFmpeg and ffmpeg.wasm OOMs in the isolate. Offload encoding to a video API and save the result to Storage.
Ready to process videos at scale?
Start using FFmpeg Micro's simple API today. No infrastructure required.
Get Started Free