I built @liveavabot last year to fix a stupid problem: iPhone videos silently fail as Telegram video avatars. The bot has processed conversions for 290 users so far, and a few of them asked the same question: "can I hit this from my own code?"

So I shipped a REST API. This post walks through the Telegram spec that makes video avatars weird, the ffmpeg pipeline that solves it, and how to call the new endpoint from your own app.

Why video avatars are harder than they look

Telegram's video avatar format is picky. The spec, if you dig into the Bot API docs and the desktop client source, boils down to:

Codec: H.264 (yuv420p pixel format), audio track removed