Skip to content

FULL video translation (output mp4) via Telegram bot, works for video, audio and voice (everything is free & self-hosted)

Notifications You must be signed in to change notification settings

nezort11/video-translate-bot

Repository files navigation

video translate bot

⚙️ Architecture

Full video translate architecture:

  1. Translate video/audio stream (api.browser.yandex.ru/video-translation/translate) (protobuf)
  2. Download original audio/video stream (youtube-dl)
  3. Mix translated audio with original video/audio (ffmpeg) (10%:100% ratio)
  4. Get video metadata, download thumbnail (opengraph)
  5. Translate video thumbnail (translate.yandex.com/ocr) (puppeteer)
  6. Upload final [large] video/audio stream (telegram) (gramjs)

1-3 steps can theoretically be moved to the client (in case WASM is supported) in order to reduce server computational resources

Setup

# nvm install 18 && nvm use
# or
volta install node@18 # should be automatically pin

which node
node --version

which pnpm
corepack enable [email protected]
pnpm --version
pnpm install

Start

git pull
# make sure right owner are set correctly after
sudo chown -R pi:pi .
# make sure run.sh script is executable
chmod +x ./run.sh

# git update-index --chmod=+x ./run.sh

# don't use sudo, because root mode will break some docker-push/yc/aws stuff
# NOTE: without sudo docker user crontab stuff sometimes crashes...
./run.sh docker:build
./run.sh docker:up

Deploy

sudo bash ./run.sh docker:build
sudo bash ./run.sh docker:up

sudo bash ./run.sh docker:restart

cli

url='https://youtu.be/x8J3a5ty3zw' pnpm cli

About

FULL video translation (output mp4) via Telegram bot, works for video, audio and voice (everything is free & self-hosted)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published