A powerful Telegram bot for video processing using FFmpeg. Deploy on your VPS or Heroku for full control over video manipulation.
| Feature | Description |
|---|---|
| FFMPEG CMD | Run custom FFmpeg commands |
| MegaMetaData | Edit video metadata |
| Vid+Vid | Merge/concatenate videos |
| Vid+Aud | Add or replace audio track |
| Vid+Sub | Add subtitle track |
| StreamSwap | Reorder streams |
| Extract | Extract video/audio/subtitles |
| Remove | Remove specific streams |
| Encode | Re-encode with quality settings |
| Convert | Change format (mp4, mkv, webm, gif, etc.) |
| Watermark | Add image/text watermark |
| Sub Intro | Add text intro to video |
| Hardsub | Burn subtitles into video |
| Trim | Cut video segments |
- Real-time Progress Tracking: Detailed list-style progress bars for all operations
- Clean UI: Minimalist, emoji-free interface for better readability
- Video speed change (0.25x - 4x)
- Video rotation and flip
- Resolution change
- Video compression
- Screenshot extraction
- Thumbnail extraction
- Audio extraction (MP3, AAC, FLAC, etc.)
- Google Drive upload (for files >2GB)
| Feature | Description |
|---|---|
| YT-DLP Support | Download from YouTube, Vimeo, Twitter, and 1000+ sites |
| Encoding Profiles | Quick presets: High Quality, Balanced, Small Size |
| Task Queuing | Queue multiple tasks per user (configurable limit) |
| Authorized Groups | Restrict bot to specific Telegram groups |
| Persistent Settings | User preferences saved to MongoDB |
| Upload Preferences | Toggle default upload destination (Telegram/GDrive) |
- VPS with 1+ CPU cores, 2GB+ RAM
- Docker and Docker Compose
- Telegram Bot Token
- Google Service Account (optional, for GDrive upload)
git clone https://github.com/yourusername/ffmpeg-processor-bot.git
cd ffmpeg-processor-botcp config.env.sample config.env
nano config.envEdit config.env with your credentials:
BOT_TOKEN=your_bot_token_here
OWNER_ID=your_telegram_id
API_ID=your_api_id
API_HASH=your_api_hash
MONGO_URI=mongodb://mongodb:27017
# Limits
MAX_FILE_SIZE=2000
TG_MAX_FILE_SIZE=2000
MAX_DURATION=7200
# Google Drive (optional)
GDRIVE_ENABLED=True
GDRIVE_CREDENTIALS=credentials.json
GDRIVE_FOLDER_ID=your_folder_id- Go to Google Cloud Console
- Create a new project
- Enable Google Drive API
- Create a Service Account and download
credentials.json - Place
credentials.jsonin the bot directory - Share your destination folder with the service account email
docker-compose up -d --builddocker-compose logs -f ffmpeg-bot# Ubuntu/Debian
sudo apt update
sudo apt install -y python3.10 python3-pip ffmpeg mediainfo
# Install Python packages
pip3 install -r requirements.txtpython3 -m bot| Variable | Required | Description |
|---|---|---|
BOT_TOKEN |
β | Telegram Bot Token from @BotFather |
OWNER_ID |
β | Your Telegram user ID |
API_ID |
β | Telegram API ID from my.telegram.org |
API_HASH |
β | Telegram API Hash from my.telegram.org |
MONGO_URI |
β | MongoDB connection string |
AUTHORIZED_USERS |
β | Comma-separated user IDs (empty = public) |
AUTHORIZED_GROUPS |
β | Comma-separated group IDs (empty = all groups) |
ENABLE_YTDLP |
β | Enable YT-DLP for video platforms (True/False) |
MAX_QUEUE_PER_USER |
β | Max pending tasks per user (default: 3) |
LOG_CHANNEL |
β | Channel ID to forward processed files (0 = off) |
MAX_FILE_SIZE |
β | Maximum download size in MB (default: 2000) |
TG_MAX_FILE_SIZE |
β | Max file size for TG upload (default: 2000) |
MAX_DURATION |
β | Max video duration in seconds (default: 7200) |
DEFAULT_AUDIO_BITRATE |
β | Audio bitrate for encoding (default: 192k) |
GDRIVE_ENABLED |
β | Enable Google Drive upload (True/False) |
GDRIVE_CREDENTIALS |
β | Path to credentials.json |
GDRIVE_FOLDER_ID |
β | Google Drive folder ID for uploads |
| Command | Description |
|---|---|
/start |
Start the bot |
/help |
Show help message |
/settings |
View your settings |
/vset |
View detailed encode settings |
/thumb |
View/Set custom thumbnail |
/reset |
Reset user settings |
/queue |
View active tasks list |
/status |
View system status |
/dl |
Reply to file/video to process |
/zip |
Archive file/video |
/unzip |
Extract archive |
/cancel |
Cancel current operation |
| Command | Description |
|---|---|
/authgrp |
Authorize groups (run in group to toggle) |
/cookies |
Manage YT-DLP cookies (upload cookies.txt) |
/gdrive |
Manage GDrive credentials (upload credentials.json) |
/stats |
Bot statistics |
/broadcast |
Broadcast message to all users |
/update |
Update bot from GitHub (auto-restart) |
/restart |
Restart the bot |
/log |
View bot logs |
/shell |
Run shell commands |
/clean |
Clean cache folders |
/speedtest |
Run server speedtest |
- Install "Get cookies.txt LOCALLY" Chrome extension
- Go to YouTube and login to your account
- Click extension icon β Export cookies.txt
- Send
/cookies setin bot β Upload the file - YouTube downloads should now work!
The bot supports two methods: OAuth (Recommended) and Service Account.
This method allows the bot to upload directly to your "My Drive" without complex sharing.
- Go to Google Cloud Console
- Create a project β Enable Google Drive API
- Go to Credentials β + Create Credentials β OAuth Client ID
- Application Type: Desktop App
- Click Create and Download JSON
- Important: Go to OAuth Consent Screen
- Set User Type: External (if not using Workspace)
- Publish the App (otherwise login expires in 7 days)
- Add your email as a Test User (if blocked from publishing)
- Send
/gdrive setin bot β Upload the JSON file - Send
/gdrive loginβ Click the link- Note: If you see "Google hasn't verified this app", click Advanced β Go to App (unsafe). This is normal for your own private app.
- Note 2: If the redirect fails (Connection Refused), copy the
code=...from the URL bar.
- Send
/gdrive auth <code>to finish.
Useful for automated environments or shared drives.
- Go to IAM & Admin β Service Accounts
- Click (+ Create Service Account) β Done
- Click on the created email β KEYS tab β ADD KEY β JSON
- Send
/gdrive setin bot β Upload the JSON - Share your destination folder with the Service Account Email (Editor access)
- Send
/gdrive folder <FOLDER_ID>to set the target.
Run /authgrp in any group to authorize/de-authorize it.
- Running in group toggles authorization
/authgrpin private shows authorized groups list/authgrp add <ID>or/authgrp remove <ID>to manage manually
- Send a video file to the bot
- Select an operation from the menu
- Follow the prompts
- Receive your processed video!
- Click Vid+Vid in the menu
- Send multiple videos or YouTube URLs
- Click Done - Start Merge when finished
- Videos will be merged in order
Join our Telegram channel for updates and support.
MIT License - See LICENSE file for details.