Converting iPhone HEVC Videos into Telegram Video Avatars with ffmpeg
A developer found that an HEVC (H.265) clip recorded on an iPhone was silently rejected as a Telegram video avatar, since the platform requires H.264 in an MP4 container. The spec calls for an 800x800 square frame, a maximum of 10 seconds, and a file size of 2 MB or less, with audio stripped. The workflow uses ffmpeg's cropdetect to find the content region, then crops, scales, and re-encodes to H.264 at yuv420p, raising the CRF value step by step if the output exceeds the size limit. The author also shares an aiogram 3 bot handler that accepts videos, GIF-style animations, and video documents and runs these commands automatically.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in