How to cut a video in half (or into equal parts)

To cut a video in half, split it at its length ÷ 2 into two files. For N equal parts, part i starts at i × length ÷ N. Steps, precision, and limits.

4 min readSume
All posts

To cut a video in half, find its length, cut at the midpoint, and save the two pieces as separate files: the first runs from 0 to length ÷ 2, the second from length ÷ 2 to the end. For N equal parts, part i (counting from 0) starts at i × length ÷ N and lasts length ÷ N.

The Sume facts below come from the Video inspect and Video trim docs, and the FFmpeg facts from the ffmpeg and formats documentation, all read on 2026-09-28. Anything described as current behavior is read from Sume's code.

How do I cut a video in half with Sume?

Sume's media tools work on files already in your workspace on media.sume.com, such as the output of an earlier Sume job. There is no public upload route for a file on your computer (which URLs each endpoint accepts). Two calls do the job:

  • Read the length. POST /v1/video-inspect with frames: false is a probe only, and the probe is unbilled. probe.duration_seconds is the length; get a video's duration and fps covers the other fields.
  • Cut each half with POST /v1/video-trim. start is the in-point in seconds, and exactly one of end or duration closes the range. Each job returns a new MP4 holding only [start, end), and the source is untouched.
  • A trim is asynchronous by default. Poll GET /v1/jobs/:id/status until the job is terminal, then read the new file's video_url from GET /v1/jobs/:id/result.
# A 611.4 s video: half 1 is [0, 305.7), half 2 is [305.7, 611.4)
curl -X POST https://api.sume.com/v1/video-trim \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: talk-half-2" \
  -d '{
    "video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
    "start": 305.7,
    "end": 611.4
  }'

Should the halves be cut exactly or on keyframes?

Trim has two precision values, compared in split a long video into short clips. For halves, the difference is where the two pieces meet:

  • exact, the default, re-encodes the range (libx264, yuv420p) and cuts on the exact frame, so the halves meet with no gap and no repeat.
  • keyframe copies the streams without re-encoding, so the cut may start a GOP (the run of frames between keyframes) early: the second half can begin before the midpoint and repeat the end of the first half. The result's actual_start_seconds says where it really starts.

What are the limits?

A trim reads sources up to 1,800 seconds and writes at most 900 seconds per part. So a 30-minute video splits into two 900-second halves, or three 600-second thirds, but a longer one can't be trimmed at all. The file size counts too: in current code, trim and inspect refuse a source file over 300 MiB with source_too_large. Each part is one job at $0.02 per job, plus a 5.5% agent fee by default.

From Video trim, Video inspect and Sume's current code, read 2026-09-28.
LimitValue
Source lengthUp to 1,800 s; a longer source fails with source_duration_exceeded
Source file sizeOver 300 MiB fails with source_too_large (current code)
Each part0.2–900 s
Outputs per trim jobOne MP4, so one job per part
Length probeUnbilled (frames: false)
Past the endAn end past the source clamps and warns trim_clamped_to_source

How do I cut a video in half on my computer?

For a local file, FFmpeg's segment muxer writes a video to several files. Its docs say it "outputs streams to a number of separate files of nearly fixed duration". -segment_times takes a list of split points, so one time cuts the file in two; -segment_time 60 instead cuts it into pieces of about a minute each.

  • -codec copy re-encodes nothing, and every segment starts with a keyframe. Unless a keyframe falls exactly on your time, the second part starts at the next keyframe after it.
  • -reset_timestamps 1 starts each part's timestamps near zero, which the docs say eases playback of the pieces.
ffmpeg -i input.mp4 -codec copy -map 0 -f segment -segment_times 305.7 -reset_timestamps 1 part%03d.mp4

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume