Originally published at ffmpeg-micro.com
Most C# video processing guides start the same way: download an FFmpeg binary, add it to your PATH, then call Process.Start() and pray the arguments are right. Libraries like Xabe.FFmpeg and FFMpegCore make the syntax nicer, but you're still managing a binary on every machine that runs your code. Containers, Azure App Service, serverless functions? Good luck getting FFmpeg installed and running there.
There's a simpler approach. Instead of wrapping FFmpeg locally, call a cloud API that runs FFmpeg for you. One HTTP request, your video gets processed, you download the result. No binary management, no deployment headaches.
The Problem with FFmpeg Wrapper Libraries in C
Wrapper libraries like Xabe.FFmpeg, NReco.VideoConverter, and FFMpegCore all do the same thing under the hood: they shell out to an FFmpeg binary on disk. That works on your dev machine, but breaks down in production:
- Deployment complexity: You need FFmpeg installed on every server, container, or CI runner. Azure App Service and AWS Lambda don't include it by default.
- Version drift: Different environments end up with different FFmpeg versions. A flag that works on your machine throws an error in staging.
- Security surface: Shipping a binary that accepts arbitrary command-line arguments is a liability. Every CVE in FFmpeg is now your problem to patch.
- Scaling: FFmpeg is CPU-intensive. One long video can peg an entire server. Scaling means provisioning more compute just for transcoding.
If you're building a web app or API that occasionally needs to process video, running FFmpeg locally is overkill.
Using the FFmpeg Micro API from C
FFmpeg Micro is a cloud API that runs FFmpeg jobs on managed infrastructure. You send an HTTP request with your video URL and desired output format, and it handles the rest. The API uses standard REST conventions, so you can call it from C# with HttpClient.
Quick setup
- Sign up at ffmpeg-micro.com and grab your API key
- Add the base URL (
https://api.ffmpeg-micro.com) and your API key to your app configuration
Transcode a video
The core endpoint is POST /v1/transcodes. You provide one or more input video URLs and an output format:
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var request = new
{
inputs = new[] { new { url = "https://example.com/input.mp4" } },
outputFormat = "mp4",
preset = new { quality = "high", resolution = "1080p" }
};
var json = JsonSerializer.Serialize(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.ffmpeg-micro.com/v1/transcodes", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
The API returns a job object with status: "queued". Poll GET /v1/transcodes/{id} until it flips to completed, then grab the output.
Poll for completion and download
var job = JsonSerializer.Deserialize<JsonElement>(result);
var jobId = job.GetProperty("id").GetString();
while (true)
{
await Task.Delay(3000);
var statusResponse = await client.GetAsync(
$"https://api.ffmpeg-micro.com/v1/transcodes/{jobId}");
var statusJson = await statusResponse.Content.ReadAsStringAsync();
var status = JsonSerializer.Deserialize<JsonElement>(statusJson);
var currentStatus = status.GetProperty("status").GetString();
if (currentStatus == "completed")
{
var downloadResponse = await client.GetAsync(
$"https://api.ffmpeg-micro.com/v1/transcodes/{jobId}/download");
var downloadJson = await downloadResponse.Content.ReadAsStringAsync();
var downloadUrl = JsonSerializer.Deserialize<JsonElement>(downloadJson)
.GetProperty("url").GetString();
Console.WriteLine($"Download: {downloadUrl}");
break;
}
if (currentStatus == "failed")
{
Console.WriteLine("Job failed");
break;
}
}
Advanced: raw FFmpeg options
Need more control than presets? Pass raw FFmpeg flags through the options array:
var request = new
{
inputs = new[] { new { url = "https://example.com/input.mp4" } },
outputFormat = "mp4",
options = new[]
{
new { option = "-c:v", argument = "libx265" },
new { option = "-crf", argument = "28" },
new { option = "-preset", argument = "slow" }
}
};
This gives you full FFmpeg control without managing the binary. You can pass any allowlisted FFmpeg flags. The API validates them server-side, so you don't have to worry about injection.
FFmpeg CLI vs. API: When to Use Which
| Factor | Local FFmpeg (wrapper library) | FFmpeg Micro API |
|---|---|---|
| Setup | Install binary + configure PATH | Add API key to config |
| Deployment | Binary on every environment | Just HTTP calls |
| Scaling | Provision compute yourself | Auto-scales per job |
| Cost | Server compute cost | Pay per minute processed |
| Control | Full FFmpeg access | Allowlisted flags + presets |
| Best for | Offline batch jobs, custom builds | Web apps, APIs, serverless |
If you're running a desktop app or batch processing tool on a machine you control, a local wrapper is fine. If you're building a web app, API, or anything that deploys to the cloud, the API approach saves you from the installation and scaling headaches.
Common Pitfalls
- Don't embed your API key in client-side code. Call the FFmpeg API from your server, not from Blazor WASM or a JavaScript frontend.
-
Handle large files with upload, not URL. For files over 100MB or private files, use the three-step upload flow: get a presigned URL (
POST /v1/upload/presigned-url), PUT the file to cloud storage, confirm the upload (POST /v1/upload/confirm), then use the returnedgs://URL in your transcode request. - Set a timeout on polling. Jobs usually complete in under a minute for short videos, but don't poll forever. Add a max retry count or timeout.
-
Check the output format support. The API currently supports
mp4,webm, andmovoutput formats.
FAQ
Can I use FFmpeg Micro with ASP.NET Core?
Yes. The examples above use HttpClient, which works in any .NET project. In ASP.NET Core, register a typed or named HttpClient via dependency injection for cleaner code.
Is FFmpeg Micro free?
There's a free tier that includes processing minutes so you can test without a credit card. Paid plans start at $19/month for higher volumes.
What about NReco or Xabe.FFmpeg?
Both are solid libraries for running FFmpeg locally. The tradeoff is that you need FFmpeg installed and you handle scaling yourself. For apps that deploy to managed hosting or need to process video at unpredictable volumes, the API approach is usually simpler.
Can I stitch multiple videos together from C#?
Yes. Pass multiple objects in the inputs array and the API concatenates them in order. No need to build complex FFmpeg filter graphs.
Does it support .NET Framework (not just .NET Core)?
Any .NET version that supports HttpClient works. The API is just REST over HTTP, so even WebClient or HttpWebRequest from older .NET Framework versions will work.
Last verified: June 2026
Top comments (0)