A powerful Telegram bot for video transcoding with multiple format support, quality presets, and batch processing capabilities.
- Multiple Resolutions: 240p, 360p, 480p, 720p, 1080p
- Various Formats: MP4, MKV, AVI, WebM, MOV
- Quality Presets: Ultra Fast to Very Slow encoding
- Custom Watermarks: Add your brand/text overlay
- Batch Processing: Convert multiple resolutions at once
- Progress Tracking: Real-time conversion progress
- Video Analysis: Detailed video information display
- Smart Compression: Optimal bitrate selection
- Queue Management: Handle multiple users efficiently
- Admin Panel: System monitoring and management
- Usage Statistics: Track user activity and processing
- Error Handling: Comprehensive error management
- Session Management: Automatic cleanup of old files
- Resource Monitoring: CPU, memory, and disk usage tracking
- Health Checks: Built-in health monitoring for deployment
- Create a Telegram bot via @BotFather
- Get your Telegram API credentials from my.telegram.org
- Create a Render account
Set these environment variables in your Render dashboard:
API_ID- Your Telegram API ID (integer)API_HASH- Your Telegram API Hash (string)BOT_TOKEN- Your bot token from BotFather
ADMIN_IDS- Comma-separated list of admin user IDs (e.g., "123456789,987654321")MAX_FILE_SIZE- Maximum file size in bytes (default: 2147483648 = 2GB)WATERMARK_TEXT- Text to overlay on videos (default: "@YourBrand")MAX_CONCURRENT_PROCESSES- Max simultaneous conversions (default: 3)SESSION_TIMEOUT- Session timeout in seconds (default: 3600)DEFAULT_QUALITY- Default encoding quality (default: "fast")DEFAULT_RESOLUTION- Default resolution (default: "720p")DEFAULT_FORMAT- Default output format (default: "mp4")
-
Fork this repository or create a new one with these files
-
Connect to Render:
- Go to Render Dashboard
- Click "New +" → "Web Service"
- Connect your GitHub repository
-
Configure the service:
- Name:
video-encoder-bot - Environment:
Python 3 - Build Command:
pip install -r requirements.txt - Start Command:
python bot.py - Plan: Free (or paid for better performance)
- Name:
-
Set Environment Variables:
- Add all required environment variables in the Render dashboard
- Make sure to set
API_ID,API_HASH, andBOT_TOKEN
-
Deploy:
- Click "Create Web Service"
- Wait for deployment to complete
- Go to my.telegram.org
- Log in with your phone number
- Go to "API Development Tools"
- Create a new application
- Copy your
api_idandapi_hash
- Message @BotFather on Telegram
- Send
/newbot - Follow the instructions to create your bot
- Copy the bot token provided
- Message @userinfobot on Telegram
- Copy your user ID
- Add it to the
ADMIN_IDSenvironment variable
/start- Welcome message and bot introduction/help- Detailed help and instructions/stats- Your usage statistics/formats- List of supported formats and resolutions/admin- Admin panel (admins only)
- Send a video file to the bot (max 2GB)
- Choose conversion type:
- Quick Convert: Fast processing with good quality
- Advanced Options: Custom resolution, format, and quality
- Batch Convert: Multiple resolutions at once
- Wait for processing - Progress will be shown
- Download your converted video(s)
- 240p - Low quality, small file size
- 360p - Standard quality for mobile
- 480p - Good quality for web
- 720p - HD quality (recommended)
- 1080p - Full HD quality
- Ultra Fast - Fastest processing, larger files
- Fast - Good balance of speed and quality
- Medium - Better quality, moderate speed
- Slow - High quality, slower processing
- Very Slow - Best quality, slowest processing
- MP4 - Most compatible, recommended
- MKV - High quality container
- AVI - Legacy compatibility
- WebM - Web optimized
- MOV - Apple/QuickTime compatible
- CPU: Multi-core recommended for faster processing
- RAM: 512MB minimum, 1GB+ recommended
- Storage: 10GB+ for temporary files
- FFmpeg: Required for video processing
- Uses efficient FFmpeg presets
- Automatic cleanup of temporary files
- Queue management for multiple users
- Resource monitoring and limits
- User session isolation
- File size limits
- Processing timeouts
- Admin-only commands
- Automatic cleanup
- Check if all environment variables are set correctly
- Verify bot token is valid
- Check Render logs for errors
- Ensure input file is a valid video
- Check if file size is within limits
- Verify FFmpeg is working (should be automatic)
- Reduce
MAX_CONCURRENT_PROCESSES - Use faster quality presets
- Process smaller files
- Use
/admincommand to check system status - Monitor Render dashboard for resource usage
- Check logs for error messages
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
For support and questions:
- Check the troubleshooting section
- Review Render logs
- Create an issue on GitHub
- Contact the bot admin (if you're a user)
Note: This bot is designed for educational and personal use. Ensure you comply with Telegram's Terms of Service and respect copyright laws when processing videos.