DEV Community

Javid Jamae
Javid Jamae

Posted on • Originally published at ffmpeg-micro.com

Auto-Publish 30 YouTube Shorts Per Week from One Long Video

Originally published at ffmpeg-micro.com

One 30-minute video contains enough material for 30+ YouTube Shorts. Most creators leave that content on the table because splitting, captioning, and publishing 30 clips manually takes hours. With n8n and FFmpeg Micro, you can automate the entire pipeline: split the long video, add captions to each clip, and schedule them for auto-publish.

The Pipeline at a Glance

  1. Split a long video into 30-60 second clips using FFmpeg Micro's trim and crop operations
  2. Caption each clip with burned-in subtitles using Whisper transcription
  3. Publish each captioned clip to YouTube on a schedule via the YouTube Data API

The whole thing runs in n8n, triggered by dropping a video URL into a webhook or a Google Drive folder.

Step 1: Split the Long Video into Clips

Use FFmpeg Micro's transcription endpoint to generate an SRT file and identify natural break points:

curl -X POST https://api.ffmpeg-micro.com/v1/transcribe \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"media_url": "https://storage.googleapis.com/your-bucket/long-video.mp4"}'
Enter fullscreen mode Exit fullscreen mode

Then trim each clip:

curl -X POST https://api.ffmpeg-micro.com/v1/transcodes \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": [{"url": "https://storage.googleapis.com/your-bucket/long-video.mp4"}],
    "outputFormat": "mp4",
    "options": [
      {"option": "-ss", "argument": "00:02:15"},
      {"option": "-t", "argument": "45"},
      {"option": "-vf", "argument": "crop=ih*9/16:ih"},
      {"option": "-c:v", "argument": "libx264"},
      {"option": "-preset", "argument": "fast"}
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

One API call per clip. 45 seconds, 9:16 vertical, H.264.

Step 2: Add Captions

Transcribe each clip individually, then burn subtitles back in with FFmpeg Micro's text overlay.

Step 3: The n8n Workflow

Six nodes: Webhook trigger, HTTP Request (transcribe), Wait (poll), Code (parse SRT), Loop (trim+caption each clip), YouTube upload (scheduled publish).

const totalDuration = $input.first().json.duration;
const CLIP_DURATION = 45;
const segments = [];

for (let i = 0; i < Math.floor(totalDuration / CLIP_DURATION); i++) {
  const startSeconds = i * CLIP_DURATION;
  const hours = String(Math.floor(startSeconds / 3600)).padStart(2, '0');
  const mins = String(Math.floor((startSeconds % 3600) / 60)).padStart(2, '0');
  const secs = String(startSeconds % 60).padStart(2, '0');
  segments.push({
    clipNumber: i + 1,
    startTime: `${hours}:${mins}:${secs}`,
    duration: CLIP_DURATION
  });
}
return segments.map(s => ({ json: s }));
Enter fullscreen mode Exit fullscreen mode

Cost Breakdown

For a 30-minute source video producing 30 clips: ~96 billable minutes total. One video per month fits in FFmpeg Micro's free tier (100 min/mo). Weekly production needs the Pro plan at $19/month.

FAQ

How many YouTube Shorts can I make from a 30-minute video?
30-40 Shorts at 45-60 seconds each.

Do I need to install FFmpeg?
No. FFmpeg Micro is a cloud API. HTTP requests from n8n handle everything.

Can I use Make.com instead of n8n?
Yes. FFmpeg Micro has an official Make.com app.

Top comments (0)