Menu

1 / 2

Converting iPhone HEVC Videos to Telegram Avatars With ffmpeg

DEV Community·liveavabot·7 months ago
#fxkwnx2K
#telegram#python#ffmpeg#message#800x800
Long article (1204 words) — no AI summary yet.
Reading 0:00
15s threshold

The Problem Nobody Warns You About

You open Telegram, try to set a video avatar, upload a clip from your iPhone, and nothing happens. No error. The upload completes, Telegram just silently ignores it. If you're lucky, you get a generic "wrong format" toast. Usually you get nothing.

The issue is HEVC (H.265). Every iPhone since 2017 records in HEVC by default. Telegram's video avatar feature requires H.264, yuv420p pixel format, 800x800 resolution, under 10 seconds, under 2MB, and no audio track. HEVC satisfies zero of those constraints. Telegram doesn't tell you any of this.

I ran into this personally, got annoyed, and built a bot to fix it.

What Telegram Actually Requires

The spec (pulled from the Bot API docs and empirical testing) is specific:

Codec: H.264 baseline or main profile

Pixel format: yuv420p (4:2:0 chroma subsampling)

Resolution: exactly 800x800

Duration: 10 seconds max (Telegram crops longer clips client-side, but better to cut at encode)

File size: 2MB max

Audio: must be absent…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.