WebM to MP4 API โ Free Tier + Pay-As-You-Go
Convert WebM (VP8/VP9/AV1) to MP4 (H.264/H.265) via API. Re-encode or copy-codec remux mode, full FFmpeg control.
What it does
The WebM to MP4 API converts WebM containers (carrying VP8, VP9, or AV1 video and Vorbis or Opus audio) into MP4 containers with H.264/H.265 video and AAC audio for maximum playback compatibility across iOS, Safari, legacy Android, and embedded players. There is no `mode` parameter โ the decision is automatic. When the source streams can be carried by the target container and you have not set anything that forces a re-encode, the API stream-copies; when the copy is impossible or fails mid-flight, it falls through to a full re-encode instead of failing the job.
The encode path exposes the FFmpeg surface directly: `codec`, `preset` (ultrafast through veryslow), `crf` or `videoBitrate`, `twoPass`, `audioCodec`, `audioBitrate`, `audioSampleRate` and `rotate`. The pipeline handles WebM-specific quirks like missing duration in malformed live-streamed sources (we ffprobe the actual length) and transparent VP9 (alpha channel is flattened to black for MP4 output, since MP4 doesn't support per-pixel alpha in mainstream players).
Supported formats
Source formats (1)
- webm
Target formats (1)
- mp4
Quick start
Every sample posts the job, then polls /v1/status/{jobId} until it finishes, with your API key in the X-Api-Key header. The parameter names below are the ones the endpoint actually accepts โ anything else is dropped rather than rejected.
curl -X POST https://api.convertintomp4.com/v1/convert \
-H "X-Api-Key: ck_your_api_key" \
-F "file=@input.webm" \
-F "targetFormat=mp4"
-F "codec=libx264" \
-F "preset=fast"import { readFileSync } from "node:fs";
import { ConvertIntoMP4Client } from "convertintomp4";
const apiKey = process.env.CIM4_API_KEY;
const client = new ConvertIntoMP4Client({ apiKey });
// Presigned direct-to-R2 upload, then queue the conversion.
const { jobId } = await client.uploadDirect(
readFileSync("input.webm"),
"input.webm",
"application/octet-stream",
{ targetFormat: "mp4" },
);
// Poll until the job reaches a terminal state.
let job;
do {
await new Promise((r) => setTimeout(r, 2000));
job = await fetch(`https://api.convertintomp4.com/v1/status/${jobId}`, {
headers: { "X-Api-Key": apiKey },
}).then((r) => r.json());
} while (job.status !== "completed" && job.status !== "failed");
console.log("Download URL:", job.result?.downloadUrl);import time, requests
from convertintomp4 import Client
api_key = "ck_your_api_key"
client = Client(api_key=api_key)
# Presigned direct-to-R2 upload, then queue the conversion.
with open("input.webm", "rb") as f:
job = client.upload_direct(
f, "input.webm", "application/octet-stream", "mp4"
)
# Poll until the job reaches a terminal state.
while True:
status = requests.get(
f"https://api.convertintomp4.com/v1/status/{job['jobId']}",
headers={"X-Api-Key": api_key},
).json()
if status["status"] in ("completed", "failed"):
break
time.sleep(2)
print("Download URL:", status.get("result", {}).get("downloadUrl"))Features
- VP8 / VP9 / AV1 โ H.264 / H.265
- Vorbis / Opus โ AAC audio re-encode
- Encode or remux-if-possible mode
- Full FFmpeg control: CRF, preset, two-pass, rotation
- Transparent VP9 โ black-background MP4
- ffprobe for missing-duration WebM live streams
- Resumable multipart upload for large files
Pricing
From $9.99/mo (Pro) or $24.99/mo (Business) โ or pay-as-you-go on the API plan.
Free tier: 5 conversions/day, 100 MB file size, no API key required (IP-gated). Pro $9.99/mo: 100/day (2,000/month), 2 GB files. Business $24.99/mo: 1,000/day (20,000/month), 10 GB files, GPU encoding, dedicated support.
See full pricing breakdown โBuilt for production
99.9% uptime SLA
Multi-region failover, transparent status page, 60-second response-time guarantee on Business.
Encryption + auto-delete
TLS 1.2+ in transit, AES-256 at rest. Files deleted after 1h / 24h / 7d depending on plan, or instantly via DELETE endpoint. See the security page.
~7s median latency
Most sub-100 MB jobs complete in 6-9 seconds. Webhook-driven async for heavier workloads; waitForJob for synchronous flows.
Frequently Asked Questions
Why convert WebM to MP4?
MP4 (H.264/AAC) is the most broadly compatible video format โ plays on iOS Safari, Android (all versions), legacy browsers, smart TVs, hardware decoders, video editors. WebM (VP9/Opus) is excellent for the modern web but excluded from many ecosystems (especially Apple's pre-iOS 14 stack and most embedded players).
What CRF value should I pick?
CRF 23 is FFmpeg's default and produces visually-transparent output for most content. CRF 18 is archival quality (no visible quality loss). CRF 28 is web-friendly with noticeable but acceptable artifacts. Lower CRF = larger files; the rough rule is each -6 doubles file size.
How does encode mode differ from remux-if-possible?
Encode (default) re-encodes both video and audio โ slower but guaranteed MP4-compatible output. Remux-if-possible checks whether the WebM's tracks are already H.264/AAC (rare); if so, it swaps containers in seconds. If not, it falls back to full encode. Use remux for guaranteed-fast jobs where you control the source.
What about transparency in VP9 WebM?
VP9 supports per-pixel alpha and MP4 in mainstream players does not, so transparency is lost in the conversion and transparent regions composite against a solid background. There is no `enableAlpha` parameter and no HEVC-with-alpha output mode. If the alpha channel matters, keep the WebM or ship an animated format that carries it.
Can I convert multiple WebM clips into a concatenated MP4?
Yes, but on the merge endpoint rather than this one โ `POST /v1/convert` takes one file and has no `concat` flag. Send two or more `file` parts to `POST /v1/convert/merge` with `mergeType=video` and `targetFormat=mp4`. Inputs that already match on codec, resolution, frame rate and audio codec are stream-copied; otherwise each is normalised to the first file's geometry as H.264/AAC before concatenation.
Related APIs
- MP4 to MP3 APIExtract MP3 audio from MP4 video programmatically. Per-job bitrate and sample rate, ID3 tag injection, fast remux mode.
- PDF to JPG APIRender PDF pages to JPG images programmatically. Per-page DPI, page-range selection, batch ZIP output, ImageMagick + pdftoppm pipeline.
- JPG to PNG APIConvert JPG to PNG with optional transparency, lossless compression, and EXIF preservation via API. Sharp-backed.
- MP4 to GIF APIConvert MP4 video to animated GIF programmatically. Per-job width, fps, palette mode, and start/end trim controls.
- PDF to DOCX APIConvert PDF to editable Word DOCX via API. pdf2docx layout reconstruction, automatic OCR pre-pass on scans, LibreOffice fallback.
- DOCX to PDF APIConvert Word DOCX to PDF programmatically. LibreOffice-rendered with font fallback, headers/footers, and PDF/A archival output.
Or browse the full catalogue of 23 API products โ
Get an API key
Start integrating the WebM to MP4 API in five minutes. Read the docs, grab a key, and ship your first conversion before the trial coffee cools.