
Jump to a section
To compress video for web, set a quality target or a file-size budget before encoding. A smaller tutorial is a poor trade if the viewer can no longer read the setting you are demonstrating. The same applies to an interview that loses clear speech or a game clip whose movement turns into blocks. Compress for what people need to see and hear, then check the file where they will watch it.
For a straightforward website video, a useful starting route is H.264 video and AAC audio in an MP4, encoded from your original with a quality target. If there is a firm upload limit, work backwards from duration and total bitrate instead. Neither route guarantees zero quality loss. This guide combines documented controls with TSR editorial judgment; it does not report a matched compression or buffering test.
Start with where viewers will watch
Keep the original master and make a separate delivery copy. A single MP4 placed on a website, an upload to a hosting service and a file constrained by a form’s size limit have different priorities. Do not solve all three by repeatedly compressing the last export.
| Delivery job | Start with | Acceptance boundary |
|---|---|---|
| One video file on your website | A compatible MP4 at a useful displayed size | Readable detail, acceptable data use and playback on intended browsers |
| Upload to a service that makes viewing versions | A good source within that service’s current upload requirements | Avoid damaging the upload merely to make the progress bar finish sooner |
| A strict file-size cap | An audio-inclusive bitrate budget or matching size-target preset | The saved file must fit; quality or duration may have to change |
MDN’s web codec guidance identifies H.264 with AAC in MP4 as a broadly supported combination. More efficient formats can be useful as additional versions, but a smaller HEVC or AV1 file is not automatically the safest single file for an unknown audience. Retain a compatible fallback and check the devices you actually need to support.
If your question is which software should run a live production, the video encoder guide covers that separate decision. For repeatable batches or multiple delivery versions, compare transcoding workflows. Here, the job is preparing and validating one web delivery file.
Choose a quality target or a file-size budget
With constant quality, the encoder spends more data on difficult scenes and less on simple ones. You select the quality level; the final size varies with the material. With average bitrate, you choose the data budget and the picture has to work within it. HandBrake’s mode comparison describes that distinction. A target suitable for a still interview may be inadequate for moving foliage, game action or fine screen text.
Start with the quality route when the brief is simply “make this reasonably smaller.” Remove unused opening and closing material in the editor before encoding, then compare a representative sample. Use the size route when someone has specified an actual cap. Do not keep pushing a quality slider until an important diagram becomes unreadable just because the export is still larger than an arbitrary target.
A worked budget: 60 seconds under a 20 MB cap
This illustrative calculation uses decimal megabytes: 1 MB is 1,000,000 bytes. A system reporting MiB uses different units. Check the destination’s stated limit, and verify the actual saved file rather than relying on a rounded number in a file browser.
| Planning step | Calculation for this example | Meaning |
|---|---|---|
| Maximum total average rate | 20 MB × 8 ÷ 60 seconds ≈ 2.667 Mbps | Both video and audio must fit, plus container overhead |
| Choose an 18 MB working target | 18 × 8 ÷ 60 = 2.4 Mbps | This example leaves headroom; it is not a universal safety percentage |
| Reserve example audio | 128 kbps = 0.128 Mbps | An illustrative AAC choice, not a promise of sufficient quality for every soundtrack |
| Video budget | 2.4 − 0.128 = 2.272 Mbps | About 2,272 kbps for video before checking actual output |
| Duration changes the result | At 2.4 Mbps: 30 sec ≈ 9 MB; 120 sec ≈ 36 MB | These planning sizes exclude muxing overhead; doubling duration doubles the data |

In HandBrake, select Average Bitrate when you need that budget, and consider its multipass option where available for the chosen encoder. It can distribute a constrained rate more effectively; it does not create extra bits or guarantee the final file lands at the exact number. Confirm the saved size and leave room for overhead and any additional tracks.
If the result at that budget destroys the detail, change the brief: shorten the clip, reduce encoded dimensions only while text stays readable, increase the limit or change the delivery method. Making a player smaller with page styling does not reduce the bytes in its video file. A tiny background loop and a full-screen software lesson should not inherit the same file-size target.
Compress Video for Web with HandBrake

