Skip to main content

Automatic subtitles translation with a local neural machine translation model. No third-party service required: the translation is done locally with small but efficient neural network models.

Project description

Neural Subtitles Translator

Release Build status PyPI pyversions codecov Commit activity License

Automatic subtitles translation with a local neural machine translation model. No third-party service required: the translation is done locally with small but efficient neural network models.

Github repository: https://github.com/tdhm/subtitles-translator/

Documentation https://tdhm.github.io/Subtitles-Translator/

Original movie in French Output of automatic translation

Note Screenshots are taken from Bon voyage, a short French language propaganda film made by Alfred Hitchcock for the British Ministry of Information. This film is now in the Public Domain.

Installation

Subtitles Translator is available as subtitles_translator on PyPI:

pip install subtitles_translator

You'll also need to install ffmpeg, which is available from most package managers:

# on macOS using Homebrew (https://brew.sh/)
brew install ffmpeg

# on Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg

# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg

Usage

Note Please note that the current version only supports MP4 video files (MKV support coming soon). Your MP4 must contain only one subtitles track, which will be translated and replaced in a new MP4 file. You can also translates SRT subtitles files, or extract and translate SRT files from a MP4 (look at the doc!).

With the following command, subtitles from 'video.mp4' will be extracted and translated from 'french' to 'english'. The video containing translated subtitles will be saved as 'translated_video.mp4':

subtitles_translator -i video.mp4 -o translated_video.mp4 -s fr -t en

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subtitles_translator-0.0.3.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

subtitles_translator-0.0.3-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file subtitles_translator-0.0.3.tar.gz.

File metadata

  • Download URL: subtitles_translator-0.0.3.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1037-azure

File hashes

Hashes for subtitles_translator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 608927c24ca232ed415b353de025c493650a0b274e0853680f43f838799eae19
MD5 2448d192d4ca9a68171ebb7232a00ea3
BLAKE2b-256 73d637938eb3102047cb5da2c7bad75ce837883837a34ec780d6fb22d940d5da

See more details on using hashes here.

File details

Details for the file subtitles_translator-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: subtitles_translator-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1037-azure

File hashes

Hashes for subtitles_translator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 53015b8bf3cb9d5e55059fe339d3cc466df07da49f077fde639b577c28bf7703
MD5 ff404e5d302af59ce8673daec0bb7b5a
BLAKE2b-256 2df56c22a8d099ea217c1a922037f200e3b875d9b749472f06a73d7a47865471

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page