Mastodon GIF under 1 megapixel, no sound: send a trimmed MP4 instead

Mastodon limits GIFs to 16 MB and under 1 megapixel (1280x720) and turns them into soundless MP4s. For sound, upload a trimmed video made with Sume instead.

5 min readSume
All posts

If your clip needs sound, do not post it to Mastodon as a GIF. Mastodon's documentation says animated GIFs can be up to 16 MB, their dimensions must be less than 1 megapixel (1280 x 720), and they are converted to soundless MP4s, with only one per post (read 2026-10-03). A video can have audio and may be up to 99 MB, so a short trimmed MP4 is the better container. Sume's video trim can make that file from a clip you host.

Here are the attachment rules side by side and a script for a Mastodon-friendly cut.

Mastodon's attachment rules

The Posting page lists each attachment type. Images (PNG, JPG, HEIF, WEBP, AVIF) can be up to 16 MB and are downscaled to 8.3 megapixels, with up to four per post. Animated GIFs are up to 16 MB and one per post. Videos (MP4, M4V, MOV, WebM) can be up to 99 MB and are transcoded to H.264 MP4 with a maximum bitrate of 1300 kbps and a frame rate of up to 120 fps, one per post. Audio can be up to 99 MB, also one per post (read 2026-10-03). Polls take up to four choices of 25 characters each.

Mastodon attachment limits, read 2026-10-03
TypeSize limitOther rules
Image16 MBDownscaled to 8.3 megapixels; up to 4 per post
Animated GIF16 MBUnder 1 megapixel (1280x720); converted to a soundless MP4; 1 per post
Video99 MBTranscoded to H.264 MP4, max 1300 kbps; 1 per post
Audio99 MBTranscoded to MP3; 1 per post

Cut a small MP4 with video trim

Video trim returns a new MP4 for a range of one hosted clip, with an optional output size (256 to 2160 per edge) and fps. A 1280 x 720 cut at 30 fps is a good fit, since Mastodon transcodes video to a bitrate ceiling anyway and larger pictures only add upload time. Keep the audio if the clip has any, or set audio to drop when you want it silent.

The server will re-encode your upload to 1300 kbps at most, so a very short, simple clip survives better than a long, busy one. Sume has no bitrate field, so you cannot choose the figure. The script cuts 8 seconds and prints the URL; read the size afterwards with a HEAD request.

import os, time, requests
BASE = "https://api.sume.com"
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}

def run(path, body, key):
    r = requests.post(BASE + path, headers={**H, "Idempotency-Key": key}, json=body)
    r.raise_for_status()
    job = r.json()["request_id"]
    while True:
        s = requests.get(f"{BASE}/v1/jobs/{job}/status", headers=H).json()["status"]
        if s in ("completed", "failed", "canceled"):
            break
        time.sleep(3)
    return s, (requests.get(f"{BASE}/v1/jobs/{job}/result", headers=H).json() if s == "completed" else None)

status, res = run("/v1/video-trim", {
    "video_url": "https://media.sume.com/artifacts/artf_demo/clip.mp4",
    "start": 1, "duration": 8,
    "output": {"width": 1280, "height": 720, "fps": 30}}, "mastodon-cut-001")
if res:
    size = int(requests.head(res["video_url"], allow_redirects=True).headers["Content-Length"])
    print(res["video_url"], size, "OK" if size < 99 * 1024 * 1024 else "too big for Mastodon")
else:
    print(status)

Images are a different limit

Stills follow other rules. Mastodon accepts up to four images per post, each up to 16 MB, and downscales anything above 8.3 megapixels, so a 4000 x 3000 photo (12 million pixels) will be reduced on the server (read 2026-10-03). If you pull a still from a clip with video frames, you get the source size, which for most clips is far under that limit, so no downscale applies.

The page does not state a character limit for alt text, so do not rely on one here. Write the description for each image yourself, and keep the file the same size you tested.

A checklist before you post

Pick the container by need: sound or captions means MP4, no sound and a loop means GIF, and a still means an image. Check the size against the matching row, and remember that only one video or one GIF fits in a post, while images can go up to four.

Test one post in a private or follow-only setting first. Instances can set their own rules on top of the documentation, so a file that works on one server may be refused by another. Note the date you read the page; the limits can change when the project releases a new version.

When a GIF is still right

A GIF is fine when the clip has no sound, is short, and has to play everywhere without a player. If you keep it, check the two numbers Mastodon names: 16 MB and under 1 megapixel. 1280 x 720 is 921,600 pixels, which sits just under one million, while 1280 x 800 would be over it. Sume's docs describe video output, not GIF output, so make the GIF in another tool.

Also keep in mind that Mastodon turns the GIF into a soundless MP4 on its side. If the audio matters, or if you want captions burned in, post the video.

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume