Telegram sendAnimation: H.264 without sound, 50 MB, how to trim one

sendAnimation takes a GIF or H.264/MPEG-4 clip without sound, up to 50 MB. Cut a short silent loop from a generated video with Sume video-trim audio drop.

4 min readSume
All posts

Telegram's sendAnimation accepts GIF files or H.264/MPEG-4 AVC video without sound, up to 50 MB. The requirement that matters for generated clips is the missing audio: a normal video with a soundtrack does not fit the description. Sume's video-trim has an audio field, so one call can cut a short segment and set audio to drop, giving you a silent MP4 that matches the method.

What does sendAnimation actually accept?

The Bot API describes the method as the way to send animation files, defined as GIF or H.264/MPEG-4 AVC video without sound. It sets the current limit at 50 MB for these uploads, and notes that bots may change that limit in the future. Because the limit is stated for the method, treat 50 MB as a ceiling to stay under rather than a target.

sendAnimation requirements and the matching Sume trim field (read 2026-10-02)
RequirementTelegramSume video-trim
Container and codecGIF or H.264/MPEG-4 AVCprecision exact re-encodes with libx264, yuv420p
Soundnoneaudio set to drop
Size50 MB at mostnot a field; check the result
Lengthnot statedduration 0.2-900 seconds

How do I make the silent clip?

Send video_url, start, and exactly one of end or duration, plus audio: "drop". The default precision of exact re-encodes frame-accurately with libx264 in yuv420p, which is the H.264 the method names. Do not use keyframe here; it stream-copies and keeps the source codec as it is. You can also conform size with output (width and height 256-2160, fps 24, 25, 30 or 60), which only works with exact precision.

import json, os, urllib.request

body = {
    "video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
    "start": 2,
    "duration": 6,
    "audio": "drop",
    "output": {
        "width": 720,
        "height": 1280,
        "fps": 30
    }
}
req = urllib.request.Request(
    "https://api.sume.com/v1/video-trim",
    data=json.dumps(body).encode(),
    headers={
        "Authorization": "Bearer " + os.environ["SUME_API_KEY"],
        "Content-Type": "application/json",
        "Idempotency-Key": "animation-001",
    },
    method="POST",
)
print(urllib.request.urlopen(req).read().decode())

How do I keep it under 50 MB?

Shorter and smaller does most of the work. Cut a few seconds, lower the output dimensions, and use 24 or 30 fps. Sume does not expose bitrate or CRF controls, and the API refuses fields such as codec and crf with ffmpeg_fields_rejected, so size is controlled by duration and dimensions alone. Measure the result before the upload.

Is the trim job billed?

The video-trim page lists $0.02 per job and says to confirm the live number in GET /v1/catalog. There is no provider inference, only worker ffmpeg. The call requires an Idempotency-Key, so a retry after a timeout does not create a second job. Details are in the video trim guide.

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume