Turn Long Videos Into Vertical Clips: How Our Pipeline Works

Convert horizontal webinars and interviews into vertical short clips with burned subtitles. Learn how our background worker extracts audio, transcribes speech, and crops video.

5 min read

You finish recording a 45-minute product demo or podcast interview, and now you have to find five punchy vertical moments for TikTok, Instagram Reels, and YouTube Shorts. Scrubbing through an hour of timeline in Premiere or DaVinci Resolve takes the rest of your afternoon.

I built our automated clip generator to turn any long video in your Postonus media library into vertical clips in minutes. You select a video, choose how many clips you want, and our background worker handles transcription, moment picking, center-cropping, and subtitle burn-in.


Why vertical clips matter for creators

Long horizontal videos contain your best product demonstrations, customer interviews, and conference talks. But mobile audiences discover content through vertical algorithmic feeds like Instagram Reels, YouTube Shorts, and TikTok.

Repurposing this footage manually is repetitive work. You have to export audio, generate subtitles in third-party web apps, trim video boundaries, center the speaker, and render separate video files.

Most teams either abandon vertical video completely or pay expensive monthly retainers to agency editors. I wanted Postonus to do this heavy lifting natively inside your content calendar.

When you upload a widescreen video up to ninety minutes long, Postonus can extract one to five short clips between twenty and sixty seconds in duration. Each clip comes pre-formatted in 1080x1920 vertical resolution with animated captions burned into the lower third.


What did not work on the first try

Building a reliable video rendering pipeline revealed several edge cases in production.

Our first implementation suffered from a subtle race condition during job creation. The application checked whether an active clip job existed for a workspace, and if none was found, inserted a new row.

Under concurrent requests, two workers could pass the validation check at the exact same millisecond. This allowed a workspace to trigger multiple heavy video jobs simultaneously, violating our concurrency limits.

I solved this by adding a partial unique database index on clip_job for the organization identifier where the status is queued or processing. Now the database guarantees mutual exclusion, and the second request receives a clean conflict response.

An even nastier bug appeared in our credit refund system. In plan 037, generating clips costs one AI credit per clip. If a job failed, our worker called failClipJob to return those credits to the workspace balance.

However, we also run an automated cleanup sweep that detects stale jobs stuck in processing for more than two hours. The sweep marked the job as failed and refunded the credits. When the original worker process finally timed out, it called failClipJob again, giving the user a double refund.

In commit c075c29b3, I refactored the worker lifecycle. Credit refunds now strictly follow the worker state transition. If a job is already in the failed state, the refund logic exits early so credits are never refunded twice.


The five stages of the clip pipeline

Our clip processing pipeline runs entirely inside isolated background workers using ffmpeg and speech models.

1. Audio extraction

When a job starts, the worker resolves the source video from our object storage bucket. It invokes ffmpeg to extract a sixteen kilohertz mono audio stream encoded in Opus format.

Extracting lightweight audio first keeps memory overhead low. It avoids sending multi-gigabyte video files across internal service boundaries.

2. Transcription with word timestamps

The worker submits the extracted audio stream to Groq running Whisper Large V3 Turbo. If the video is longer than ten minutes, our audio utility chunks the stream cleanly at quiet intervals before submitting.

Whisper returns a complete transcript with millisecond-level word start and end timestamps. These precise timestamps ensure that sentence boundaries match the speaker cadence.

3. Moment selection

Once the transcript is ready, the worker passes the text to Gemini 2.5 Flash-Lite. The model reviews the dialogue to locate the most engaging self-contained thoughts.

The prompt instructs the model to identify hooks that answer a specific question, share a surprising insight, or deliver a clear technical explanation. The returned start and end points snap automatically to the nearest word boundary so sentences never cut off mid-word.

4. Center-crop and subtitle burn-in

With time boundaries established, ffmpeg performs a single-pass video render for each clip.

The video filter applies a 9:16 aspect ratio crop centered on the frame, scaling the output to 1080x1920 resolution. Simultaneously, the worker builds an Advanced SubStation Alpha subtitle file.

The subtitle styling renders two to four words per line in the lower third of the video with high-contrast text outlines. Ffmpeg burns these subtitles directly into the video stream and encodes the result using faststart flags for rapid mobile playback.

5. Media library cataloging

Each rendered clip is saved back to your workspace storage bucket as an independent video asset.

The clip appears in your media library as a child asset linked to the original source recording. You can preview the video directly, adjust the generated caption text, and schedule the clip across your connected social channels with one click.


Error handling and credit safety

Video rendering can fail for many external reasons, such as corrupted video codecs or missing audio tracks. Postonus handles these failures safely without wasting your balance.

Every clip generation job requires available AI credits. When you initiate a five-clip job, the platform reserves five credits up front.

If ffmpeg encounters an unsupported container format or missing subtitle libraries, the job transitions to the failed state with a typed error code like captions unsupported. The worker immediately refunds all unused credits back to your workspace balance.

You can inspect the full error details in your media panel without guessing why a render stopped.

Try this in Postonus to turn your existing long videos into engaging vertical clips for social channels.