How to split a video by file size without re-encoding

Split a video by file size: scale its length by your limit ÷ its size, cut parts that long without re-encoding, then check each part's size.

5 min readSume
All posts

To split a video by file size, work out how many seconds fit under your limit and cut the video into parts that long: part length = video length × limit ÷ file size, minus a safety margin. Cut without re-encoding, so each part keeps about its share of the original bytes and its original quality, then check each part's size.

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

How do I work out how long each part can be?

Aim below the limit, round the number of parts up, and split evenly. For a 1,200-second video of 240 MB and a 50 MB limit:

  • The file averages 240 ÷ 1,200 = 0.2 MB per second.
  • Target 45 MB, 10% under the limit. 240 ÷ 45 = 5.3, so cut 6 parts of 1,200 ÷ 6 = 200 seconds, about 40 MB each.
  • Keep the margin: bitrate changes across a video, and a busy stretch can hold more bytes per second than the average.

How do I split a video by size with Sume?

The video must already be a file in your workspace on media.sume.com, such as an earlier Sume job's output. There is no public upload route for a file on your computer (which URLs each endpoint accepts). In current code, trim and inspect also refuse a source file over 300 MiB with source_too_large, so split a bigger file with FFmpeg, as shown below.

  • Probe it: POST /v1/video-inspect with frames: false returns probe.size_bytes and probe.duration_seconds, and the probe is unbilled. The same two numbers give the bitrate, as how to check a video's bitrate shows.
  • Cut each part with POST /v1/video-trim and precision: "keyframe", a stream copy with no re-encode. Part i (from 0) takes start = i × part length and duration = part length.
  • Probe every output the same way and compare its size_bytes with the limit. If a part is over, split its range into two shorter parts.
  • A copied part may start up to one GOP (group of pictures) early, so it repeats a moment of the part before. The result's actual_start_seconds shows where it really starts.
curl -X POST https://api.sume.com/v1/video-trim \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: webinar-size-part-2" \
  -d '{
    "video_url": "https://media.sume.com/artifacts/artf_demo/webinar.mp4",
    "start": 400,
    "duration": 200,
    "precision": "keyframe"
  }'

Why not re-encode each part?

Because a copied part keeps about its share of the original bytes, while a re-encoded part's size can't be predicted. An exact trim, the default, re-encodes with libx264 at CRF 18 in current code, which FFmpeg's docs describe as constant quality mode, and the trim has no bitrate or target-size field. How to reduce video file size explains why a re-encode can even come out bigger.

What are the limits?

Each part is one trim 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; longer fails with source_duration_exceeded
Source file sizeOver 300 MiB fails with source_too_large (current code)
Each part0.2–900 s, so large limits still need parts of 900 s or less
Size or bitrate settingNone on the trim
ProbeUnbilled with frames: false

How do I split a video by size with FFmpeg?

On your own computer, FFmpeg's segment muxer writes a video to separate files of nearly fixed duration, so give it the part length you worked out. With -codec copy nothing is re-encoded, and every segment starts on a keyframe, so each piece runs a little over or under the length.

FFmpeg also has -fs, which stops writing one output at a byte limit. Its docs say the file comes out "slightly more than the requested file size", so set it below your limit.

ffmpeg -i input.mp4 -codec copy -map 0 -f segment -segment_time 200 -reset_timestamps 1 part%03d.mp4

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume