2023-10-20 21:30:31 +03:00
|
|
|
# ffmpegbot
|
2023-01-10 17:21:10 +02:00
|
|
|
|
|
|
|
Telegram Bot for re-encoding media
|
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
- change a video resolution, bitrate, frame rate, speed
|
|
|
|
- change an audio bitrate, volume, pitch
|
|
|
|
- apply audio effects
|
|
|
|
- extract or remove audio from the video
|
|
|
|
- resend video note as a regular video, or video as an audio track
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- Telegram bot username and token, [@BotFather](https://t.me/BotFather)
|
2023-01-10 17:32:28 +02:00
|
|
|
- JRE 17+ or JDK 17+ (for build)
|
2023-01-10 17:21:10 +02:00
|
|
|
- `ffmpeg` must be installed and available in `PATH`.
|
2023-01-20 23:21:32 +02:00
|
|
|
- `python3` version 3.8+ must be installed and available in `PATH`.
|
2023-01-10 17:21:10 +02:00
|
|
|
- `yt-dlp` for `/dl` command.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2023-05-22 00:08:54 +03:00
|
|
|
### Manual
|
|
|
|
|
2023-01-10 17:21:10 +02:00
|
|
|
```bash
|
|
|
|
# Build
|
|
|
|
./gradlew shadowJar
|
|
|
|
# Config
|
|
|
|
cp ffmpegbot.yaml.template ffmpegbot.yaml
|
|
|
|
vim ffmpegbot.yaml
|
2023-01-10 17:32:28 +02:00
|
|
|
mkdir {input,output}
|
2023-01-10 17:21:10 +02:00
|
|
|
# Run
|
2024-06-30 22:39:54 +03:00
|
|
|
java -jar ./build/libs/ffmpegbot-1.1.1-SNAPSHOT-all.jar
|
2023-01-10 17:21:10 +02:00
|
|
|
```
|
2023-05-22 22:26:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
### Using Docker
|
|
|
|
|
|
|
|
Note: FFmpeg binary might be installed with limited number of filters and codecs. Some bot features might not work (Audio pitch, robot effect, etc).
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Edit user ids in `superUsers` and `allowedUsers` fields
|
|
|
|
vim ffmpegbot-docker.yaml
|
|
|
|
docker build --tag 'ffmpegbot' .
|
|
|
|
docker run -d -t -i \
|
|
|
|
-e BOT_TOKEN='...' \
|
|
|
|
-e BOT_USERNAME='...' \
|
|
|
|
-e APP_ID='...' \
|
|
|
|
-e APP_HASH='...'\
|
|
|
|
--name ffmpegbot ffmpegbot:latest
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Environment variables
|
|
|
|
|
|
|
|
- `BOT_TOKEN` — Telegram bot token
|
|
|
|
- `BOT_USERNAME` — Telegram bot username
|
|
|
|
- `APP_ID` — Telegram API app_id (see https://core.telegram.org/api/obtaining_api_id)
|
|
|
|
- `APP_HASH` — Telegram API app_hash
|
|
|
|
|