DEV Community

Javid Jamae
Javid Jamae

Posted on • Originally published at ffmpeg-micro.com

Build a YouTube to TikTok Auto-Repost Pipeline (n8n + FFmpeg)

Originally published at ffmpeg-micro.com.

You post a YouTube video. Then you download it, crop it to vertical, and manually upload to TikTok. Every single time.

If you're posting three times a week, that's an hour of drag-and-drop work that adds zero creative value. The video already exists. You just need it in a different shape.

This guide builds an n8n workflow that watches your YouTube channel, crops new videos to 9:16 vertical format using the FFmpeg Micro API, and delivers them ready for TikTok. The whole thing runs hands-free once it's set up.

What You're Building

The pipeline has four stages:

  1. n8n watches your YouTube channel for new uploads
  2. The workflow grabs the video URL
  3. FFmpeg Micro crops it to 9:16 vertical (1080x1920)
  4. The output goes to Google Drive or directly to TikTok

Each stage is one node in n8n. Total setup time: about 30 minutes.

Step 1: YouTube Trigger

In n8n, add an RSS Feed Read node pointed at your YouTube channel's RSS feed:

https://www.youtube.com/feeds/videos.xml?channel_id=YOUR_CHANNEL_ID
Enter fullscreen mode Exit fullscreen mode

Set the polling interval to every 15 minutes. When a new video appears, this node fires and passes the video metadata downstream.

n8n doesn't have a native "YouTube upload" trigger, but the RSS feed is reliable and doesn't require OAuth or API credentials.

Step 2: Get the Video URL

The RSS feed gives you the YouTube watch URL, not a direct download link. You need the actual video file URL to send to FFmpeg Micro.

If your videos are already stored somewhere accessible (Google Drive, S3, or any public URL), use that URL directly and skip this step. This is the simplest path.

For YouTube-hosted videos, use a download service or self-hosted tool like yt-dlp running on your server. The output is a direct video URL that gets passed to the next node.

Step 3: Crop to Vertical with FFmpeg Micro

This is the core transformation. Add an HTTP Request node in n8n:

  • Method: POST
  • URL: https://api.ffmpeg-micro.com/v1/transcodes
  • Authentication: Header Auth, name Authorization, value Bearer YOUR_API_KEY
  • Body (JSON):
{
  "inputs": [{ "url": "{{ $json.videoUrl }}" }],
  "outputFormat": "mp4",
  "options": [
    { "option": "-vf", "argument": "crop=ih*9/16:ih,scale=1080:1920" },
    { "option": "-c:a", "argument": "copy" }
  ]
}
Enter fullscreen mode Exit fullscreen mode

The -vf crop=ih*9/16:ih,scale=1080:1920 filter does two things. First, it center-crops the frame to a 9:16 aspect ratio by calculating the width as ih*9/16 (input height times 9/16) and keeping the full height. Then it scales the result to exactly 1080x1920 pixels.

Audio stays untouched with -c:a copy. No re-encoding, no quality loss on the audio track.

FFmpeg Micro processes the video in the cloud and returns a job ID immediately. You don't wait for processing to finish in this node.

Step 4: Poll Until Complete

Transcode jobs are async. Add a loop in n8n to check when the job finishes.

Use a Wait node set to 10 seconds, followed by an HTTP Request node:

GET https://api.ffmpeg-micro.com/v1/transcodes/{{ $json.id }}
Enter fullscreen mode Exit fullscreen mode

Wire an IF node after the status check: if status is not completed, loop back to the Wait node. When it's done, move forward.

Then fetch the download URL:

GET https://api.ffmpeg-micro.com/v1/transcodes/{{ $json.id }}/download
Enter fullscreen mode Exit fullscreen mode

This returns a signed HTTPS URL valid for 10 minutes. Download the file in the next node before the link expires.

Step 5: Save or Publish

You now have a cropped, vertical MP4. Where it goes depends on your workflow:

Google Drive (recommended for most creators). Add a Google Drive upload node to drop the file into a "TikTok Ready" folder. Review the video, add captions and hashtags, then post from your phone.

Direct TikTok API. Use TikTok's Content Posting API to upload automatically. This requires a TikTok developer account and approved app. Add an HTTP Request node pointed at TikTok's upload endpoint with the video file.

Most solo creators start with Google Drive. It adds one manual step but gives you a chance to review before publishing.

Customizing the Crop

Center-crop works great for talking-head content where the speaker fills the middle of the frame. For other content types, adjust the filter:

Left-aligned crop (keep the left side of the frame):

{ "option": "-vf", "argument": "crop=ih*9/16:ih:0:0,scale=1080:1920" }
Enter fullscreen mode Exit fullscreen mode

Right-aligned crop (keep the right side):

{ "option": "-vf", "argument": "crop=ih*9/16:ih:iw-ih*9/16:0,scale=1080:1920" }
Enter fullscreen mode Exit fullscreen mode

Padding instead of cropping (adds black bars, keeps all content):

{ "option": "-vf", "argument": "scale=1080:-2,pad=1080:1920:(ow-iw)/2:(oh-ih)/2" }
Enter fullscreen mode Exit fullscreen mode

Talking head content = center crop. Screen recordings = padding. B-roll = test a few options and see what looks best.

Why This Pipeline Works

The YouTube to TikTok repost is one of the highest-leverage automations for solo creators. You already made the content. Cross-posting is distribution, not creation. The only thing stopping most people is the manual crop-and-upload friction.

n8n Cloud can't run FFmpeg directly, but it doesn't need to. The video processing happens on FFmpeg Micro's infrastructure. n8n just sends HTTP requests and orchestrates the flow. This works on both n8n Cloud and self-hosted n8n.

FFmpeg Micro is a cloud API that lets you add video processing to any app with a single HTTP call. No FFmpeg installation, no server management. Get a free API key and build this pipeline in under an hour.

FAQ

Can I use this for Instagram Reels and YouTube Shorts too?

Yes. The 9:16 vertical format at 1080x1920 is the standard for TikTok, Instagram Reels, and YouTube Shorts. Add more output nodes in your n8n workflow to deliver the same cropped video to multiple platforms.

How long does the crop take?

A 10-minute landscape video typically processes in 15 to 30 seconds. FFmpeg Micro auto-scales, so processing time stays consistent regardless of how many jobs you run in parallel.

What if my video is longer than 10 minutes?

FFmpeg Micro handles videos of any length. Longer videos take proportionally longer to process and use more API minutes. If you only want a clip, add -ss (start time) and -t (duration) options alongside the crop filter to trim and crop in a single pass.

Does n8n Cloud support this workflow?

Yes. n8n Cloud handles the orchestration (triggers, HTTP requests, logic). FFmpeg Micro handles the video processing in its own cloud. No binary installs or server access needed on the n8n side.

Do I need a TikTok developer account?

Only for automated posting. If you save to Google Drive and post manually from your phone, no TikTok credentials are needed. Most creators prefer the manual review step anyway since it lets them customize captions and hashtags per platform.

Top comments (0)