Overview & Architecture
Every long video has a few moments that would work on their own as a Short. Finding them means scrubbing through the whole thing, and cutting them means another round in the editor. Both are repeatable work.
This blueprint connects a watch folder, a local Whisper transcription server, a local Ollama model and a small ffmpeg service to n8n. Drop a video into a folder and it ends with up to three vertical 1080x1920 clips in an output folder and a Discord message listing them. Everything except that Discord message stays on your own hardware, and nothing is uploaded for you: you review the clips and post the ones you like.
In testing, an 8:10 video (88 MB) became an 80-line transcript, the model picked three highlights, and three clips of 15, 28 and 19 seconds were cut. The whole run took about 3 minutes; the cutting step took about 100 seconds.
The Pipeline
- Watch Folder Trigger: The n8n Local File Trigger notices a new video in the Shorts inbox and waits until it has finished copying. A manual trigger runs the same flow on a test video.
- Settings in One Place: A Create Job node holds the Whisper and Ollama models, the language, the clip length (10 to 45 seconds), the maximum number of clips (3) and the layout.
- Local Transcription: The video goes to a Speaches (faster-whisper) container running
faster-distil-whisper-large-v3, and a Code node turns the result into a transcript with start and end seconds on every line. - AI Picks the Highlights: Ollama, running
gemma4:12b, reads the timestamped transcript and returns the best self-contained moments as JSON. - Range Validation: A Code node checks every range and drops the ones that are too short, too long, past the end of the video or overlapping, then names the clips.
- Vertical Clips: An HTTP Request sends the ranges to ffmpeg-worker, a small container that cuts each one into a 1080x1920 clip with a blurred background and saves it to the output folder.
- Discord Report: A Discord message lists each clip with its title, length and file path, or posts the error if any step failed.
What You Need
- Docker and Docker Compose with n8n and Ollama running (built and tested on n8n 2.43.5)
- Speaches (local Whisper) with the
Systran/faster-distil-whisper-large-v3model - A local Ollama model that returns JSON reliably (tested with
gemma4:12b-it-qat) - The ffmpeg-worker container (download below, plus the example Dockerfile in the assistant prompt)
- A Discord webhook for the notifications
Key Deployment Hurdles & Solutions
- n8n Can’t Run ffmpeg on Its Own: Since n8n 2.0 the Execute Command node is disabled by default, and turning it on hands the workflow a shell. Instead, a tiny ffmpeg-worker service accepts only fixed requests over HTTP, and its new
/trimendpoint does the cutting. Both containers share one folder, and the worker refuses any path outside it. - Clip Limits That Fit the Video: The first test used a 53-second sample with clips of 20 to 60 seconds. The model picked good 12 to 17 second moments, and the validator rejected every one. Lowering the limits to 10 to 45 seconds and testing with a real 8-minute video fixed it. If you see “Dropped range” in Discord, compare it with your limits.
- A Discord Node That Crashed: The failure branch first stopped with
Cannot read properties of undefined (reading 'execute')because the Discord node had been saved with an operation that does not exist. Re-selecting the send-message operation fixed it. The assistant prompt lists this and the other error messages with their fixes. - Local Model Output You Can Trust: Even in JSON mode the model wrapped its answer in a code fence. The validator pulls the JSON out, accepts seconds or
m:ss, and checks every range before ffmpeg ever runs. - Safe Re-runs: ffmpeg-worker never overwrites a clip that already exists and only runs one job at a time, so a duplicate or overlapping run fails loudly in Discord instead of replacing your files.
Download the Workflow (.json)
Import-ready n8n workflow with all 16 nodes, grouped and labeled. In n8n choose Import from file, add your own Ollama and Discord Webhook credentials, and set your model, clip lengths and number of clips in the Create Job node.
Download the n8n workflow (.json)
The workflow needs the ffmpeg-worker service to cut the clips. It is a single Python file with no dependencies beyond ffmpeg; the assistant prompt includes a tested example Dockerfile and Compose service.
Download ffmpeg-worker (worker.py)
Download the Companion System Prompt (.md)
Enter your first name to personalize the Shorts-creator assistant prompt so your AI helper can walk you through the Docker, Whisper, Ollama, ffmpeg-worker and n8n setup step by step, and help you read the error messages. Add your email optionally to get notified when new home lab blueprints drop.