{"id":13456567,"url":"https://github.com/jianchang512/pyvideotrans","last_synced_at":"2025-05-16T01:00:23.798Z","repository":{"id":197823134,"uuid":"699432836","full_name":"jianchang512/pyvideotrans","owner":"jianchang512","description":"Translate the video from one language to another and add dubbing.         将视频从一种语言翻译为另一种语言，同时支持语音识别转录、语音合成、字幕翻译。","archived":false,"fork":false,"pushed_at":"2025-04-26T08:53:18.000Z","size":473529,"stargazers_count":12702,"open_issues_count":190,"forks_count":1407,"subscribers_count":79,"default_branch":"main","last_synced_at":"2025-05-09T00:57:17.650Z","etag":null,"topics":["speech-to-text","text-to-speech","video-transition"],"latest_commit_sha":null,"homepage":"https://pyvideotrans.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jianchang512.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"jianchang512","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-10-02T16:13:19.000Z","updated_at":"2025-05-08T15:29:13.000Z","dependencies_parsed_at":"2024-01-17T03:46:51.584Z","dependency_job_id":"1b406ddb-37e6-4af7-8b77-aa2903a176cd","html_url":"https://github.com/jianchang512/pyvideotrans","commit_stats":null,"previous_names":["jianchang512/pyvideotrans"],"tags_count":208,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jianchang512%2Fpyvideotrans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jianchang512%2Fpyvideotrans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jianchang512%2Fpyvideotrans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jianchang512%2Fpyvideotrans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jianchang512","download_url":"https://codeload.github.com/jianchang512/pyvideotrans/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448578,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["speech-to-text","text-to-speech","video-transition"],"created_at":"2024-07-31T08:01:24.209Z","updated_at":"2025-05-16T01:00:23.743Z","avatar_url":"https://github.com/jianchang512.png","language":"Python","funding_links":["https://ko-fi.com/jianchang512"],"categories":["Python","语音识别与合成_其他","Media Tools"],"sub_categories":["网络服务_其他","Audio \u0026 Subtitles"],"readme":"简体中文 | [English](docs/EN/README_EN.md) | [pt-BR](docs/pt-BR/README_pt-BR.md) | [Italian](docs/IT/README_IT.md) | [Spanish](docs/ES/README_ES.md) / [捐助](docs/about.md) / [Discord](https://discord.gg/y9gUweVCCJ) / 微信公众号：`pyvideotrans`\n\n# 视频翻译配音工具\n\n这是一个视频翻译配音工具，可将一种语言的视频翻译为指定语言的视频，自动生成和添加该语言的字幕和配音。并支持API调用\n\n\n语音识别支持 `faster-whisper`和`openai-whisper`本地离线模型 及 `OpenAI SpeechToText API`  `GoogleSpeech` `阿里中文语音识别模型`和豆包模型，并支持自定义语音识别api.\n\n文字翻译支持 `微软翻译|Google翻译|百度翻译|腾讯翻译|ChatGPT|AzureAI|Gemini|DeepL|DeepLX|字节火山|离线翻译OTT`\n\n文字合成语音支持 `Microsoft Edge tts` `Google tts` `Azure AI TTS` `Openai TTS` `Elevenlabs TTS` `自定义TTS服务器api` `GPT-SoVITS` [clone-voice](https://github.com/jianchang512/clone-voice)  [ChatTTS-ui](https://github.com/jianchang512/ChatTTS-ui)  [Fish TTS](https://github.com/fishaudio/fish-speech)  [CosyVoice](https://github.com/FunAudioLLM/CosyVoice)\n\n允许保留背景伴奏音乐等(基于uvr5)\n\n支持的语言：中文简繁、英语、韩语、日语、俄语、法语、德语、意大利语、西班牙语、葡萄牙语、越南语、泰国语、阿拉伯语、土耳其语、匈牙利语、印度语、乌克兰语、哈萨克语、印尼语、马来语、捷克语、波兰语、荷兰语、瑞典语/其他语言可选自动检测\n\n\n\u003e **[赞助商]**\n\u003e \n\u003e [![](https://github.com/user-attachments/assets/5348c86e-2d5f-44c7-bc1b-3cc5f077e710)](https://gpt302.saaslink.net/teRK8Y)\n\u003e  [302.AI](https://gpt302.saaslink.net/teRK8Y)是一个按需付费的一站式AI应用平台，开放平台，开源生态, [302.AI开源地址](https://gpt302.saaslink.net/teRK8Y)\n\u003e \n\u003e 集合了最新最全的AI模型和品牌/按需付费零月费/管理和使用分离/所有AI能力均提供API/每周推出2-3个新应用\n\n\n# 主要用途和功能\n\n【自动翻译视频并配音】将视频中的声音翻译为另一种语言的配音，并嵌入该语言字幕\n\n【语音识别/将音频视频转为字幕】可批量将音频、视频文件中的人类说话声，识别为文字并导出为srt字幕文件\n\n【语音合成/字幕配音】根据本地已有的srt字幕文件创建配音，支持单个或批量字幕\n\n【翻译字幕文件】将一个或多个srt字幕文件翻译为其他语言的字幕文件\n\n【合并视频和音频】批量将视频文件和音频文件一一对应合并\n\n【合并视频和srt字幕】批量将视频文件srt字幕文件一一对应合并\n\n【为视频添加图片水印】批量将视频文件中嵌入图片水印\n\n【从视频中提取音频】从视频中分离为音频文件和无声视频\n\n【音频视频格式转换】批量将音频视频进行格式转换\n\n【字幕编辑并导出多格式】支持导入srt、vtt、ass格式字幕，编辑后可设置字体样式、色彩等导出对应格式字幕\n\n【字幕格式转换】批量将字幕文件进行 srt/ass/vtt 格式互转\n\n【下载油管视频】可从youtube上下载视频\n\n【人声背景乐分离】\n\n【API调用】支持 语音合成、语言识别、字幕翻译、视频翻译接口调用\n\n----\n\n![pyvideotrans-home](https://github.com/user-attachments/assets/b2f95a7f-b4e5-4a6d-b2a5-eb6cd22531e0)\n\n[![Open In Colab](https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge\u0026logo=googlecolab\u0026color=525252)](https://colab.research.google.com/drive/1kPTeAMz3LnWRnGmabcz4AWW42hiehmfm?usp=sharing)\n\n# 预打包版本(仅win10/win11可用，MacOS/Linux系统使用源码部署)\n\n\u003e 使用pyinstaller打包，未做免杀和签名，杀软可能报毒，请加入信任名单或使用源码部署\n\n0. [点击去下载预打包版,解压到无空格的英文目录后，双击 sp.exe (https://github.com/jianchang512/pyvideotrans/releases)\n\n1. 解压到英文路径下，并且路径中不含有空格。解压后双击 sp.exe  (若遇到权限问题可右键使用管理员权限打开)\n\n4. 注意：必须解压后使用，不可直接压缩包内双击使用，也不可解压后移动sp.exe文件到其他位置\n\n\n# MacOS源码部署\n\n0. 打开终端窗口，分别执行如下命令\n\t\n\t\u003e 执行前确保已安装 Homebrew，如果你没有安装 Homebrew,那么需要先安装\n\t\u003e\n\t\u003e 执行命令安装 Homebrew：  `/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"`\n\t\u003e\n\t\u003e 安装完成后，执行： `eval $(brew --config)`\n\t\u003e\n\n    ```\n    brew install libsndfile\n\n    brew install ffmpeg\n\n    brew install git\n\n    brew install python@3.10\n\n    ```\n\n    继续执行\n\n    ```\n    export PATH=\"/usr/local/opt/python@3.10/bin:$PATH\"\n\n    source ~/.bash_profile \n\t\n\tsource ~/.zshrc\n\n    ```\n\n\n\n1. 创建不含空格和中文的文件夹，在终端中进入该文件夹。\n2. 终端中执行命令 `git clone https://github.com/jianchang512/pyvideotrans `\n3. 执行命令 `cd pyvideotrans`\n4. 继续执行 `python -m venv venv`\n5. 继续执行命令 `source ./venv/bin/activate`，执行完毕查看确认终端命令提示符已变成已`(venv)`开头,以下命令必须确定终端提示符是以`(venv)`开头\n6. 执行 `pip install -r requirements.txt `，如果提示失败，执行如下2条命令切换pip镜像到阿里镜像\n\n    ```\n    pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/\n    pip config set install.trusted-host mirrors.aliyun.com\n    ```\n\n    然后重新执行\n    如果已切换到阿里镜像源，仍提示失败，请尝试执行 `pip install -r requirements.txt`\n\n7. `python sp.py` 打开软件界面\n\n\n\n# Linux 源码部署\n\n0. CentOS/RHEL系依次执行如下命令安装 python3.10\n\n```\n\nsudo yum update\n\nsudo yum groupinstall \"Development Tools\"\n\nsudo yum install openssl-devel bzip2-devel libffi-devel\n\ncd /tmp\n\nwget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz\n\ntar xzf Python-3.10.4.tgz\n\ncd Python-3.10.4\n\n./configure — enable-optimizations\n\nsudo make \u0026\u0026 sudo make install\n\nsudo alternatives — install /usr/bin/python3 python3 /usr/local/bin/python3.10 1\n\nsudo yum install -y ffmpeg\n\n```\n\n1. Ubuntu/Debian系执行如下命令安装python3.10\n\n```\n\napt update \u0026\u0026 apt upgrade -y\n\napt install software-properties-common -y\n\nadd-apt-repository ppa:deadsnakes/ppa\n\napt update\n\nsudo apt-get install libxcb-cursor0\n\napt install python3.10\n\ncurl -sS https://bootstrap.pypa.io/get-pip.py | python3.10\n\nsudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10  1\n\nsudo update-alternatives --config python\n\napt-get install ffmpeg\n\n```\n\n\n**打开任意一个终端，执行 `python3 -V`，如果显示 “3.10.4”，说明安装成功，否则失败**\n\n\n1. 创建个不含空格和中文的文件夹， 从终端打开该文件夹。\n3. 终端中执行命令 `git clone https://github.com/jianchang512/pyvideotrans`\n4. 继续执行命令 `cd pyvideotrans`\n5. 继续执行 `python -m venv venv`\n6. 继续执行命令 `source .\\venv\\scripts\\activate`，执行完毕查看确认终端命令提示符已变成已`(venv)`开头,以下命令必须确定终端提示符是以`(venv)`开头\n7. 执行 `pip install -r requirements.txt`，如果提示失败，执行如下2条命令切换pip镜像到阿里镜像\n\n    ```\n\n    pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/\n    pip config set install.trusted-host mirrors.aliyun.com\n\n    ```\n\n    然后重新执行,如果已切换到阿里镜像源，仍提示失败，请尝试执行 `pip install -r requirements.txt `\n8. 如果要使用CUDA加速，分别执行\n\n    `pip uninstall -y torch torchaudio`\n\n    `pip install torch==2.2.0 torchaudio==2.2.0 --index-url https://download.pytorch.org/whl/cu118`\n\n    `pip install nvidia-cublas-cu11 nvidia-cudnn-cu11`\n\n9. linux 如果要启用cuda加速，必须有英伟达显卡，并且配置好了CUDA11.8+环境,请自行搜索 \"Linux CUDA 安装\"\n\n\n10. `python sp.py` 打开软件界面\n\n\n# Window10/11 源码部署\n\n0. 打开 https://www.python.org/downloads/ 下载 windows3.10，下载后双击，一路next，注意要选中“Add to PATH”\n\n   **打开一个cmd，执行 `python -V`，如果输出不是 `3.10.4`,说明安装出错，或没有加入 `Add to PATH`,请重新安装**\n\n1. 打开 https://github.com/git-for-windows/git/releases/download/v2.45.0.windows.1/Git-2.45.0-64-bit.exe ，下载git，下载后双击一路下一步。\n2. 找个不含空格和中文的文件夹，地址栏中输入 `cmd`回车，打开终端，以下命令均在该终端中执行\n3. 执行命令 `git clone https://github.com/jianchang512/pyvideotrans`\n4. 继续执行命令 `cd pyvideotrans`\n5. 继续执行 `python -m venv venv`\n6. 继续执行命令 `venv\\Scripts\\activate`,执行后请查看确认命令行开头已变成了`(venv)`,否则说明出错\n7. 执行 `pip install -r requirements.txt `，如果提示失败，执行如下2条命令切换pip镜像到阿里镜像\n\n    ```\n\n    pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/\n    pip config set install.trusted-host mirrors.aliyun.com\n\n    ```\n\n    然后重新执行,如果已切换到阿里镜像源，仍提示失败，请尝试执行 `pip install -r requirements.txt`\n8.  如果要使用CUDA加速，分别执行\n\n    `pip uninstall -y torch torchaudio`\n\n    `pip install torch==2.2.0 torchaudio==2.2.0 --index-url https://download.pytorch.org/whl/cu118`\n\n\n9. windows  如果要启用cuda加速，必须有英伟达显卡，并且配置好了CUDA11.8+环境，具体安装见 [CUDA加速支持](https://pyvideotrans.com/gpu.html)\n\n10. 解压 ffmpeg.zip 到当前源码目录下，提示覆盖则覆盖，解压后确保源码下的ffmepg文件夹内能看到 ffmpeg.exe ffprobe.exe ytwin32.exe,\n\n11. `python sp.py` 打开软件界面\n\n\n\n#  源码部署问题说明\n\n1. 默认使用 ctranslate2的4.x版本，仅支持CUDA12.x版本，如果你的cuda低于12，并且无法升级cuda到12.x，请执行命令卸载ctranslate2然后重新安装\n\n```\n\npip uninstall -y ctranslate2\n\npip install ctranslate2==3.24.0\n\n```\n\n2. 可能会遇到 `xx module not found ` 之类错误，请打开 requirements.txt，搜索该 xx 模块，然后将xx后的 ==及等会后的版本号去掉\n\n\n\n\n# 使用教程和文档\n\n请查看 https://pyvideotrans.com\n\n\n# 语音识别模型:\n\n   下载地址： https://pyvideotrans.com/model.html\n\n\n\n# 视频教程(第三方)\n\n[Mac下源码部署/b站](https://www.bilibili.com/video/BV1tK421y7rd/)\n\n[用Gemini Api 给视频翻译设置方法/b站](https://b23.tv/fED1dS3)\n\n[如何下载和安装](https://www.bilibili.com/video/BV1Gr421s7cN/)\n\n\n# 软件预览截图\n\n![pyvideotrans-home](https://github.com/user-attachments/assets/b2f95a7f-b4e5-4a6d-b2a5-eb6cd22531e0)\n\n![image](https://github.com/user-attachments/assets/b5d1b5fb-c579-477c-bca4-6c5e9aa14d7d)\n\n\n\n# 相关联项目\n\n[ChatTTS-ui:使用ChatTTS合成声音的UI界面](https://github.com/jianchang512/ChatTTS-ui)\n\n[OTT:本地离线文字翻译工具](https://github.com/jianchang512/ott)\n\n[声音克隆工具:用任意音色合成语音](https://github.com/jianchang512/clone-voice)\n\n[语音识别工具:本地离线的语音识别转文字工具](https://github.com/jianchang512/stt)\n\n[人声背景乐分离:人声和背景音乐分离工具](https://github.com/jianchang512/vocal-separate)\n\n[GPT-SoVITS的api.py改良版](https://github.com/jianchang512/gptsovits-api)\n\n[适配 CosyVoice 的 api.py](https://github.com/jianchang512/cosyvoice-api)\n\n\n## 致谢\n\n\u003e 本程序主要依赖的部分开源项目\n\n1. [ffmpeg](https://github.com/FFmpeg/FFmpeg)\n2. [PySide6](https://pypi.org/project/PySide6/)\n3. [edge-tts](https://github.com/rany2/edge-tts)\n4. [faster-whisper](https://github.com/SYSTRAN/faster-whisper)\n5. [openai-whisper](https://github.com/openai/whisper)\n6. [pydub](https://github.com/jiaaro/pydub)\n\n## 关注作者微信公众号\n\n\u003cimg width=\"200\" src=\"https://github.com/jianchang512/pyvideotrans/assets/3378335/f9337111-9084-41fe-8840-1fb8fedca92d\"\u003e\n\n\n如果觉得该项目对你有价值，并希望该项目能一直稳定持续维护，欢迎捐助\n\n\u003cimg width=\"200\" src=\"https://github.com/user-attachments/assets/5e8688ef-47c3-4a3c-a016-e60f73ccc4dc\"\u003e\n\n\n\u003cimg width=\"200\" src=\"https://github.com/jianchang512/pyvideotrans/assets/3378335/fe1aa29d-c26d-46d3-b7f3-e9c030ef32c7\"\u003e\n\n\u003cimg width=\"200\" src=\"https://pyvideotrans.com/images/biancn.jpg\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjianchang512%2Fpyvideotrans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjianchang512%2Fpyvideotrans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjianchang512%2Fpyvideotrans/lists"}