Build a long-video to vertical-clips pipeline: metadata in, ranked 9:16 clips out A developer detailed a pipeline for converting long videos into ranked vertical clips using AI metadata from FastPix, including chapter detection, scene changes, and transcripts. The approach uses boolean flags on upload to get time-aligned metadata and a ranking function to select clip boundaries, with the ranking logic being the core challenge. TL;DR We'll upload a long recording with AI metadata flags on, catch the webhook, write a ranking function that picks clip boundaries from chapters + scene changes + transcript, and cut vertical clips. The ranking function is the part that matters; everything else is plumbing. Here is the naive version of this project: ffmpeg -ss 00:14:22 -to 00:14:52 -i webinar.mp4 -c copy clip.mp4 That's the cutting solved. Now watch the output: it starts four words into a sentence, opens on a hard cut to a slide, and ends mid-word. Six of those and you've built something nobody will use. The actual problem is choosing 00:14:22 . Let's build that. You'll need node 20.x or newer and ffmpeg 7.x or 8.x . Watch a human do this and they're checking three things: Three signals. Assemble them from three tools and you get three different clocks: Whisper timestamps drift against container PTS, PySceneDetect reports frame indices you convert with a frame rate that may be variable, and a tracker samples on its own interval. Joining them is where the week goes. So the design decision up front is: do you own the extraction, or get it pre-joined? I've been using FastPix for this because the AI capabilities are boolean flags on the upload call rather than a second pipeline you orchestrate. Same idea works with any provider that returns time-aligned metadata; the shape below is what to look for. curl -X POST 'https://api.fastpix.com/v1/on-demand' \ --user "$FASTPIX TOKEN ID:$FASTPIX SECRET" \ -H 'Content-Type: application/json' \ -d '{ "inputs": { "type": "video", "url": "https://cdn.example.com/webinar.mp4" } , "chapters": true, "accessPolicy": "private", "maxResolution": "1080p" }' { "success": true, "data": { "id": "a1d1acdd-8f4e-4add-b498-6b398cf349d9", "status": "Created", "createdAt": "2026-08-17T10:50:34.594302Z", "playbackIds": { "id": "6ta85f64-5717-4562-b3fc-2c963f66afa6", "accessPolicy": "private" } , "maxResolution": "1080p", "mediaQuality": "standard" } } Auth is Basic: Access Token ID as username, Secret Key as password. Playback is https://stream.fastpix.com/