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-07-29 20:50:27 +03:00
|
|
|
java -jar ./build/libs/ffmpegbot-1.2-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
|
|
|
|
docker run -d -t -i \
|
|
|
|
-e BOT_TOKEN='...' \
|
|
|
|
-e APP_ID='...' \
|
2024-09-03 21:27:51 +03:00
|
|
|
-e APP_HASH='...' \
|
|
|
|
-e SUPERUSERS='12345' \
|
|
|
|
-e ALLOWED_USERS='12346,12347' \
|
2024-09-04 20:09:25 +03:00
|
|
|
--name ffmpegbot ghcr.io/annimon/ffmpegbot:latest
|
2023-05-22 22:26:22 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Environment variables
|
|
|
|
|
|
|
|
- `BOT_TOKEN` — Telegram bot token
|
|
|
|
- `APP_ID` — Telegram API app_id (see https://core.telegram.org/api/obtaining_api_id)
|
|
|
|
- `APP_HASH` — Telegram API app_hash
|
2024-09-03 21:27:51 +03:00
|
|
|
- `SUPERUSERS` — Comma-separated list of superusers. Superuser can execute /run command
|
|
|
|
- `ALLOWED_USERS` — Comma-separated list of allowed user ids
|