remotionreactserverlessvideo-processingbucket-outcome

Remotion + FFmpeg Micro: Programmatic Video Without the Lambda Bill

·Javid Jamae·7 min read
Remotion + FFmpeg Micro: Programmatic Video Without the Lambda Bill

Remotion lets you build videos the same way you build React components. But moving those compositions from your local dev server to a production pipeline usually means setting up AWS Lambda, managing cold starts, and watching your bill climb with every render. The post-processing step, compressing, converting, and combining your rendered output, doesn't need any of that infrastructure. FFmpeg Micro handles it with a single API call.

TL;DR: Use Remotion to compose and render your videos. Use FFmpeg Micro's API to compress, convert, add audio, and batch-process the output. No Lambda configuration, no self-hosted FFmpeg binaries, no DevOps overhead.

Where Remotion Ends and FFmpeg Starts

Remotion is a composition and rendering tool. You define scenes in React, animate them with code, and export frames to video. It's excellent at that job.

But rendering is only half the pipeline. After Remotion hands you an MP4, you still need to compress it for delivery, convert it to WebM for browser compatibility, mix in a background music track, or pull a thumbnail frame for your Open Graph tags. That's FFmpeg territory.

The traditional approach is to install FFmpeg on a server, write shell scripts, and manage the infrastructure yourself. Or you bolt FFmpeg onto the same Lambda setup you're already using for Remotion rendering, adding complexity to a system that's already complex enough.

FFmpeg Micro gives you a REST API instead. POST your video URL, specify what you want, and poll for the result. It runs on managed infrastructure, so you don't install anything.

Compress Remotion Output

Remotion renders tend to be large. A 60-second 1080p composition can easily produce a 200MB+ file because Remotion prioritizes quality over file size during rendering. That's fine for an intermediate artifact, but you can't serve a 200MB video to users.

FFmpeg Micro's preset system handles compression in one call:

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://your-bucket.s3.amazonaws.com/remotion-render.mp4"}],
    "outputFormat": "mp4",
    "preset": {"quality": "high", "resolution": "1080p"}
  }'

The quality preset maps to a sensible CRF value and encoding configuration, so you don't need to memorize FFmpeg flags. For most Remotion output, the "high" preset cuts file size by 60-80% with no visible quality loss.

For more control over compression settings, see the full guide on compressing video with the FFmpeg Micro API.

Convert to WebM or MOV

Remotion outputs MP4 by default. If you need WebM for better browser-native playback or MOV for Apple ecosystem delivery, change the outputFormat and specify your codec:

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://your-bucket.s3.amazonaws.com/remotion-render.mp4"}],
    "outputFormat": "webm",
    "options": [
      {"option": "-c:v", "argument": "libvpx-vp9"},
      {"option": "-crf", "argument": "30"},
      {"option": "-b:v", "argument": "0"}
    ]
  }'

Setting -b:v to 0 tells VP9 to use constant quality mode, letting the CRF value drive the quality-to-size tradeoff. This is the recommended approach for WebM encoding when you care more about consistent quality than hitting a specific bitrate target.

Need to support multiple formats from a single Remotion render? Fire off parallel API calls for each format. The format conversion guide covers the full set of supported output types.

Add Background Audio to a Rendered Video

Remotion supports audio in compositions, but sometimes you want to add music or voiceover after rendering. Maybe your audio asset wasn't ready during the render step. Maybe you're A/B testing different background tracks against the same video.

FFmpeg Micro accepts multiple inputs, so you can merge a video and audio file in a single request:

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://your-bucket.s3.amazonaws.com/remotion-render.mp4"},
      {"url": "https://your-bucket.s3.amazonaws.com/background-music.mp3"}
    ],
    "outputFormat": "mp4",
    "options": [
      {"option": "-shortest", "argument": ""}
    ]
  }'

The -shortest flag trims the output to the length of the shorter input, so a 3-minute music track won't extend a 45-second video with silence. The API supports up to 10 inputs per request, which also opens the door to concatenating separately rendered Remotion segments (intros, outros, chapters) into a single deliverable.

More audio mixing patterns are covered in the audio merging guide.

Batch Processing Personalized Videos

