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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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