简体中文 Readme / 👑Donate to this project / Discord invitation link
This is a video translation and voiceover tool that can translate videos from one language into a specified language, automatically generating and adding subtitles and voiceovers in that language.
Voice recognition supports
faster-whisper
model,openai-whisper
model, andGoogleSpeech
,zh_recogn
Ali Chinese speech recognition model.Text translation supports
Microsoft Translator|Google Translate|Baidu Translate|Tencent Translate|ChatGPT|AzureAI|Gemini|DeepL|DeepLX|Offline Translation OTT
Text-to-speech synthesis supports
Microsoft Edge tts
,Google tts
,Azure AI TTS
,Openai TTS
,Elevenlabs TTS
,Custom TTS server API
,GPT-SoVITS
, clone-voice,[ChatTTS-ui](https://github.com/jianchang512/ChatTTS-ui)
Allows for the retention of background accompaniment music, etc. (based on uvr5)
Supported languages: Simplified and Traditional Chinese, English, Korean, Japanese, Russian, French, German, Italian, Spanish, Portuguese, Vietnamese, Thai, Arabic, Turkish, Hungarian, Hindi, Ukrainian, Kazakh, Indonesian, Malay, Czech
[Translate Video and Dubbing] Translate the audio in a video into another language's dubbing and embed the subtitles in that language.
[Audio or Video to Subtitles] Convert human speech in audio or video files into text and export as srt subtitle files.
[Batch Subtitle Creation and Dubbing] Create dubbing based on existing local srt subtitle files, supporting both single and batch subtitles.
[Batch Subtitle Translation] Translate one or more srt subtitle files into subtitles in other languages.
[Audio, Video, and Subtitles Merge] Merge audio files, video files, and subtitle files into one video file.
[Extracting Audio from Video] Separate a video into audio files and silent video.
[Download YouTube Videos] Download videos from YouTube.
994.mp4
Packaged using pyinstaller, not made undetectable and unsigned, antivirus may alert, please add to the whitelist or deploy using the source code
-
Unzip to an English path and make sure the path does not contain spaces. After unzipping, double-click sp.exe (If encountering permission issues, right-click to open as administrator)
-
Note: Must be used after unzipping, do not directly click inside the compressed package, and do not move the sp.exe file to other locations after unzipping.
-
Open a terminal window and execute the following commands one by one
Make sure you have installed Homebrew before executing. If you have not installed Homebrew, you need to install it first.
Execute the command to install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After installation, execute:
eval $(brew --config)
brew install libsndfile brew install ffmpeg brew install git brew install [email protected]
Continue executing
export PATH="/usr/local/opt/[email protected]/bin:$PATH" source ~/.bash_profile source ~/.zshrc
-
Create a folder without spaces or Chinese characters, then navigate to that folder in the terminal.
-
In the terminal, execute
git clone https://github.com/jianchang512/pyvideotrans
-
Execute
cd pyvideotrans
-
Continue with
python -m venv venv
-
Execute
source ./venv/bin/activate
and ensure the terminal prompt begins with(venv)
, following commands must ensure the terminal prompt starts with(venv)
-
Execute
pip install -r requirements.txt --no-deps
Then re-execute. If failure still occurs after switching to the Aliyun source, try executing
pip install -r requirements.txt --ignore-installed --no-deps
-
python sp.py
to open the software interface
Detailed Deployment Scheme for Mac
- For CentOS/RHEL series, execute the following commands in sequence to install python3.10
sudo yum update
sudo yum groupinstall "Development Tools"
sudo yum install openssl-devel bzip2-devel libffi-devel
cd /tmp
wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz
tar xzf Python-3.10.4.tgz
cd Python-3.10.4
./configure — enable-optimizations
sudo make && sudo make install
sudo alternatives — install /usr/bin/python3 python3 /usr/local/bin/python3.10
sudo yum install -y ffmpeg
- For Ubuntu/Debian series, execute the following commands to install python3.10
apt update && apt upgrade -y
apt install software-properties-common -y
add-apt-repository ppa:deadsnakes/ppa
apt update
sudo apt-get install libxcb-cursor0
apt install python3.10
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
pip 23.2.1 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10
sudo update-alternatives --config python
apt-get install ffmpeg
Open any terminal and execute python3 -V
, if the output is "3.10.4", it means the installation was successful; otherwise, it was not successful.
-
Create a folder without spaces or Chinese characters, then navigate to that folder from the terminal.
-
In the terminal, execute
git clone https://github.com/jianchang512/pyvideotrans
-
Continue with
cd pyvideotrans
-
Execute
python -m venv venv
-
Continue with
source ./venv/bin/activate
, ensure the command line prompt has changed to start with(venv)
, otherwise, it indicates an error. -
Execute
pip install -r requirements.txt --no-deps
, if failure occurs, execute the following 2 commands to switch the pip mirror to Alibaba.pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ pip config set install.trusted-host mirrors.aliyun.com
Then re-execute. If failure still occurs after switching to the Aliyun source, try executing
pip install -r requirements.txt --ignore-installed --no-deps
-
To use CUDA acceleration, execute separately
pip uninstall -y torch torchaudio
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install nvidia-cublas-cu11 nvidia-cudnn-cu11
-
To enable CUDA acceleration on Linux, an Nvidia graphics card must be available, and the CUDA11.8+ environment must be properly set up. Please search "Linux CUDA Installation" for more information.
-
python sp.py
to open the software interface
-
Open https://www.python.org/downloads/ to download Windows3.10, double-click to proceed with the installation, make sure to select "Add to PATH"
Open a cmd, execute
python -V
, if the output is not3.10.4
, it indicates an installation error or "Add to PATH" was not selected, please reinstall -
Open https://github.com/git-for-windows/git/releases/download/v2.45.0.windows.1/Git-2.45.0-64-bit.exe, download Git, double-click and proceed with the installation steps.
-
Find a folder without spaces or Chinese characters, enter
cmd
in the address bar and press enter to open the terminal, all the following commands must be executed in this terminal. -
Execute
git clone https://github.com/jianchang512/pyvideotrans
-
Continue with
cd pyvideotrans
-
Execute
python -m venv venv
-
Continue with
.\venv\scripts\activate
, after execution check and confirm that the command line has changed to start with(venv)
, otherwise, it indicates an error. -
Execute
pip install -r requirements.txt --no-deps
, if failure occurs, execute the following 2 commands to switch the pip mirror to Alibabapip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ pip config set install.trusted-host mirrors.aliyun.com
Then re-execute. If failure still occurs after switching to the Aliyun source, try executing
pip install -r requirements.txt --ignore-installed --no-deps
-
To use CUDA acceleration, execute separately
pip uninstall -y torch torchaudio
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu118
-
For Windows, to enable CUDA acceleration, an Nvidia graphics card is required, and the CUDA11.8+ environment must be properly set up. See CUDA Acceleration Support for installation details.
-
Unzip ffmpeg.zip to the current source code directory, prompt to overwrite if asked, make sure the ffmpeg folder under the source code directory contains ffmpeg.exe ffprobe.exe ytwin32.exe,
-
python sp.py
to open the software interface
- By default, ctranslate2 version 4.x is used, only supporting CUDA12.x version. If your CUDA version is below 12 and you cannot upgrade to CUDA12.x, please execute the command to uninstall ctranslate2 and then reinstall
pip uninstall -y ctranslate2
pip install ctranslate2==3.24.0
- You may encounter errors such as
xx module not found
. Open requirements.txt, search for the xx module, then remove the == and the version number after it.
Please visit https://pyvideotrans.com/guide.html
Download link: https://pyvideotrans.com/model.html
Model descriptions and differences: https://pyvideotrans.com/02.html
Mac Source Code Deployment/Bilibili
Method of setting video translation with Gemini Api/Bilibili
OTT: Local Offline Text Translation Tool
Voice Clone Tool: Synthesizing Speech with Any Voice
Speech Recognition Tool: Local Offline Speech-to-Text Tool
Vocal and Background Music Separation Tool
Improved version of api.py for GPT-SoVITS
This program mainly relies on several open-source projects
- ffmpeg
- PySide6
- edge-tts
- faster-whisper
- openai-whisper
- pydub