> ## Documentation Index
> Fetch the complete documentation index at: https://www.openpmm.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# X media guidelines

> See the video and image limits that OpenPMM applies to X Destinations and Posts.

X accepts a short video with strict dimensions. Read [Media guidelines](/docs/media/overview) for the general rules.

Repeat the Post `body` value to publish a thread. You can attach media to each
body item. Any body item can contain media without text. If publication stops
part-way, a retry resumes at the first missing reply.

## Media per post

An X post accepts up to four assets.

## Video limits

| Property       | Limit                                                      |
| -------------- | ---------------------------------------------------------- |
| Duration       | 0.5 to 140 seconds                                         |
| File size      | 500 MiB. X permits 512 MB, but the OpenPMM limit is lower. |
| Width          | 32 to 1,280 px                                             |
| Height         | 32 to 1,024 px                                             |
| Aspect ratio   | 1:3 to 3:1                                                 |
| Frame rate     | 60 fps maximum                                             |
| Pixel shape    | Square pixels. The sample aspect ratio must be 1:1.        |
| Pixel format   | YUV 4:2:0                                                  |
| Scan type      | Progressive                                                |
| Audio codec    | AAC                                                        |
| Audio channels | Mono or stereo                                             |

X recommends the H.264 video codec. OpenPMM gives advice for a different codec, but it does not block the post.

## Image limits

| Property                | Limit                                               |
| ----------------------- | --------------------------------------------------- |
| Format                  | JPEG, PNG, GIF, or WebP                             |
| File size               | 5 MB maximum for a photo                            |
| Animated GIF file size  | 15 MB maximum                                       |
| Animated GIF dimensions | 1,280 x 1,080 px maximum                            |
| Animated GIF frames     | 350 maximum                                         |
| Animated GIF pixels     | Width x height x frames must be 300,000,000 or less |

X documents no dimension limit for a photo. OpenPMM cannot check a limit that
the provider does not document.

OpenPMM makes a photo smaller when it is above 5 MB. OpenPMM does not change an
animated GIF, because that would remove the animation.

## Limits that OpenPMM cannot check

X documents a closed group of pictures (GOP). OpenPMM cannot read this property from the file. Make sure that your encoder writes a closed GOP.

## Provider documentation

[X media best practices](https://docs.x.com/x-api/media/quickstart/best-practices)
