MediaTofuTrim video with one API call
Trim video with one API call
POST /v1/tools/video/trim with an input URL or file id to cut a section without re-encoding. Send start plus end or duration. Cuts land on the nearest keyframes; short jobs can return their result in the same request with ?wait=25.
Example
curl "https://api.mediatofu.com/v1/tools/video/trim?wait=25" \
-H "Authorization: Bearer $MEDIATOFU_KEY" \
-d '{ "input": "https://example.com/clip.mp4", "start": "00:00:05", "end": "00:00:20" }'With ?wait=25 a short job can return its result in the same request. Short jobs typically take about 5–15 seconds including container start. Leave wait off and poll GET /v1/jobs/:id, or pass webhook_url on a paid plan.
Options
start defaults to 0. Give end or duration (if both are sent, end wins). Times accept seconds or timestamps like 00:01:30. The output keeps the input extension.
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 5 minutes, inputs up to 2 GB. Pro: $19/month includes 1,500 minutes, then $0.0127 a minute. Jobs up to 10 minutes, inputs up to 2 GB.
Questions
Will the cut be frame-exact?
Trim without re-encoding has to cut at a keyframe, so the start can land a moment away from the exact time. Quality is unchanged.
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, one over your plan's size limit, or an image that could not be read. If your command runs and FFmpeg exits with an error, or the job reaches your plan's length limit, the seconds it used count. Nothing retries automatically.
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 5 minutes, inputs up to 2 GB. Pro: $19/month includes 1,500 minutes, then $0.0127 a minute. Jobs up to 10 minutes, inputs up to 2 GB.