YouTranslate is a Python script that allows you to create multilingual YouTube videos by cloning the voice of the video's author and translating the video's transcript to a different language. The script then performs a voice-over using the translated script and cloned voice, enabling you to reach a broader audience by offering content in multiple languages!
- Go to the most recent production-ready release and install the zip with the source code
- Ensure you have Python 3.11+ installed on your system.
- Install the required dependencies by running the following command:
pip install -r requirements.txt
To use YouTranslate, you will need the following:
- An API Key for the ElevenLab's speech synthesis (See ElevenLabs API)
- A YouTube video URL for which you want to create a multilingual version.
- Run the Script:
- Create a
.env
file and writeAPI_KEY = "Your elevenlabs api key"
in it - Open your terminal or command prompt.
- Execute the following command:
- Create a
python main.py
-
Review the Output:
- The script will process the video, clone the voice, translate the transcript, and generate the final multilingual version.
- After completion, you will find the multilingual video file in the
videos/
directory (Final_Video.mp4
). - Add background sounds, polish the video. (If you are the author of the original video and you still have the video's assets on your computer)
- Don't forget that the voice synthesis is not able to copy original author's pacing. You will have to edit the video to make it as good as possible
-
Upload to YouTube:
- Upload the generated
Final_Video.mp4
to your YouTube channel and publish it to reach a wider audience.
- Upload the generated
YouTranslate utilizes ElevenLabs' voice cloning API and 'googletrans' python library to create multilingual YouTube videos. The steps involved are as follows:
-
Getting the video and Cloning the voice:
- The script uses voice cloning technology to clone the voice of the video's author, based on the
sample.mp3
file (Original audio track from the video)
- The script uses voice cloning technology to clone the voice of the video's author, based on the
-
Transcript Translation:
- The script leverages googletrans library to translate the script to the languages that ElevenLabs' API supports
-
Voice-Over and Video Generation:
- The translated transcript is combined with the voice-over to create the final multilingual video,
Final_Video.mp4
.
- The translated transcript is combined with the voice-over to create the final multilingual video,
Contributions to YouTranslate are welcome! If you find any issues or want to improve the script, feel free to submit a pull request. For major changes or new features, please open an issue first to discuss the proposed changes.
For more info, check out CONTRIBUTING.md