This is where the Remotion + FFmpeg Micro combination really shines. Say you're rendering 500 personalized onboarding videos, each with a different user's name and data. Remotion handles the personalized rendering. FFmpeg Micro handles the post-processing at scale.

A simple TypeScript helper to kick off batch compression:

async function processRemotionBatch(videoUrls: string[], apiKey: string) {
  const jobs = await Promise.all(
    videoUrls.map(url =>
      fetch('https://api.ffmpeg-micro.com/v1/transcodes', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${apiKey}`,
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({
          inputs: [{ url }],
          outputFormat: 'mp4',
          preset: { quality: 'high', resolution: '1080p' }
        })
      }).then(r => r.json())
    )
  );
  return jobs;
}

Each call returns a job ID. Poll GET /v1/transcodes/{id} until the status flips from processing to completed, then grab the download URL from GET /v1/transcodes/{id}/download. For large batches, add a concurrency limiter so you don't fire 500 requests simultaneously.

You can also extract thumbnail frames from each rendered video for email previews or social cards. The thumbnail generation guide walks through that workflow.

Common Pitfalls

Remotion's default codec may surprise you. Remotion typically outputs H.264 in an MP4 container, but the encoding settings vary based on your Remotion config. If you're passing the output to FFmpeg Micro with custom options (not presets), make sure your flags are compatible with the input codec. When in doubt, use the preset system and let FFmpeg Micro pick the right encoding chain.

Large renders need the presigned upload flow. If your Remotion output lives on a public URL (S3, GCS, R2), pass it directly as an input URL. But if you're rendering locally and the file is only on disk, you'll need to upload it first. FFmpeg Micro provides a three-step flow: POST /v1/upload/presigned-url to get a signed GCS URL, PUT the file to that URL, then POST /v1/upload/confirm to register it. Use this instead of trying to serve files from localhost.

Poll, don't webhook. FFmpeg Micro uses a polling model for job status. Hit GET /v1/transcodes/{id} on an interval. A job moves through queued, processing, and then settles on completed or failed. A 2-3 second polling interval works well for most video lengths. Don't assume the job is done just because the POST returned 201. That 201 means the job was accepted, not finished.

FAQ

Can FFmpeg Micro fully replace Remotion Lambda for rendering?
No. FFmpeg Micro is a post-processing API, not a rendering engine. You still need Remotion (locally, via Lambda, or via Remotion Cloud) to turn your React compositions into video files. FFmpeg Micro picks up after the render step for compression, conversion, and audio mixing.

What's the maximum file size FFmpeg Micro can process?
The presigned upload flow supports files up to 2GB through Google Cloud Storage. For URL-based inputs, there's no strict limit on the API side. Most Remotion renders, even long-form content at 1080p, won't hit a size constraint.

Is it cheaper than running FFmpeg on Lambda?
For post-processing tasks, yes. AWS Lambda bills by duration and memory. A 10-minute 1080p transcode on Lambda with 3GB memory costs roughly $0.30 per run, and you still need to manage the deployment, layers, and timeout configuration. FFmpeg Micro charges per job with predictable pricing and zero infrastructure management.

Can I chain multiple FFmpeg operations on the same video?
Each API call runs one operation. If you need to compress and then convert to WebM, that's two sequential calls. Use the download URL from the first job as the input URL for the second. In practice, you can often combine operations into a single call by passing the right combination of options and output format.

Does FFmpeg Micro support Remotion's transparent video (ProRes) output?
If you configure Remotion to output ProRes in a MOV container, you can pass that URL to FFmpeg Micro and convert it to any supported format. This is useful when you need an alpha channel during composition but want to deliver H.264 MP4 to end users.

---

Ready to skip the Lambda configuration? Grab a free API key at ffmpeg-micro.com and start processing your Remotion renders in minutes.

About Javid Jamae

Founder & CEO at FFmpeg Micro

Javid is a software engineer, author, and entrepreneur with over 25 years of professional software development experience across enterprise, startup, and consulting environments. He founded FFmpeg Micro to make video processing accessible to developers through a simple, automation-first REST API.

Software EngineeringVideo ProcessingFFmpegCloud ArchitectureAPI DesignAutomation

Ready to process videos at scale?

Start using FFmpeg Micro's simple API today. No infrastructure required.

Get Started Free