- 🎯 Circle Videos - Creates perfect circular videos with the same overlay as in Telegram for Android
- ⚡ Fast Processing - Uses optimized ffmpeg pipeline for maximum speed
- 🎵 Audio Encoding - Encodes audio to AAC 96k for optimal quality and size
- 📐 Smart Cropping - Automatic centering and scaling
- 🎬 Video Segmentation - Automatically splits long videos into 60-second segments
- 🔧 Simple Usage - Only /start and /help commands
git clone https://github.com/bohd4nx/Telegram-Video-Bot.git
cd Telegram-Video-Bot
pip install -r requirements.txt# macOS (Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
# Windows (Chocolatey)
choco install ffmpeg
# Windows (Scoop)
scoop install ffmpegCreate .env file in project root:
# Get token from @BotFather
BOT_TOKEN=your_bot_token_herepython main.py/start- Welcome message and instructions/help- Detailed usage guide
- Send video to bot
- Wait for processing (⏳ Processing...)
- Receive circular video with white background (like original Telegram format)
- Forward as regular video note
- Format: MP4, AVI, MOV and others
- Size: Up to 20MB
- Duration: Recommended up to 60 seconds
- Resolution: Any (automatically processed)
- Format: Circular video (video note)
- Resolution: Up to 640×640 (optimized for Telegram)
- Codec: H.264 + AAC
- Background: White outside circle
- Audio: Preserved from original
- Download - Get video from user
- Analysis - Determine dimensions and parameters
- Cropping - Extract square from frame center
- Mask - Apply circular mask with white background
- Scaling - Resize to optimal dimensions
- Audio - Merge with original audio via FFmpeg
- Upload - Send as video note to Telegram
- Maximum resolution 640×640 for Telegram compliance
- Even dimensions for codec compatibility
- Fast FFmpeg presets for speed
- Automatic temporary file cleanup
| Error | Cause | Solution |
|---|---|---|
| File too large | File > 20MB | Compress video |
| Voice messages disabled | Voice messages turned off | Enable in settings |
| Processing error | Processing failure | Check video format |
FROM python:3.12-slim
RUN apt-get update && apt-get install -y ffmpeg
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "main.py"]BOT_TOKEN=your_telegram_bot_tokenMade with ❤️ by @bohd4nx
Star ⭐ this repo if you found it useful!