ffmpegretoolautomationinternal-toolsbucket-outcome

How to Process Video in Retool with FFmpeg Micro API

·Javid Jamae·6 min read
How to Process Video in Retool with FFmpeg Micro API

Retool makes it easy to build internal dashboards, admin panels, and data tools. But the moment someone on your team says "we need to transcode uploaded videos" or "can we generate thumbnails from this content library," you hit a wall. Retool doesn't process video. You either self-host FFmpeg on a server you now have to maintain, stitch together a Lambda with S3 triggers and IAM roles, or tell your team it's not possible yet.

FFmpeg Micro gives you a third option: a hosted REST API that handles video transcoding, compression, and format conversion. Since Retool connects natively to any REST API through its Resource system, you can wire up video processing in your internal tool without leaving the Retool editor.

The Approach in 30 Seconds

Create a REST API Resource in Retool pointing at https://api.ffmpeg-micro.com, add your API key as a Bearer token, and then write three short JavaScript queries: one to submit a transcode job, one to poll for completion, and one to grab a signed download URL. Attach those queries to buttons and text components in your Retool app, and your team can process video from the same dashboard they already use.

Set Up the FFmpeg Micro API Resource in Retool

Before writing any queries, configure the API connection once. This becomes reusable across every app in your Retool workspace.

  1. Open Retool and go to the Resources page (top nav).
  2. Click Create new and select REST API.
  3. Set the Base URL to https://api.ffmpeg-micro.com.
  4. Under Headers, add a new header:
  5. Name the resource something like FFmpeg Micro API and save it.

You can grab an API key from ffmpeg-micro.com. The free tier includes enough minutes to test your integration end to end.

Trigger a Transcode from a Retool Button

Create a new JavaScript query in your Retool app. Name it startTranscode. This query calls the FFmpeg Micro API to submit a video processing job.

const videoUrl = fileInput1.value[0]?.signedUrl || textInput1.value;

const response = await FFmpegMicroAPI.post('/v1/transcodes', {
  body: JSON.stringify({
    inputs: [{ url: videoUrl }],
    outputFormat: "mp4",
    options: [
      { option: "-c:v", argument: "libx264" },
      { option: "-crf", argument: "23" }
    ]
  }),
  headers: {
    'Content-Type': 'application/json'
  }
});

return response;

The API responds immediately with a job ID and status:

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued",
  "billable_minutes": 2
}

A few things to note. The inputs field is an array, not singular. You can pass multiple input files for jobs that require concatenation or overlays. The outputFormat must be one of mp4, webm, or mov.

If you don't want to specify raw FFmpeg flags, use preset mode instead:

const response = await FFmpegMicroAPI.post('/v1/transcodes', {
  body: JSON.stringify({
    inputs: [{ url: videoUrl }],
    outputFormat: "mp4",
    preset: { quality: "medium", resolution: "720p" }
  }),
  headers: {
    'Content-Type': 'application/json'
  }
});

return response;

Presets handle codec selection and bitrate tuning for you. Good for teams that don't want to think about FFmpeg flags.

Drag a Button component onto your canvas, set its event handler to run the startTranscode query, and wire a Text component to display {{ startTranscode.data.id }} so you can see the job ID after clicking.

Poll for Job Completion

Transcoding takes time. You need to check whether the job has finished before trying to download the result. Create a second JavaScript query called checkStatus:

const jobId = startTranscode.data.id;

const response = await FFmpegMicroAPI.get(`/v1/transcodes/${jobId}`);

return response;

The response includes the current status:

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "completed",
  "output_url": "gs://ffmpeg-micro-output/a1b2c3d4.mp4"
}

You can handle polling two ways. The simplest: add a Button labeled "Check Status" that runs checkStatus, and bind a Text component to {{ checkStatus.data.status }}. Your team clicks it periodically until they see completed.

For something more automated, use Retool's built-in Timer component. Set it to fire every 5 seconds, trigger the checkStatus query, and add a conditional stop: disable the timer when checkStatus.data.status === "completed". This gives you automatic polling without writing a loop.

Download the Result

Once the job status is completed, call the download endpoint to get a signed URL. Create a third query called downloadResult:

const jobId = startTranscode.data.id;

const response = await FFmpegMicroAPI.get(`/v1/transcodes/${jobId}/download`);

return response;

The response contains a temporary signed URL:

{
  "url": "https://storage.googleapis.com/ffmpeg-micro-output/a1b2c3d4.mp4?X-Goog-Signature=abc123..."
}

You can display this in your Retool app a few different ways:

  • Bind it to a Link component so users can click to download: {{ downloadResult.data.url }}
  • Open it directly in a new tab using a Button with a run-script handler: utils.openUrl(downloadResult.data.url)
  • Feed it into a Video component to preview the output inline

Use Cases for Retool + FFmpeg Micro

  • Content dashboard thumbnail generation. Marketing uploads raw footage. A Retool button extracts a thumbnail or converts to a web-friendly format.
  • Video reformatting for ad campaigns. Resize and re-encode videos to match platform specs (1080p MP4 for YouTube, 720p WebM for web embeds) without leaving the internal tool.
  • Client delivery portals. Agencies build Retool apps where account managers upload raw cuts, transcode to client-specified formats, and share download links.
  • Batch compress user uploads. If your product accepts video uploads stored in S3 or GCS, a Retool admin panel can trigger compression jobs to reduce storage costs.
  • Social clip generation from long-form. Internal teams trim and transcode segments from webinars or podcasts into short clips sized for social distribution.

FAQ

Can I use FFmpeg Micro with Retool's free plan?
Yes. Retool's free tier supports REST API Resources and JavaScript queries, which is everything you need to connect to FFmpeg Micro. The API itself has its own pricing based on processing minutes.

Does FFmpeg Micro support webhook callbacks, or do I have to poll?
Currently, you poll the GET /v1/transcodes/{id} endpoint to check job status. Using a Retool Timer component set to a 5-second interval is the most common pattern. The timer stops when the status returns completed.

What video formats can I output?
FFmpeg Micro supports mp4, webm, and mov as output formats. Set the outputFormat field in your POST request body. For codec and quality control, either pass raw FFmpeg options or use a preset.

How do I process videos stored in private S3 buckets?
Generate a pre-signed S3 URL for the input file and pass that URL in the inputs array. FFmpeg Micro fetches the file using the signed URL. No need to make your bucket public.

Is there a file size or duration limit?
FFmpeg Micro handles files up to several gigabytes. Processing time and billing scale with the duration of the input video. For very large batch jobs, submit them sequentially or in small parallel batches to stay within your plan's concurrency limits.

*Last verified: July 2026*

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