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.

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-inspectwithframes: falsereturnsprobe.size_bytesandprobe.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-trimandprecision: "keyframe", a stream copy with no re-encode. Part i (from 0) takesstart= i × part length andduration= part length. - Probe every output the same way and compare its
size_byteswith 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_secondsshows 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.
| Limit | Value |
|---|---|
| Source length | Up to 1,800 s; longer fails with source_duration_exceeded |
| Source file size | Over 300 MiB fails with source_too_large (current code) |
| Each part | 0.2–900 s, so large limits still need parts of 900 s or less |
| Size or bitrate setting | None on the trim |
| Probe | Unbilled 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.mp4Sources
Related posts
More in Media tools
- SRT vs VTT: the difference between the two subtitle formats
SRT and VTT are both plain-text subtitle files. VTT adds a WEBVTT header, dot milliseconds, positioning and styling, and is what HTML5 players read.
- Steam capsule sizes: header, small, main, and vertical
Steam's capsules are 920×430 (header), 462×174 (small), 1232×706 (main) and 748×896 (vertical). What each may show, and how to make the art at size.
- What is text-based video editing? How transcript cuts work
Text-based video editing cuts a video by deleting words from its transcript. How word timings become a cut list, and how to build it with Sume's API.
- Types of cuts in video editing: hard, jump, J, L, and more
The main types of cuts in video editing: hard, jump, J and L, match, cutaway, cross-cut, and smash cut. What each does, and how to build them.
Written by Sume