What You Will Learn
- How to convert horizontal video (16:9) to vertical video (9:16)
- How to extract a vertical video with a center crop (
crop) - How to add black bars (
pad) or a colored background - How to convert to vertical video with a blurred background
- Recommended resolution settings for Instagram Reels and TikTok
Tested version: Verified with FFmpeg 6.1
Target OS: Windows / macOS / Linux
Tested with: FFmpeg 6.1 (verified against real FFmpeg)
Vertical Video Format Basics
| Item | Value |
|---|---|
| Aspect ratio | 9:16 |
| Resolution (standard) | 1080×1920 px |
| Resolution (minimum) | 540×960 px |
| Frame rate | 24–60 fps |
Method 1: Center Crop (crop)
Cut out the center of a horizontal video at vertical-video dimensions. This works best when the subject is centered.
1920×1080 → 1080×1920 Center Crop
First scale the height up to 1920, then center-crop a width of 1080 from it:
ffmpeg -i input.mp4 -vf "scale=-1:1920,crop=1080:1920:(iw-1080)/2:0" output_vertical.mp4
Center-Crop a 9:16 Region from a Horizontal Video (No Scaling)
To cut a center 1080×1080 region out of a 1920×1080 video and make it vertical:
ffmpeg -i input.mp4 -vf "crop=1080:1080:(iw-1080)/2:(ih-1080)/2,scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(1080-iw)/2:(1920-ih)/2" output_vertical.mp4
Method 2: Black-Bar Padding (pad)
Shrink the entire video and add black bars on the top and bottom. Everything stays visible, but the black bars are conspicuous.
Fit a Horizontal Video into the Vertical Format with Black Bars
ffmpeg -i input.mp4 -vf "scale=1080:-2,pad=1080:1920:0:(1920-ih)/2:black" output_padded.mp4
Pad with a Colored Background
ffmpeg -i input.mp4 -vf "scale=1080:-2,pad=1080:1920:0:(1920-ih)/2:color=0x1a1a2e" output_padded_color.mp4
Method 3: Blurred-Background Padding (Recommended)
Use a blurred copy of the original video as the background, then overlay the original on top. There are no black bars, and the result looks visually natural.
ffmpeg -i input.mp4 -filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=20:3[bg];[0:v]scale=1080:-2[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2[out]" -map "[out]" -c:v libx264 -b:v 8M -pix_fmt yuv420p -c:a copy output_blur_bg.mp4
The processing flow of this method:
[bg]: Stretch the original video to 1080×1920 (ignoring the aspect ratio) and create the blurred background[fg]: Shrink the original video to a width of 1080 (preserving the aspect ratio)overlay: Composite it centered on top of the blurred background
Method 4: Crop at a Specific Position
When the subject is not centered, adjust the crop position.
Crop with the Left Side Prioritized (x=0)
ffmpeg -i input.mp4 -vf "scale=-1:1920,crop=1080:1920:0:0" output_left.mp4
Crop with the Right Side Prioritized
ffmpeg -i input.mp4 -vf "scale=-1:1920,crop=1080:1920:iw-1080:0" output_right.mp4
Crop at an Arbitrary x Coordinate
ffmpeg -i input.mp4 -vf "scale=-1:1920,crop=1080:1920:300:0" output_custom.mp4
Verifying the Aspect Ratio Precisely
ffmpeg -i input.mp4 -vf "crop=iw:ih*9/16:(iw-iw)/2:(ih-ih*9/16)/2" output.mp4
Keeping the Audio
You can preserve the audio in any of these commands by adding -c:a copy or -c:a aac -b:a 256k:
ffmpeg -i input.mp4 -vf "scale=-1:1920,crop=1080:1920:(iw-1080)/2:0" -c:v libx264 -b:v 8M -pix_fmt yuv420p -c:a aac -b:a 256k output_vertical.mp4
Basic Syntax of the crop Filter
crop=w:h:x:y
| Parameter | Description |
|---|---|
w | Width to crop |
h | Height to crop |
x | Crop start position (from the left) |
y | Crop start position (from the top) |
You can use variables such as iw (original width) and ih (original height).
Related Articles
- Scaling Video (the scale filter)
- Adding a Blur Effect with the boxblur Filter
- Rotating and Flipping Video (rotate/hflip/vflip)
Tested with: ffmpeg 6.1 / Ubuntu 24.04 (検証スクリプトで実行確認)
Primary sources: ffmpeg.org/ffmpeg-filters.html#crop / ffmpeg.org/ffmpeg-filters.html#pad
FAQ
What is the recommended resolution for TikTok?
1080×1920 (9:16) is the safest choice. Because TikTok re-encodes on its side, a bitrate of 5–8 Mbps is plenty.
Does converting horizontal video to vertical reduce quality?
If you are going in the direction of lower resolution (cropping), the degradation is essentially negligible. Conversely, the method of adding black bars on the top and bottom to reach 9:16 is not recommended — it worsens the viewing experience.
My vertical video shot on an iPhone plays sideways
The iPhone embeds “rotation metadata” when recording. Some players don’t read this and play the video sideways. The reliable approach is to physically rotate it on save with ffmpeg -i in.mov -metadata:s:v rotate=0 -vf transpose=1 out.mp4.
Should I create separate files for YouTube Shorts and TikTok?
In general, the same file is fine. Both platforms recommend 1080×1920; only the maximum length differs (Shorts up to 3 minutes (raised from 60s in late 2024) / TikTok 10 minutes). Choose based on the length of the video.
Which should I upload to first, Reels or Shorts?
Because platforms have algorithms that judge who the “original poster” is, we recommend uploading to your main platform first and posting to the others afterward.