HandBrake is a free transcoder for Windows, Mac and Linux. It works from videos you already have and always converts the video stream; it is not a video pass-through or a full editing application. Use the finished edit as its source, and keep that source when trying alternatives.
- Open the original master and choose an appropriate preset. Fast 1080p30 is a reasonable starting point for an ordinary SDR clip intended for 1080p at up to 30 fps; inspect what it changes before using it for other footage.
- Check the output dimensions, crop and frame-rate limit. Preserve text, aspect ratio and required motion detail. Do not let a preset quietly cut an edge or reduce 60 fps when that motion matters.
- For the broadly compatible single-file route, confirm MP4, H.264 (x264) video and AAC audio. Keep the intended spoken track; remove only tracks you know the delivery does not need.
- On Video, use Constant Quality unless the size cap requires Average Bitrate. For 1080p x264, begin within the official RF 20–24 range and compare a sample; this is a starting range, not a universal best setting.
- Use Preview to encode a short difficult section. Include fine text, fast movement or gradients as appropriate, then compare with the source at the intended viewing size. Adjust one meaningful control and repeat when needed.
- Save the complete output under a new filename. Check its size, duration, picture, sound and captions, then test that exact file through the intended website or upload preview.
The official preset guide makes the hidden trade-off explicit: a preset name includes maximum resolution and frame rate. A 720p30 preset can downscale a 1080p60 source and limit it to 30 fps. Creator presets prioritize a stronger upload source for services that re-encode it; Social presets instead target a stated size and duration. Pick by the delivery job rather than assuming every Web preset means “smallest.”
HandBrake’s frame-rate explanation distinguishes a peak ceiling from Same as Source. Keep the source motion when it is useful, or deliberately reduce it after a sample. A screen lesson with a mostly still interface and a fast game highlight make different demands. A higher output frame rate cannot recover motion that was never recorded.
For x264, lower RF numbers retain more quality and usually require more data. Do not transfer the same number blindly to every encoder: HandBrake’s quality guide identifies different scales and recommendations. Keep the selected encoder fixed while comparing a setting. If you change to a hardware encoder or another codec, start a fresh comparison rather than assuming “22” means the same result.
The Preview controls let you choose a start position and duration, then encode that section. A still preview image cannot show motion breakup, flickering fine detail or an audio problem. For a hypothetical software demo, a compressed settings value changing from readable to ambiguous is a failed result even if the speaker’s face still looks clean.
Working locally avoids uploading the recording merely to try a compression setting. If an online tool is more convenient, confirm permission to upload the footage and verify its input, output and download limits on a representative file. A preview or an accepted upload does not establish that your required output can be downloaded on the chosen account.
Web Optimized helps startup, not the bitrate
For a directly served MP4, HandBrake’s Web Optimised option puts the container header near the beginning so a player can obtain the information needed to start playback earlier. It does not lower the picture’s bitrate, reduce the duration or create lower-resolution versions for a slow connection.
If an existing MP4 already has the right codec and quality, a technical workflow may use FFmpeg streamcopy to remux its selected compressed streams without re-encoding, together with the MP4 faststart muxer option. That is a reason to avoid another HandBrake pass when only the file layout needs changing. Keep the source, confirm compatible streams and check the result; faststart is not intended for every fragmented-output workflow.

The page can also request data before a viewer presses play. MDN documents preload as a browser hint: metadata requests basic information, while auto may allow the whole file to download. Autoplay can take precedence, and browsers need not obey the hint. For an ordinary click-to-play lesson, a poster and visible controls are a sensible starting point before adding automatic playback.
A single MP4 still gives viewers one encoded version. A managed service with suitable playback renditions can address a wider range of connections without forcing every visitor to receive your largest file. Confirm what the service actually generates and serves. Re-encoding the same file ever smaller cannot repair a player configuration or delivery path that is the real cause of a poor experience.
Inspect the saved file and the page that serves it
Compare the source and output at a realistic displayed size, then watch the whole saved file with sound. Include the hardest movement, quiet speech, gradients and the smallest text. Verify that the delivered composition still explains the point. A lower-resolution version can look acceptable in a small page slot yet fail when the player opens full screen.
| What failed | Practical next check |
|---|---|
| Text smears or movement breaks into blocks | Revisit quality, resolution or the hard size budget; compare the same difficult section from the original |
| The new file is larger | Inspect mode, audio tracks and output settings; constant quality is not a smaller-than-source guarantee |
| Speech or captions disappeared | Confirm track selection and the destination’s subtitle delivery; inspect the actual saved version |
| A smaller file still starts slowly or buffers | Separate MP4 layout from sustained bitrate and page/server delivery; test the exact hosted file |
| It plays on one device but fails on another | Check codec/container support, actual served file and player configuration before compressing again |
If a phone recording’s colors change dramatically, stop and inspect the source and export color workflow rather than trying to hide the difference with another bitrate adjustment. Likewise, an audio sync error deserves a timing investigation. Neither problem is proof that the quality slider is simply set too low.
For device failures, the codec compatibility guide helps separate format support from file size. If captions need a new delivery format, use the subtitle guide rather than silently dropping them to save a little space.
After upload, inspect the actual page and, where relevant, the viewing version generated by the host. When the file looks right locally but viewers still report trouble, video analytics and QoE tools can help investigate startup, failures and buffering. Record the affected device and whether the failure happens before playback or after it begins; those details help separate format, startup and sustained-delivery problems.
Frequently asked questions
Can compression preserve exactly the same quality?
Typical web delivery uses lossy encoding, so a substantial size reduction cannot be promised with pixel-identical output. You can aim to preserve the detail viewers need. Remuxing copies compatible compressed streams without another encode, but it normally leaves the media data essentially the same size. Keep the master for future versions.
Can I use a live-streaming bitrate setting as my file-size target?
A live bitrate must fit the ingest service and a sustainable upload connection. A finished file also has a duration, which turns its total average rate into a size. The live streaming bitrate calculator serves the live job; use the audio-inclusive arithmetic above for a capped file. The same resolution does not make the two budgets interchangeable.




Leave a Reply