#4277 怎么源部署

67.209* Posted at: 5 hours ago 👁20

怎么源部署

7 Replies

源码部署仅适用于 macOS/Linux 用户。请确保已安装 FFmpeg、Python 3.10+ 和 uv。

  1. 克隆仓库:git clone https://github.com/jianchang512/pyvideotrans
  2. 安装依赖:uv sync
  3. 启动:uv run sp.py

Windows 用户请直接下载预打包版(.7z 压缩包),解压后双击 sp.exe 即可。

压缩包怎么检测我的CUDA有没有起效

在软件主界面勾选CUDA加速(通常在语音识别区域附近),然后开始处理任意视频。处理过程中检查软件根目录下 logs/ 文件夹中的最新日志文件,搜索关键词 CUDAcuda。如果能看到类似 Using CUDA device: NVIDIA xxx 的信息,说明加速已生效。如果只有 CPU 字样,则 CUDA 未正常启用。请确保已安装 CUDA 12.8 和 cuDNN 9.11 以上版本,并在 CMD 中运行 nvcc -V 确认环境变量配置正确。

C:\Users\21261>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Thu_Mar_19_22:28:55_Pacific_Daylight_Time_2026
Cuda compilation tools, release 13.2, V13.2.78
Build cuda_13.2.r13.2/compiler.37668154_0

这个能起效吗

你的 CUDA 版本是 13.2,而 pyVideoTrans 内置支持的是 12.8,两者不兼容。直接使用可能导致加速无效或运行错误。请卸载当前 CUDA,安装 CUDA 12.8 及对应的 cuDNN 9.11+。安装后再次运行 nvcc -V 确认版本为 12.8,然后勾选 CUDA 加速即可生效。注意:仅支持 NVIDIA 显卡,AMD/Intel 不行。


Application started at 2026-04-25 02:24:47

First searching GPU...
NVIDIA_GPU_NUMS=1
Found 1 GPUs, cost=15s
[DEBUG] 返回缓存的编解码器 Windows-264: h264_nvenc
[DEBUG] 返回缓存的编解码器 Windows-265: hevc_nvenc
start workers...
process_max_gpu=1
multi_gpus=False
Concurrent task_nums=1
process_max=1
start 9 jobs
ended workers
等待 uuid_signal 线程退出
正在等待线程 PrepareVideo 结束...
正在等待线程 SpeechToText 结束...
正在等待线程 DiarizSpeaker 结束...
正在等待线程 TranslationSRT 结束...
正在等待线程 DubbingSrt 结束...
正在等待线程 SpeechToText2 结束...
正在等待线程 AlignVieoAudioSrt 结束...
正在等待线程 AssembVideoAudioSrt 结束...
正在等待线程 TaskDone 结束...
Successfully killed ffmpeg processes using taskkill


Application started at 2026-04-25 19:35:37

First searching GPU...
NVIDIA_GPU_NUMS=1
[DEBUG] 返回缓存的编解码器 Windows-264: h264_nvenc
Found 1 GPUs, cost=16s
start workers...
process_max_gpu=1
multi_gpus=False
Concurrent task_nums=1
process_max=1
[DEBUG] 返回缓存的编解码器 Windows-265: hevc_nvenc
start 9 jobs
ended workers
[DEBUG] 最
......
ssie OTE NYO-mp4/Pattern Recognition - Aussie OTE NYO.mp4', novoice_mp4='E:/软件/py_backup/tmp/12864/0ffcebec7f/novoice.mp4', is_separate=False, embed_bgm=True, instrument=None, vocal=None, back_audio='', clear_cache=True, background_music=None, subtitle_type=0, only_out_mp4=False, recogn2pass=True, output_srt=0, copysrt_rawvideo=False)

[DEBUG] [recognition]__init__:kwargs={'detect_language': 'en', 'audio_file': 'E:/软件/py_backup/tmp/12864/0ffcebec7f/en.wav', 'cache_folder': 'E:/软件/py_backup/tmp/12864/0ffcebec7f', 'model_name': 'large-v3-turbo', 'uuid': '0ffcebec7f', 'is_cuda': True, 'subtitle_type': 0, 'recogn_type': 0, 'max_speakers': -1, 'llm_post': False, 'recogn2pass': False}
[DEBUG] BaseRecogn 初始化

[DEBUG] GPU进程池:max_workers=1
[DEBUG] faster-whisper模式下,对large-v3-turbo模型返回的断句结果重新修正
[DEBUG] [语音识别]渠道0,large-v3-turbo:共耗时:41s
进入执行说话人分离阶段
进入执行字幕翻译阶段
self.trans_thread=10,self.aisendsrt=False,self.translate_type=0
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='zh-cn' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='zh-cn' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='zh-cn' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='zh-cn' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='zh-cn' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='zh-cn' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[INFO] Starting call to 'videotrans.translator._google.Google._item_task', this is the 1st time calling it.
[DEBUG] [Google] self.target_code='zh-cn' self.source_code='en'
[DEBUG] [Google]返回code:response.status_code=200
[DEBUG] 以普通文本行按行翻译:原始行数:65,翻译后行数:65
[DEBUG] [字幕翻译]渠道0,:共耗时:14s
进入执行完成阶段
正在等待线程 PrepareVideo 结束...
正在等待线程 SpeechToText 结束...
正在等待线程 DiarizSpeaker 结束...
正在等待线程 TranslationSRT 结束...
正在等待线程 DubbingSrt 结束...
正在等待线程 SpeechToText2 结束...
正在等待线程 AlignVieoAudioSrt 结束...
正在等待线程 AssembVideoAudioSrt 结束...
正在等待线程 TaskDone 结束...
Successfully killed ffmpeg processes using taskkill
你看一下我这个启用了CUDA没

根据日志可以确认 CUDA 已经启用

关键证据:

  1. 日志中 is_cuda: True 表明软件已加载 CUDA 加速配置。
  2. GPU进程池:max_workers=1 表示 GPU 进程已启动。
  3. 语音识别阶段耗时 41s(large-v3-turbo 模型),符合 GPU 加速下的速度。

虽然日志没有直接输出 Using CUDA device,但 faster-whisper 在内部调用了 CUDA 完成计算,加速已生效。无需担心。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource