workflows.fit
Back to n8n workflows
n8n templateFreeBy WeblineIndia

Automate video uploads to thumbnails with FFmpeg and Google Drive

Automate Video Upload → Auto-Thumbnail → Google Drive This workflow accepts a video via HTTP upload, verifies it’s a valid video, extracts a thumbnail frame at the 5-second mark using FFmpeg (auto-installs a static bu...

Data & StorageDevelopmentCore NodesUtilitySticky NoteWebhookIfWrite Binary File
Loading interactive preview...

Template notes

Automate Video Upload → Auto-Thumbnail → Google Drive

This workflow accepts a video via HTTP upload, verifies it’s a valid video, extracts a thumbnail frame at the 5-second mark using FFmpeg (auto-installs a static build if missing), uploads the image to a specified Google Drive folder and returns a structured JSON response containing the new file’s details.

Who’s it for

Marketing / Social teams who need ready-to-publish thumbnails from raw uploads. Developers who want an API-first thumbnail microservice without standing up extra infrastructure. Agencies / Creators standardizing assets in a shared Drive.

How it works

1. Accept Video Upload (Webhook) Receives multipart/form-data with file in field media at /mediaUpload. Response is deferred until the final node. 2. Validate Upload is Video (IF) Checks {{$binary.media.mimeType}} contains video/. Non-video payloads can be rejected with HTTP 400. 3. Persist Upload to /tmp (Write Binary File) Writes the uploaded file to /tmp/&lt;originalFilename or input.mp4&gt; for stable processing. 4. Extract Thumbnail with FFmpeg (Execute Command) Uses system ffmpeg if available; otherwise downloads a static binary to /tmp/ffmpeg. Runs: ffmpeg -y -ss 5 -i <video -frames:v 1 -q:v 2 /tmp/thumbnail.jpg 5. Load Thumbnail from Disk (Read Binary File) Reads /tmp/thumbnail.jpg into the item’s binary as thumbnail. 6. Upload Thumbnail to Drive (Google Drive) Uploads to your target folder. File name is &lt;original&gt;-thumb.jpg. 7. Return API Response (Respond to Webhook) Sends JSON to the client including Drive file id, name, links, size, and checksums (if available).

How to set up

1. Import the workflow JSON into n8n. 2. Google Drive Create (or choose) a destination folder; copy its Folder ID. Add Google Drive OAuth2 credentials in n8n and select them in the Drive node. Set the folder in the Drive “Upload” node. 3. Webhook The endpoint is POST /webhook/mediaUpload. Test: bash curl -X POST https://YOUR-N8N-URL/webhook/mediaUpload \ -F "media=@/path/to/video.mp4" 4. FFmpeg Nothing to install manually: the Execute Command node auto-installs a static ffmpeg if it’s not present. (Optional) If running n8n in Docker and you want permanence, use an image that includes ffmpeg. 5. Response body The Respond node returns JSON with file metadata. You can customize the fields as needed. 6. (Optional) Non-video branch On the IF node’s false output, add a Respond node with HTTP 400 and a helpful message.