Skip to content

generate subtitle in another language of a bunch of videos

License

Notifications You must be signed in to change notification settings

Liaze-v/GenerateSRT

Repository files navigation


GenerateSRT

generate translated subtitle of a bunch of videos

Table Of Contents

About The Project

The purpose of this project is to create automatically translated subtitles for several videos in succession.

Ideal for follow a courses in another language

Built With

Python 3.9

Getting Started

Add you vidéo file in to "videofile" directory

Prerequisites

If you use DEEPL, you have to get api key

Otherwise You need to have install the project libretanslate (open source translation). And makesure you can acces it in terminal

Installation

Download the repo

git clone https://github.com/Liaze-v/GenerateSRT.git

Then create a venv

python -m venv venv

Activate it

.venv\Scripts\activate

Dependencies

pip install deepl
pip install requests
pip install time
pip install textwrap
pip install json

Usage

Then paste your videos in the zae directory.

Translation with Libtranslate Launch

Libtranslate.bat

Then in another terminal Run

python genrerateSrt.py

Translation with DEEPL: Go to "translate.py" Comment between ----libretranslate API---- And uncomment between ----Deepl API----

Finally add your api key auth_key = "" Then run

python genrerateSrt.py

The code is currently written to translate and generate French subtitles from English.

If your videos are not in English, go to the file "genrerateSrt.py" Then modify the "generateSrtdef" function

model.transcribe(name,fp16=False,language='en')

For a target language other than French, Go to the file and change "target_lang" to DEEPL or "target" to Libtranslate

About

generate subtitle in another language of a bunch of videos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published