How I Built a Telegram Video Avatar Bot With Python and FFmpeg

📰 Dev.to · liveavabot

Learn how to build a Telegram video avatar bot using Python and FFmpeg to convert videos to compatible formats

intermediate Published 21 Apr 2026
Action Steps
  1. Record a short video clip using a device like an iPhone
  2. Use FFmpeg to convert the video from HEVC (H.265) to H.264, a format compatible with Telegram's video avatar system
  3. Write a Python script to interact with the Telegram API and upload the converted video as an avatar
  4. Test the bot to ensure it works correctly and handles potential errors
  5. Deploy the bot on a server or platform to make it accessible to users
Who Needs to Know This

This project is beneficial for developers and engineers who want to create custom Telegram bots or automate tasks, especially those interested in video processing and conversion

Key Insight

💡 Telegram's video avatar system only accepts H.264 videos, so converting from HEVC (H.265) is necessary

Share This
🤖 Build a Telegram video avatar bot with Python and FFmpeg! 📹💻

Key Takeaways

Learn how to build a Telegram video avatar bot using Python and FFmpeg to convert videos to compatible formats

Full Article

Title: How I Built a Telegram Video Avatar Bot With Python and FFmpeg

URL Source: https://dev.to/liveavabot/how-i-built-a-telegram-video-avatar-bot-with-python-and-ffmpeg-o9p

Published Time: 2026-04-21T13:05:20Z

Markdown Content:
# How I Built a Telegram Video Avatar Bot With Python and FFmpeg - DEV Community
[Skip to content](https://dev.to/liveavabot/how-i-built-a-telegram-video-avatar-bot-with-python-and-ffmpeg-o9p#main-content)

[![Image 1: DEV Community](https://media2.dev.to/dynamic/image/quality=100/https://dev-to-uploads.s3.amazonaws.com/uploads/logos/resized_logo_UQww2soKuUsjaOGNB38o.png)](https://dev.to/)

[Powered by Algolia](https://www.algolia.com/developers/?utm_source=devto&utm_medium=referral)

[Log in](https://dev.to/enter?signup_subforem=1)[Create account](https://dev.to/enter?signup_subforem=1&state=new-user)

## DEV Community

![Image 2](https://assets.dev.to/assets/heart-plus-active-9ea3b22f2bc311281db911d416166c5f430636e76b15cd5df6b3b841d830eefa.svg)0 Add reaction

![Image 3](https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg)0 Like ![Image 4](https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg)0 Unicorn ![Image 5](https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg)0 Exploding Head ![Image 6](https://assets.dev.to/assets/raised-hands-74b2099fd66a39f2d7eed9305ee0f4553df0eb7b4f11b01b6b1b499973048fe5.svg)0 Raised Hands ![Image 7](https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg)0 Fire

0 Jump to Comments 0 Save Boost

Copy link

Copied to Clipboard

[Share to X](https://twitter.com/intent/tweet?text=%22How%20I%20Built%20a%20Telegram%20Video%20Avatar%20Bot%20With%20Python%20and%20FFmpeg%22%20by%20liveavabot%20%23DEVCommunity%20https%3A%2F%2Fdev.to%2Fliveavabot%2Fhow-i-built-a-telegram-video-avatar-bot-with-python-and-ffmpeg-o9p)[Share to LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fdev.to%2Fliveavabot%2Fhow-i-built-a-telegram-video-avatar-bot-with-python-and-ffmpeg-o9p&title=How%20I%20Built%20a%20Telegram%20Video%20Avatar%20Bot%20With%20Python%20and%20FFmpeg&summary=I%20tried%20to%20set%20a%20video%20avatar%20on%20Telegram%20last%20month.%20Recorded%20a%20short%20clip%20on%20my%20iPhone%2C%20uploaded...&source=DEV%20Community)[Share to Facebook](https://www.facebook.com/sharer.php?u=https%3A%2F%2Fdev.to%2Fliveavabot%2Fhow-i-built-a-telegram-video-avatar-bot-with-python-and-ffmpeg-o9p)[Share to Mastodon](https://s2f.kytta.dev/?text=https%3A%2F%2Fdev.to%2Fliveavabot%2Fhow-i-built-a-telegram-video-avatar-bot-with-python-and-ffmpeg-o9p)

[Share Post via...](https://dev.to/liveavabot/how-i-built-a-telegram-video-avatar-bot-with-python-and-ffmpeg-o9p#)[Report Abuse](https://dev.to/report-abuse)

[![Image 8: liveavabot](https://media2.dev.to/dynamic/image/width=50,height=50,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3881261%2F7c3ae75d-32b0-4012-b30c-77efe6621a40.jpg)](https://dev.to/liveavabot)

[liveavabot](https://dev.to/liveavabot)
Posted on Apr 21

# How I Built a Telegram Video Avatar Bot With Python and FFmpeg

[#telegram](https://dev.to/t/telegram)[#python](https://dev.to/t/python)[#ffmpeg](https://dev.to/t/ffmpeg)[#showdev](https://dev.to/t/showdev)

I tried to set a video avatar on Telegram last month. Recorded a short clip on my iPhone, uploaded it, and nothing happened. No error message. No toast notification. Telegram just silently rejected it.

Turns out iPhone records in HEVC (H.265) by default since the iPhone 7. Telegram's video avatar system only accepts H.264. When you upload HEVC, the server validates it, fails, and tells you absolutely nothing.

I spent two hours thinking my internet connection was broken before I figured this out.

## [](https://dev.to/l
Read full article → ← Back to Reads

Related Videos

How to Create ONE PAGE Website using Claude AI (FREE & FAST)
How to Create ONE PAGE Website using Claude AI (FREE & FAST)
Quick Tips - Web Desiign & Ai Tools
Microsoft Bot Framework Web Chat Authentication with Microsoft Graph API Call using Auth Token in C#
Microsoft Bot Framework Web Chat Authentication with Microsoft Graph API Call using Auth Token in C#
Dewiride Technologies
4.3. Using Directline Channel/API in Azure Bot Service using Postman | Token | Send/Receive Activity
4.3. Using Directline Channel/API in Azure Bot Service using Postman | Token | Send/Receive Activity
Dewiride Technologies
4.2. Create the Azure Bot Service on Azure Portal | WhatsApp ChatGPT
4.2. Create the Azure Bot Service on Azure Portal | WhatsApp ChatGPT
Dewiride Technologies
4.1. Create the sample Chatbot with Microsoft Bot Framework SDK C# | WhatsApp ChatGPT
4.1. Create the sample Chatbot with Microsoft Bot Framework SDK C# | WhatsApp ChatGPT
Dewiride Technologies
2. Calling WhatsApp Business Cloud API from Postman | WhatsApp ChatGPT Bot | Beginner Tutorial
2. Calling WhatsApp Business Cloud API from Postman | WhatsApp ChatGPT Bot | Beginner Tutorial
Dewiride Technologies