video-to-mp4
Encodes the picture of an uploaded video to H.264 (x264, yuv420p — what every player and Windows opens) in the chosen container, with the sound you choose: the video's own, or the file in `audio` (the result then lasts as long as the shorter of the two). This is the server finish the site's /audio-to-video and /slideshow-maker use when a browser rendered VP9. The sound is AAC (any container), PCM (mov, mkv) or FLAC (mkv). One encode works for at most 4 minutes; a busy encoder answers `upstream_unavailable`, retry after a minute. Stage the inputs with POST /v1/uploads first. ASYNCHRONOUS: the call returns 202 with a run id — poll GET /v1/runs/{id}, or register a webhook.
v1 beta server · 10 tokens
Price (server): 2 tokens per MB of input, at least 10 per call; paid plans: −5%, rounded up. The exact figure for your file: POST /v1/tools/video-to-mp4/estimate.
Call it
POST https://tembrica.com/v1/tools/video-to-mp4/runs
Authorization: Bearer $TIMBRICA_KEY
Idempotency-Key: <your retry-safe key>
Content-Type: application/json
Input
| Field | Type | Required | Notes |
|---|---|---|---|
video | object | yes | Staged video, up to 200 MB: WebM, Matroska or MP4 (judged by content). Upload it with POST /v1/uploads (multipart `file`, or JSON {"url":"…"}). |
audio | object | no | Optional soundtrack, up to 200 MB — any audio ffmpeg reads. Replaces the video's own sound. |
crf | integer | no |
x264 constant rate factor: lower is better and larger.
default: 22 |
container | string | no |
Output container.
one of: mp4, mov, mkv default: mp4 |
audio_codec | string | no |
Sound codec: aac fits every container, pcm needs mov or mkv, flac needs mkv.
one of: aac, pcm, flac default: aac |
audio_kbps | integer | no |
AAC bitrate, kbit/s.
one of: 384, 320, 256, 192, 160, 128 default: 192 |
audio_bits | integer | no |
PCM or FLAC word length, bits.
one of: 24, 16 default: 24 |
audio_rate | integer | no |
Sound sample rate, Hz. Omit to keep the source's.
one of: 44100, 48000, 96000 |
audio_channels | integer | no |
Sound channels. Omit to keep the source's.
one of: 1, 2 |
Input file
Stage it with POST /v1/uploads (multipart `file`, or JSON {"url": "…"}), then pass {"file_id": "<id>"} in each listed input field.
file fields: video, audio
Errors it can return
validation_failed
input_too_large
insufficient_tokens
concurrency_limited
internal_error
upstream_unavailable
History
- v1 — 2026-11-19 — Initial release (server lane, async, per-MB pricing).
This contract cannot change without a new version and a line above: a test compares the published schema, pricing and limits against a committed lockfile and fails the build otherwise. Subscribe to /v1/changelog to be told when something moves.