Menu

Hitting an exact file size limit without a server: 8 MB in the browser
📰

Hitting an exact file size limit without a server: 8 MB in the browser

DEV Community: frontend·eRechnung-KI.de·3 days ago
#EbXj3pv8
#devtofrontend#devto#dev#kbps#bitrate
Long article (570 words) — no AI summary yet.
Reading 0:00
15s threshold

Upload forms say "max 8 MB". The file is 41 MB. Most compressors will happily make it smaller — few let you say this small , and almost none tell you what that costs in bitrate before you commit.

I build CutUtils , a set of browser-only media tools. This is the arithmetic behind the "compress to a target size" mode, and the three decisions that mattered.

The only equation that matters

For a fixed duration and frame rate, target size splits into video bitrate and audio bitrate:

video_bitrate = ( target_bytes - audio_bytes ) * 8 / duration_seconds / 1000

Enter fullscreen mode

Exit fullscreen mode

Eight megabytes is 8 × 1024 × 1024 bytes ≈ 8,388,608 bytes. At 128 kbps audio and a 90-second clip, audio eats 1,440,000 bytes, leaving ~6.9 MB for video — about 615 kbps at that duration.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.