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.

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.
| Requirement | Telegram | Sume video-trim |
|---|---|---|
| Container and codec | GIF or H.264/MPEG-4 AVC | precision exact re-encodes with libx264, yuv420p |
| Sound | none | audio set to drop |
| Size | 50 MB at most | not a field; check the result |
| Length | not stated | duration 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
- sendAnimation or sendVideo for a short AI clip: which Telegram method
Pick sendAnimation for a silent looping clip, sendVideo for sound or a poster cover. How the Bot API methods differ and how Sume video-trim preps both.
- Telegram sendMediaGroup: 2-10 items, building an AI image album
sendMediaGroup sends 2 to 10 photos or videos as one album. Batch-generate a matching set with the Sume images API and keep each file inside the photo limits.
- Telegram sendPhoto limits: 10 MB, 10000 px, 20:1 ratio
Telegram sendPhoto rejects photos over 10 MB, over 10000 px width plus height, or past 20:1. How to size an AI image with Sume before the bot sends it.
- Telegram sendVideo cover and start_timestamp: pick a poster frame
sendVideo takes a cover image and a start_timestamp in seconds. Use Sume video-frames to pull candidate stills from a generated clip and choose the poster.
Written by Sume