# Compress video for X (Twitter)

> Compress a video for Twitter (X): fit it under the 512 MB limit as a sharp 720p or 1080p H.264 MP4. Runs in your browser, the clip never leaves it.

URL: https://nibbo.org/en/compress-video-for-twitter/

## X (Twitter)

X accepts video files up to 512 MB. Free accounts can post clips up to 2 minutes 20 seconds long.

X re-encodes everything you upload, so a clean 720p or 1080p H.264 file gives its encoder the best starting point.

## What fits in 512 MB

What the compressor picks for a typical 1080p 30 fps phone clip (about 16 Mbit/s) of different lengths when the limit is 512 MB:

| Clip length | Resolution | Video bitrate |
| --- | --- | --- |
| 30 seconds | Fits without compressing | – |
| 1 minute | Fits without compressing | – |
| 2 minutes | Fits without compressing | – |
| 5 minutes | 1080p | 12,696 kbit/s |
| 10 minutes | 1080p | 6,279 kbit/s |

## How it works

1. We read your video locally and measure how detailed (SI) and how much in motion (TI) it is.
2. From the size you pick we compute an exact bitrate budget, then choose the resolution and frame rate that look best at that budget. Lower resolution with enough bits beats blocky full resolution.
3. Your GPU encodes it through WebCodecs. Formats the browser cannot decode go through FFmpeg compiled to WebAssembly.
4. If the result is even slightly over the limit, we re-encode with a corrected bitrate, so the file fits.

## Questions

### Why is my video rejected by X?

Usually because it is over 512 MB, longer than your account allows, or uses a codec X does not accept. An H.264 MP4 under the limit avoids all three.

### Is my video uploaded?

No. Nibbo runs in your browser and compresses the video on your device. You can switch off Wi-Fi after the page loads and it still works.

### Why does my video get a lower resolution?

A small file has a fixed number of bits. Spreading them over fewer pixels gives a clean picture; keeping full resolution would make it blocky.

## Related

- [Compress video to a target size](https://nibbo.org/en/compress-video/)

### For an app

- [Compress video for Discord](https://nibbo.org/en/compress-video-for-discord/)
- [Compress video for WhatsApp](https://nibbo.org/en/compress-video-for-whatsapp/)
- [Compress video for email](https://nibbo.org/en/compress-video-for-email/)
- [Compress video for Telegram](https://nibbo.org/en/compress-video-for-telegram/)
- [Compress video for YouTube](https://nibbo.org/en/compress-video-for-youtube/)

### To a size

- [Compress video to 5 MB](https://nibbo.org/en/compress-video-to-5mb/)
- [Compress video to 8 MB](https://nibbo.org/en/compress-video-to-8mb/)
- [Compress video to 10 MB](https://nibbo.org/en/compress-video-to-10mb/)
- [Compress video to 16 MB](https://nibbo.org/en/compress-video-to-16mb/)
- [Compress video to 20 MB](https://nibbo.org/en/compress-video-to-20mb/)
- [Compress video to 25 MB](https://nibbo.org/en/compress-video-to-25mb/)
- [Compress video to 50 MB](https://nibbo.org/en/compress-video-to-50mb/)
- [Compress video to 100 MB](https://nibbo.org/en/compress-video-to-100mb/)
- [Compress video to 200 MB](https://nibbo.org/en/compress-video-to-200mb/)
- [Compress video to 500 MB](https://nibbo.org/en/compress-video-to-500mb/)

### By format

- [Compress MP4 video](https://nibbo.org/en/compress-mp4/)
- [Compress MOV video](https://nibbo.org/en/compress-mov/)
- [Compress MKV video](https://nibbo.org/en/compress-mkv/)
- [Compress WebM video](https://nibbo.org/en/compress-webm/)
- [Compress AVI video](https://nibbo.org/en/compress-avi/)
