MediaTofuCompress video with one API call
Compress video with one API call
POST /v1/tools/compress with an input URL or file id to shrink a video to an H.264 MP4. Pass crf (18–40, default 28) and optional max_height. The job runs in a fresh sandbox; with ?wait=25 a short job can return its result in the same request.
Example
curl "https://api.mediatofu.com/v1/tools/compress?wait=25" \
-H "Authorization: Bearer $MEDIATOFU_KEY" \
-d '{ "input": "https://example.com/clip.mov", "crf": 28 }'input is a public http(s) URL or a file id from POST /v1/files. Short jobs can return in the same request with ?wait=25.
Options
crf controls quality versus size: a lower crf means higher quality and a larger file. Compress accepts 18 to 40 and uses 28 if you leave it out. max_height caps the output height while preserving aspect ratio.
Same engine as raw FFmpeg
The compress tool builds the command for you and runs on the same sandboxed engine as POST /v1/run. If you need filters the tool does not expose, send your own ffmpeg_command instead.
Pricing
Free: $0, 5 minutes of compute a month, jobs up to 1 minute, inputs up to 50 MB, 1 job at a time. Pay per use: $0.024 per compute minute, billed by the second, no monthly fee. Jobs up to 5 minutes, inputs up to 2 GB, 3 jobs at once. Starter: $9/month includes 600 minutes, then $0.015 a minute. Jobs up to 1 minute, inputs up to 500 MB. Pro: $19/month includes 1,500 minutes, then $0.0127 a minute. Jobs up to 10 minutes, inputs up to 2 GB.
Questions
What does compress return?
An H.264 MP4. On success the job response includes an outputs array with a download URL for out.mp4.
How do I get the result?
Add ?wait=25 and a short job can return its result in the same request. Short jobs typically take about 5–15 seconds including container start. 25 seconds is the longest wait. Otherwise you get a job id to check with GET /v1/jobs/:id, or on a paid plan you can pass webhook_url and we POST the result to you.
Do failed jobs cost anything?
A failure on our side is never charged, and neither is an input we couldn't download or one over your plan's size limit. If your command runs and FFmpeg exits with an error, or the job reaches your plan's length limit, the seconds it used count.
What does MediaTofu cost?
Free: $0, 5 minutes of compute a month, jobs up to 1 minute, inputs up to 50 MB, 1 job at a time. Pay per use: $0.024 per compute minute, billed by the second, no monthly fee. Jobs up to 5 minutes, inputs up to 2 GB, 3 jobs at once. Starter: $9/month includes 600 minutes, then $0.015 a minute. Jobs up to 1 minute, inputs up to 500 MB. Pro: $19/month includes 1,500 minutes, then $0.0127 a minute. Jobs up to 10 minutes, inputs up to 2 GB.