Originally published at ffmpeg-micro.com.
You need to compress video in your app. Maybe users are uploading 500MB screen recordings. Maybe you're batch-processing marketing clips that need to be half their current size. Either way, you're staring down FFmpeg's compression flags and wondering how long this rabbit hole goes.
It doesn't have to be a rabbit hole. You can compress video with a single API call, no FFmpeg binary on your server, no worker queues, no guessing at CRF values.
Why Video Compression Gets Complicated Fast
FFmpeg is the gold standard for video compression. But "gold standard" comes with baggage. You need to pick the right codec (libx264, libx265, libvpx-vp9), choose a CRF value that balances quality against file size, decide on a resolution, and handle edge cases like variable frame rates or audio stream mismatches.
Then there's infrastructure. Running FFmpeg on a server means CPU-intensive processes that block other work. You either overprovision (expensive) or queue jobs and hope things don't back up. And if you're on a serverless platform like Vercel or Cloudflare Workers, you can't run FFmpeg at all.
Compress Video with FFmpeg Micro's API
FFmpeg Micro is a cloud API that lets you compress video with a single HTTP request. No FFmpeg installation, no server management. You send the video URL, specify the output format and quality, and get back a compressed file.
The simplest compression call looks like this:
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://example.com/large-video.mp4"}],
"outputFormat": "mp4",
"preset": {"quality": "medium", "resolution": "1080p"}
}'
That's it. The API returns a job ID, and your video gets compressed in the cloud. You poll for status or set up a webhook, then download the result.
Quality presets map to FFmpeg CRF values under the hood: low (CRF 28, smallest files), medium (CRF 23, good balance), and high (CRF 18, near-lossless). If you've ever spent an afternoon testing CRF values, you know how much time this saves.
How to Reduce Video File Size with Custom FFmpeg Options
Presets cover 90% of use cases. But sometimes you need more control. Maybe you want VP9 encoding for WebM output, or you need a specific bitrate cap for streaming.
FFmpeg Micro's advanced mode lets you pass raw FFmpeg options:
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://example.com/large-video.mp4"}],
"outputFormat": "webm",
"options": [
{"option": "-c:v", "argument": "libvpx-vp9"},
{"option": "-crf", "argument": "30"},
{"option": "-b:v", "argument": "0"}
]
}'
This gives you full FFmpeg power without managing a single server. The API validates your options, runs the transcode on auto-scaling infrastructure, and handles cleanup.
Compress Video in Python (No FFmpeg Install)
If you're building in Python, the same API call works with requests:
import requests
response = requests.post(
"https://api.ffmpeg-micro.com/v1/transcodes",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"inputs": [{"url": "https://example.com/raw-upload.mp4"}],
"outputFormat": "mp4",
"preset": {"quality": "medium", "resolution": "720p"}
}
)
job = response.json()
print(f"Job ID: {job['jobId']}")
No subprocess.run(["ffmpeg", ...]). No checking if FFmpeg is installed on the container. No dealing with stdout parsing to track progress.
Compress Video in Node.js Without a Server
Same idea in Node.js with fetch:
const response = await fetch("https://api.ffmpeg-micro.com/v1/transcodes", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
inputs: [{ url: "https://example.com/raw-upload.mp4" }],
outputFormat: "mp4",
preset: { quality: "medium", resolution: "1080p" }
})
});
const job = await response.json();
console.log(`Job ID: ${job.jobId}`);
This works in Next.js API routes, Express servers, Deno, Bun, or any environment that supports fetch. No native dependencies to install.
Uploading Videos Before Compression
If your video isn't already hosted at a public URL, upload it first using the three-step upload flow:
-
Get a presigned URL:
POST /v1/upload/presigned-urlwithfilename,contentType, andfileSize -
Upload the file:
PUTthe file bytes to the returneduploadUrl -
Confirm the upload:
POST /v1/upload/confirmwithfilenameandfileSizeto get back afileUrl
Use that fileUrl as the input URL in your transcode request. The whole flow takes four HTTP calls total: presigned URL, upload, confirm, transcode.
FFmpeg Video Compression API vs. Self-Hosted FFmpeg
Running FFmpeg yourself means managing servers, scaling workers, and debugging codec issues at 3am. FFmpeg Micro handles all of that. You pay per minute of video processed, starting with a free tier.
| Self-Hosted FFmpeg | FFmpeg Micro API | |
|---|---|---|
| Setup time | Hours to days | Minutes |
| Infrastructure | Your servers, your problem | Auto-scaling cloud |
| Codec updates | Manual | Automatic |
| Cost model | Fixed server costs | Pay per use |
| Scaling | Manual provisioning | Automatic |
For teams processing fewer than 10,000 videos a month, the API approach is almost always cheaper than running your own infrastructure. And you skip the maintenance entirely.
FAQ
Can I compress video without installing FFmpeg?
Yes. FFmpeg Micro is a cloud API that runs FFmpeg on managed infrastructure. You send an HTTP request with your video URL and compression settings, and get back a compressed file. No local FFmpeg installation needed.
What video formats does FFmpeg Micro support for compression?
FFmpeg Micro supports MP4, WebM, AVI, MOV, MKV, and FLV for video output. Audio formats include MP3, M4A, AAC, WAV, OGG, Opus, and FLAC. You can convert between formats and compress in the same request.
How do I choose the right compression quality?
Use the quality preset: low for maximum compression (smallest files), medium for a balanced tradeoff, and high for near-original quality. If you need exact control, pass raw FFmpeg options like -crf 23 directly through the API.
Is there a free tier for video compression?
Yes. FFmpeg Micro includes a free tier so you can test compression without committing. Sign up at ffmpeg-micro.com and get an API key in minutes.
Can I batch compress multiple videos?
You can submit multiple transcode requests in parallel. Each request processes independently on auto-scaling infrastructure, so compressing 100 videos takes roughly the same time as compressing one.
Sign up for FFmpeg Micro and compress your first video in minutes. No server setup, no FFmpeg installation, no infrastructure to manage.
Top comments (0)