๐ŸŽฌ Automate S3 video transcoding, thumbnail generation & CDN distribution

โšก 52 views ยท ๐ŸŽฌ Content Creation & Video

Description

Video Processing Pipeline with Thumbnail Generation and CDN Distribution

Summary

Automated video processing system that monitors S3 for new uploads, generates thumbnails and preview clips, extracts metadata, transcodes to multiple formats, and distributes to CDN with webhook notifications.

Detailed Description

A comprehensive video processing workflow that receives S3 events or manual triggers, validates video files, extracts metadata via FFprobe, generates thumbnails at key frames, creates animated GIF previews, transcodes to multiple resolutions, invalidates CDN cache, and sends completion notifications.

Key Features

Use Cases

Required Credentials

Node Count: 24 (19 functional + 5 sticky notes)

Unique Aspects

Workflow Architecture

[S3 Event Webhook]    [Manual Webhook]
        |                   |
        +--------+----------+
                 |
                 v
         [Merge Triggers]
                 |
                 v
         [Extract S3 Info] (Code)
                 |
                 v
         [Check Is Video] (If)
              /         \
           Yes           No
            |             |
            v             v
[Get Video Metadata]  [Invalid Response]
    (FFprobe)              |
            |              |
            v              |
[Parse Video Metadata]     |
    (Code)                 |
       /|\                 |
      / | \                |
     v  v  v               |
[Thumbs][GIF][Transcode]   |
     \  |  /               |
      \ | /                |
       v v                 |
[Aggregate Results]        |
         |                 |
         v                 |
[Invalidate CDN Cache]     |
         |                 |
         v                 |
[Generate Signed URLs]     |
        / \                |
       /   \               |
      v     v              |
[Log Sheet] [Slack]        |
      \   /                |
       \ /                 |
        v                  |
[Merge Output Paths]       |
         |                 |
         +---------+-------+
                   |
                   v
         [Merge All Paths]
                   |
                   v
         [Respond to Webhook]

Configuration Guide

  1. S3 Event: Configure S3 bucket notification to send events to webhook
  2. FFmpeg API: Use a hosted FFmpeg service (e.g., api.ffmpeg-service.com)
  3. Cloudflare: Set zone ID and API token for cache invalidation
  4. Slack Channel: Set #video-processing for notifications
  5. Google Sheets: Connect for processing metrics logging

Supported Video Formats

ExtensionMIME Type
.mp4video/mp4
.movvideo/quicktime
.avivideo/x-msvideo
.mkvvideo/x-matroska
.webmvideo/webm
.m4vvideo/x-m4v

Thumbnail Generation

SizeDimensionsSuffix
Large1280x720_large
Medium640x360_medium
Small320x180_small

Thumbnails generated at: 10%, 30%, 50%, 70%, 90% of video duration

Transcoding Presets

PresetResolutionBitrateCodec
1080p1920x10805000kH.264
720p1280x7202500kH.264
480p854x4801000kH.264

Output Structure

{
  "job_id": "job_1705312000_abc123",
  "status": "completed",
  "original": {
    "filename": "video.mp4",
    "resolution": "1920x1080",
    "duration": "00:05:30"
  },
  "thumbnails": {
    "large": "https://cdn/thumbnails/job_id/thumb_0_large.jpg",
    "medium": "https://cdn/thumbnails/job_id/thumb_0_medium.jpg",
    "small": "https://cdn/thumbnails/job_id/thumb_0_small.jpg"
  },
  "preview_gif": "https://cdn/previews/job_id/preview.gif",
  "transcoded": {
    "1080p": "https://cdn/transcoded/job_id/video_1080p.mp4",
    "720p": "https://cdn/transcoded/job_id/video_720p.mp4",
    "480p": "https://cdn/transcoded/job_id/video_480p.mp4"
  }
}

๐Ÿ”— Nodes Used

Google Sheets, HTTP Request, Slack, Webhook

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup