30, 15 and 6-second cutdowns from one master with video trim

Make three cutdowns from one master clip with video trim: $0.02 each, $0.06 in all. Use exact precision, conform to 1080x1920, and keep or drop the audio.

5 min readSume
All posts

Run video trim three times on the same master with duration set to 30, 15 and 6, and you have three cutdowns for $0.06 in total: the public rate is $0.02 per job. Each call returns a new MP4 artifact, the master stays untouched, and the default precision: exact makes frame-accurate cuts. If the three cutdowns all need a 1080x1920 frame, add output: { width: 1080, height: 1920 } to each request.

A trim is a plain range cut. It does not choose the best seconds for you, so decide the in-points first, by watching the master or by pulling stills with video frames.

The three requests

The fields are video_url, start and exactly one of end or duration. Sending both is refused with video_trim_range_conflict, and sending neither with video_trim_range_required. Duration runs from 0.2 to 900 seconds, and the source can be up to 1800 seconds long.

For a 6-second bumper-style cut you will often want to drop the sound and lay a new bed in Timeline later: set audio: "drop". For cutdowns that keep the original voice, leave it at the default keep; exact precision remuxes the kept audio as AAC.

Three cutdowns from one master (read 2026-10-07 from the Sume docs)
CutdownstartdurationPrice
30 s1230$0.02
15 s2015$0.02
6 s246$0.02
Total$0.06

A script that sends all three

The script below sends three trims, each with its own idempotency key, and prints the job ids. The jobs run async, so poll /v1/jobs/:id/status until result_ready, then read /v1/jobs/:id/result for the new video_url.

const cuts = [["c30", 12, 30], ["c15", 20, 15], ["c06", 24, 6]];
async function trim([key, start, duration]) {
  const res = await fetch("https://api.sume.com/v1/video-trim", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.SUME_API_KEY}`,
      "Content-Type": "application/json",
      "Idempotency-Key": `master-${key}`,
    },
    body: JSON.stringify({
      video_url: "https://media.sume.com/artifacts/artf_demo/master.mp4",
      start,
      duration,
      output: { width: 1080, height: 1920 },
    }),
  });
  return res.json();
}
async function main() {
  const jobs = await Promise.all(cuts.map(trim));
  for (const job of jobs) console.log(job.request_id ?? job);
}
main();

Exact or keyframe

precision: exact re-encodes with libx264 and yuv420p, so the cut starts where you said. precision: keyframe copies the stream, which can start a group of pictures early; the result carries actual_start_seconds so you can re-base your times. The output conform works only with exact, and combining it with keyframe is refused with video_trim_output_requires_exact.

If end is beyond the source, the cut clamps to the end of the source and the result warns with trim_clamped_to_source. Check the returned duration_seconds rather than assuming you got the length you asked for.

Matching the cutdown to a placement

Google's page on YouTube video ad lengths and formats lists the lengths for each format, and the related post on YouTube ad formats turns them into Timeline minutes. A 6-second cutdown suits a bumper-length slot; 15 and 30 seconds suit the longer in-stream formats. Read the page for the current numbers rather than relying on this post, which only shows the cutting mechanics.

Cutdowns that need new music or a new voiceover go through Timeline next, where a 30-second render is one billable minute at $0.10.

Budget for a campaign

Cost scales linearly with the number of masters. Twelve masters, each cut to 30, 15 and 6 seconds, is 36 trim jobs and 36 x $0.02 = $0.72. If each cutdown then goes through one Timeline render of a minute or less to add a voiceover, that adds 36 x $0.10 = $3.60, for a combined $4.32. Those figures count only trim and Timeline; they exclude generating the master itself.

Keep the job ids with the cutdown length in your own records, because the result carries a new artifact id for each file and nothing about which cutdown it was. Use the idempotency key as the label: a key such as master-c15 makes a retry safe and tells you what the request was.

Picking the in-points

Pick in-points from stills. Video frames returns an exact still at a time you choose, and video inspect can return up to 24 stills in one call at frames.at. Look at them at a few candidate starts, choose where the action begins, and put those values into start. Doing so before the trims saves redo jobs at $0.02 each.

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume