ffmpeg Commands: Turn a 16:9 Video Into Vertical 9:16 Shorts
Tested, copy-paste ffmpeg commands to cut a clip from a 16:9 video you own, reframe it to 1080x1920, burn in captions and encode it for upload.
Short answer
Seek to the start with -ss before -i, set a length with -t, then reframe with a crop (center cut) or a blur-and-overlay filtergraph (full frame kept), scale to 1080x1920, add the subtitles filter for captions, and encode with libx264, yuv420p, AAC and +faststart. Every command below was run and probed.
Before you start
Use these commands only on footage you own or have the rights to use: your own podcast, webinar, coding tutorial, cooking show or stream. The examples assume a 16:9 file called input.mp4 (1920x1080) and write clip.mp4. If you have not yet decided which window to cut, read which part of a long video to clip first, or paste a transcript into the free clip moment finder (rule-based, runs in your browser) to get candidate windows.
We tested every command on a synthetic 20-second 1920x1080 file (a test pattern plus a sine tone) and checked each result with ffprobe. The version is listed in the Sources section. Different builds or very different inputs can behave differently, so run a short test clip first.
1. Cut a window by start and length
This cuts 10 seconds starting at the 5-second mark. For a long file, put the timestamp as HH:MM:SS, for example -ss 00:41:20.
ffmpeg -ss 5 -i input.mp4 -t 10 \
-c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p \
-c:a aac -b:a 128k -movflags +faststart clip.mp4-ss 5before-i: seek in the input to 5 seconds. The ffmpeg documentation says most formats cannot seek exactly, so ffmpeg seeks to the nearest point before it, and when transcoding it decodes and discards the extra segment (accurate seek is the default).-t 10: keep 10 seconds of output.- The encoder flags are explained in step 6.
If you prefer an end time, put -to 15 after -i (as an output option) together with -ss 5 after -i. That form also worked in our test and produced a 10-second clip, but it decodes from the start of the file, so it is slower on long videos:
ffmpeg -i input.mp4 -ss 5 -to 15 \
-c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p \
-c:a aac -b:a 128k -movflags +faststart clip.mp4The output of this step is still 1920x1080. Steps 2-4 turn it vertical.
2. Centered 9:16 crop
The simplest reframe: keep a full-height vertical strip from the middle of the frame and scale it to 1080x1920.
ffmpeg -ss 5 -i input.mp4 -t 10 \
-vf "crop=ih*9/16:ih:(iw-ih*9/16)/2:0,scale=1080:1920,setsar=1" \
-c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p \
-c:a aac -b:a 128k -movflags +faststart clip.mp4crop=w:h:x:y: output widthih*9/16(a 9:16 strip as tall as the source), full heightih, starting atx=(iw-w)/2so it is centered. For a 1920x1080 source the strip is about 607 pixels wide.scale=1080:1920: enlarge the strip to the vertical canvas. A 607x1080 strip is enlarged by roughly 1.8x, so the result will look noticeably softer than the source.setsar=1: force square pixels so players do not stretch the picture.
To move the window left or right, replace the x expression with a fixed number of pixels, for example crop=ih*9/16:ih:300:0.
3. Blurred-background "fit" layout
If cropping would cut off something important (a slide, a screen recording, a wide shot), keep the whole 16:9 frame in the middle and fill the space above and below with a blurred, enlarged copy of the same video.
ffmpeg -ss 5 -i input.mp4 -t 10 \
-filter_complex "[0:v]split=2[bg][fg];\
[bg]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=30:5[bgb];\
[fg]scale=1080:-2[fgs];\
[bgb][fgs]overlay=(W-w)/2:(H-h)/2,setsar=1[v]" \
-map "[v]" -map 0:a \
-c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p \
-c:a aac -b:a 128k -movflags +faststart clip.mp4split=2[bg][fg]: duplicate the video into a background copy and a foreground copy.scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920: enlarge the background until it covers the whole 1080x1920 canvas, then trim the overflow.boxblur=30:5: blur the background. The first number is the box radius in pixels and the second is how many times the blur is applied; raise the radius for a softer background.scale=1080:-2: fit the foreground to 1080 pixels wide, with the height calculated to keep the aspect ratio (and kept even, which H.264 with yuv420p needs).overlay=(W-w)/2:(H-h)/2: place the foreground in the center of the background.-map "[v]" -map 0:a: use the filtered video and the original audio. When you use-filter_complexyou must pick the streams yourself.
4. Stacked layout for two speakers (optional)
For a side-by-side interview, you can crop the left and right halves of the frame and stack them: speaker A on top, speaker B below. This assumes each person sits inside their half of the frame, which you must check yourself.
ffmpeg -ss 5 -i input.mp4 -t 10 \
-filter_complex "[0:v]split=2[a][b];\
[a]crop=960:854:0:113,scale=1080:960[top];\
[b]crop=960:854:960:113,scale=1080:960[bot];\
[top][bot]vstack=inputs=2,setsar=1[v]" \
-map "[v]" -map 0:a \
-c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p \
-c:a aac -b:a 128k -movflags +faststart clip.mp4crop=960:854:0:113andcrop=960:854:960:113: take the left and right 960-pixel halves of a 1920x1080 frame, 854 pixels tall, starting 113 pixels down so the crop is vertically centered. Adjust the y value (113) to move the window up or down.scale=1080:960: each half becomes 1080x960, so the two halves together are exactly 1080x1920.vstack=inputs=2: stack the two inputs vertically. The ffmpeg documentation says all inputs must share the same pixel format and width, which the scale step guarantees.
The numbers above are for a 1920x1080 source. For other sizes, recompute the crop dimensions so each tile has a 9:8 shape (half of a 9:16 canvas).
5. Burn in an SRT or ASS file
"Burned in" means the captions become part of the picture, so they show on any platform. Save your captions as captions.srt. Make sure the timestamps are relative to the start of the clip (step 1 resets the timeline to 0):
1
00:00:01,000 --> 00:00:04,000
First caption line
2
00:00:05,000 --> 00:00:08,000
Second caption lineCut, center-crop and caption in one pass:
ffmpeg -ss 5 -i input.mp4 -t 10 \
-vf "crop=ih*9/16:ih:(iw-ih*9/16)/2:0,scale=1080:1920,setsar=1,subtitles=captions.srt:force_style='FontName=Arial,FontSize=14,Alignment=2,MarginV=120,Outline=2'" \
-c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p \
-c:a aac -b:a 128k -movflags +faststart clip.mp4The same subtitles=... filter can be appended to the end of the blurred-background filtergraph (put it right after setsar=1 inside the final chain, before [v]); we tested that as well.
subtitles=captions.srt: the filter draws subtitles on the video using the libass library. ffmpeg converts the SRT to ASS internally. Your ffmpeg build must include libass (--enable-libass).force_style: overrides style parameters with ASS style KEY=VALUE pairs separated by commas.Alignment=2is bottom-center,MarginV=120lifts the text off the bottom edge,Outline=2adds a border. TuneFontSizeby eye on a test frame.- Already have an ASS file? Use
ass=captions.assinstead ofsubtitles=.... We converted our SRT withffmpeg -i captions.srt captions.assand burned it withass=captions.asswithout errors.
Captions are only as good as the transcript you feed in. Check names, numbers and line breaks before you render, because a typo is baked into every frame.
6. Encode settings for upload
These are the encoder flags used in every command above:
-c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart-c:v libx264: H.264 video encoded with x264. Requires an ffmpeg build with libx264.-preset medium: the default speed-versus-compression trade-off. Slower presets give smaller files at the same quality.-crf 20: constant-quality mode. The H.264 guide describes a 0-51 scale with 23 as the default, a sane range of 17-28, and lower numbers meaning higher quality and bigger files.-pix_fmt yuv420p: 8-bit 4:2:0 pixels. The H.264 guide notes that yuv420p or similar means 8-bit output, the common case; setting it explicitly avoids ending up with a different pixel format from an unusual source.-c:a aac -b:a 128k: AAC audio at 128 kbit/s.-movflags +faststart: moves the MP4 index (the moov atom) to the start of the file so playback can begin before the whole file has downloaded. We confirmed the moov atom sits before the media data in our output.
To confirm what you produced, run:
ffprobe -v error -show_entries stream=codec_name,width,height,pix_fmt -show_entries format=duration -of csv=p=0 clip.mp4For the commands above the result was h264,1080,1920,yuv420p, aac, and a duration of 10 seconds. (The first-pass cut in step 1 reports 1920,1080 because it is not yet reframed.) Check the current upload requirements of each platform yourself before you publish; this post does not list them.
What ffmpeg will not do for you
- It does not find the moment. You pick every start and length by hand, so you have to watch or read the video first.
- The center crop cuts off anything off-center. There is no face tracking or speaker detection in these commands. A speaker who sits to one side needs a manual x offset, the blurred-background layout, or the stacked layout.
- No transcript. The
subtitlesfilter only draws a caption file you provide; it does not transcribe speech. - Upscaling softens the picture. A 1080p source cropped to a vertical strip is enlarged by roughly 1.8x to reach 1080x1920.
- Every clip is a separate command. Ten clips means ten commands (or a script of your own).
Sources
Tested with ffmpeg 8.0.1 (ffmpeg version 8.0.1 Copyright (c) 2000-2025 the FFmpeg developers) on 30 October 2026, on macOS arm64, using a synthetic 20-second 1920x1080 test source and a two-line SRT. Every published command exited with code 0, and ffprobe reported h264, 1080x1920, yuv420p, aac and a 10-second duration for the vertical outputs.
- FFmpeg Filters Documentation (crop, scale, boxblur, split, overlay, vstack, subtitles, ass): https://ffmpeg.org/ffmpeg-filters.html (read 30 October 2026)
- ffmpeg Documentation (-ss, -t, -to, -accurate_seek, -map): https://ffmpeg.org/ffmpeg.html (read 30 October 2026)
- FFmpeg Formats Documentation (MOV/MP4 muxer, faststart): https://ffmpeg.org/ffmpeg-formats.html (read 30 October 2026)
- FFmpeg H.264 Video Encoding Guide (CRF, presets, faststart): https://trac.ffmpeg.org/wiki/Encode/H.264 (read 30 October 2026)
Frequently asked questions
Why is -ss placed before -i in these commands?
Placed before -i, -ss seeks in the input, which is fast even in a long file. The ffmpeg documentation notes that most formats cannot seek exactly, so ffmpeg goes to the closest seek point before your position; when you re-encode (as every command here does) accurate seeking is on by default and the extra frames up to your position are decoded and discarded. With stream copy (-c copy) that extra segment is kept, so copied cuts can start slightly early.
Can I cut without re-encoding to keep full quality?
You can use -c copy to cut without re-encoding, but it cannot be combined with cropping, blurring or burned-in captions, because those change the pixels. Cropping to vertical and burning captions always means re-encoding the video, so choose a low CRF value (the H.264 guide describes 17-18 as visually lossless or nearly so) if you want to keep quality high.
Why does my SRT appear at the wrong time in the clip?
With -ss before -i, the clip's timeline starts at 0. Your SRT timestamps must be relative to the start of the clip, not to the start of the original video. In our test, a caption timed at 00:00:01 appeared one second into the cut clip. If you have timestamps from the full video, subtract the clip start time from each one.
Can I use these commands on any video I find online?
Only on footage you own or have the rights to use. These commands are meant for cutting your own podcasts, webinars, tutorials and streams into short vertical clips. They do nothing to give you the right to republish someone else's video.
Does ffmpeg keep the speaker in frame when it crops to vertical?
No. The crop in step 2 is a fixed rectangle at the center of the frame; it does not detect or follow faces. If the speaker sits off-center, change the x offset in the crop filter by hand, use the blurred-background layout in step 3 so nothing is cut off, or use the stacked layout in step 4 for two people.
Written by RemixViral Team
Related Articles
Which Part of a Long Video Should You Clip?
Pick the moment before you cut it.
Ideal Short Video Length by Platform (2026)
How long a clip should actually be, per platform.
Free Clip Moment Finder
Paste a transcript, get ranked clip windows and ffmpeg commands in your browser.
RemixViral vs OpusClip
Two clippers for videos you own, with OpusClip's prices read from its pricing page.
RemixViral Pricing
Plans, credits and the $5 trial start terms.