Skip to content
NewA realistic 3D head for a free swim cap editor
Nov 30, 2026·4 MIN READ
Turning a horizontal swim clip into a vertical reel with ffmpeg

Turning a horizontal swim clip into a vertical reel with ffmpeg

I reframed a 30-second underwater clip from 16:9 to 9:16 in three tries. The crop looked best until the end card, where the text no longer fit. Watch the whole clip before you pick a crop.

I had a 29-second underwater clip from the pool: 1920x1080, HEVC, 30 fps, with a "Have a good week" card at the end. Instagram wants 1080x1920. I asked Claude Code to reframe it with ffmpeg, and it took three versions to get it right.

Three ways to fill a vertical frame

VersionWhat the middle showsFace sizeProblem
Crop to 9:16a 608 px strip from the centre100%sides of the frame are lost
Blurred backgroundthe full 16:9 frameabout 32%looks flat and dull
Shimmering backgroundthe full 16:9 frameabout 32%none, this one shipped

The crop was my first pick. The face sits in the middle of the frame, so a centre strip of 608x1080, scaled up to 1080x1920, fills the phone screen with a big smile. It looked great at the 10-second mark.

crop to 9:16
ffmpeg -i in.mov \
  -vf "crop=608:1080:(iw-608)/2:0,scale=1080:1920:flags=lanczos" \
  -c:v libx264 -crf 18 -pix_fmt yuv420p -c:a aac out.mp4

The end card broke the crop

My next idea was a softer zoom: the clip as a 1080x1000 band, with something moving above and below it. Then I looked at the last seconds. The end card text runs across the whole width of the 16:9 frame. Any crop cuts it to "e a g... week".

So the middle had to stay the full frame, no zoom at all. The only thing left to work on was the empty space above and below it.

A background that moves

The plain blurred copy of the video looked dead. What fixed it was the hue filter with a time expression. The background is a strongly blurred, zoomed copy of the clip, with saturation pushed up, and its hue swings slowly with a sine wave, so the colours drift between blue, green and red like light on water.

flowchart LR
    A[Source 16:9] --> B[split]
    B --> C["Scale to fill 9:16<br/>blur, saturate, hue sine"]
    B --> D["Scale to 1080 wide<br/>no crop"]
    C --> E[overlay in the centre]
    D --> E
    E --> F[1080x1920 MP4]
full frame on a shimmering background
ffmpeg -i in.mov -filter_complex "
  [0:v]split[a][b];
  [a]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,
     gblur=sigma=45,eq=saturation=1.8:brightness=0.03:contrast=1.1,
     hue=h='50*sin(2*PI*t/5)':s='1+0.3*sin(2*PI*t/3)'[bg];
  [b]scale=1080:-2[fg];
  [bg][fg]overlay=0:(H-h)/2" \
  -c:v libx264 -crf 18 -pix_fmt yuv420p -c:a aac -movflags +faststart out.mp4

After each render, grab frames at a few timestamps and put them side by side with hstack. One look at a strip of frames from 2, 8 and 28 seconds tells you more than playing the whole clip again.

At the end you can see a blurred copy of the card text in the bottom background. I kept it, but if it bothers you, freeze or recolour the background for the last seconds.

Music goes in the app

The last step was music. I wanted a commercial song, and the only copy I found was on YouTube, uploaded by a fan channel. I did not rip it. Instagram's own Audio picker has the song, licensed, and the reel will not get muted later. So the MP4 goes out with its original sound, and the song gets added on the phone.

What it took

Three renders, a few minutes each, and one screenshot of the end card that changed the plan. Next time I will scrub to the last frame before I decide anything. Titles, logos and end cards are exactly the parts a crop hurts most, and they are usually at the end of a clip.

Share
Mariusz Smenżyk
Written by

Mariusz Smenżyk

Builder for sport. Make. Test. Launch.

Related notes