File-size cap and max length: the average bitrate ceiling

Divide a platform's size cap by its longest allowed video to get an average bitrate ceiling: LinkedIn about 2.2 Mbps, TikTok 6.7, Pinterest 17.8. Python check.

4 min readSume
All posts

Each platform caps file size and length separately, so a long video has to fit under an average bitrate that you can compute. Divide the cap in bits by the longest allowed length in seconds. The longest LinkedIn ad lands near 2.2 Mbps, while a maximum-length Pinterest ad can run near 17.8 Mbps.

What are the caps? (read 2026-10-09)

Sizes are taken as decimal (1 MB is 1,000,000 bytes); a binary reading lowers the ceiling slightly. A shorter video can use a higher rate. TikTok also lists a 516 kbps floor for non-Spark ads.

Size cap, max length and the ceiling they imply (read 2026-10-09)
Platform and formatSize capMax lengthAverage ceiling
LinkedIn video ad500 MB30 minabout 2.2 Mbps
TikTok non-Spark ad500 MB10 minabout 6.7 Mbps
Pinterest video ad2 GB15 minabout 17.8 Mbps
Instagram Reels ad4 GB15 minabout 35.6 Mbps
X video, default8 GB20 minabout 53.3 Mbps
X video, Premium16 GB125 minabout 17.1 Mbps

How do you read your own file?

The video_inspect probe returns size_bytes and duration_seconds but no bitrate field, so compute it. The probe is billed by its Modal compute, not a fixed fee, and the source can be up to 1800 seconds.

def mbps(size_bytes, seconds):
    return size_bytes * 8 / seconds / 1e6

def ceiling(cap_mb, minutes):
    return cap_mb * 8 / (minutes * 60)

# replace with values from your own probe
probe = {"size_bytes": 310_000_000, "duration_seconds": 1500.0}
actual = mbps(probe["size_bytes"], probe["duration_seconds"])
print(f"actual {actual:.2f} Mbps")
for name, cap, mins in [("LinkedIn", 500, 30), ("TikTok", 500, 10), ("Pinterest", 2000, 15)]:
    c = ceiling(cap, mins)
    print(name, f"{c:.1f} Mbps", "ok" if actual <= c else "over")

What do you do if the file is over?

Two cautions. First, the ceiling is an average over the longest permitted video, so a 60-second clip can run far above it and still fit the size cap. Second, a size cap is not a quality target: a platform may re-encode your upload anyway. Use the number to catch files that will be rejected, not to tune picture quality.

  • Cut it shorter with video_trim ($0.02 per job); size falls with length.
  • Re-encode smaller with the trim output option (width and height 256 to 2160, fps 24, 25, 30 or 60), valid for precision exact.
  • Docs do not expose a bitrate setting on these tools, so lowering resolution or frame rate is the lever Sume offers.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume