#2063 TaskCfg(cache_folder='D:/MyGithubClone/pyvideotrans/tmp/20712/speech2text', target_dir='D:/MyGithubClone/pyvideotrans/ou

80.209* Posted at: 20 hours ago 👁19

语音识别阶段出错:[faster-whisper(本地)] 运行时错误:Traceback (most recent call last):
File "D:\MyGithubClone\pyvideotrans\videotrans\process\_overall.py", line 128, in run

segments, info = model.transcribe(

File "D:\MyGithubClone\pyvideotrans.venv\lib\site-packages\faster_whisper\transcribe.py", line 876, in transcribe

audio = decode_audio(audio, sampling_rate=sampling_rate)

File "D:\MyGithubClone\pyvideotrans.venv\lib\site-packages\faster_whisper\audio.py", line 46, in decode_audio

with av.open(input_file, mode="r", metadata_errors="ignore") as container:

File "av/container/core.pyx", line 482, in av.container.core.open
File "av/container/core.pyx", line 298, in av.container.core.Container.__cinit__
File "av/container/core.pyx", line 318, in av.container.core.Container.err_check
File "av/error.pyx", line 424, in av.error.err_check
av.error.FileNotFoundError: [Errno 2] No such file or directory: 'D:/MyGithubClone/pyvideotrans/tmp/20712/speech2text/04 - Fluid Simulations made easy - 03 Moving Fluid Particles-1765859867.5125902.wav'
:
Traceback (most recent call last):
File "D:\MyGithubClone\pyvideotrans\videotrans\task\job.py", line 113, in run

trk.recogn()

File "D:\MyGithubClone\pyvideotrans\videotrans\task\_speech2text.py", line 146, in recogn

raw_subtitles = run(

File "D:\MyGithubClone\pyvideotrans\videotrans\recognition\__init__.py", line 239, in run

return FasterAll(**kwargs).run()

File "D:\MyGithubClone\pyvideotrans\videotrans\recognition\_base.py", line 80, in run

for i,it in enumerate(self._exec()):

File "D:\MyGithubClone\pyvideotrans\videotrans\recognition\_overall.py", line 182, in _exec

raise RuntimeError(str(self.error))

RuntimeError: Traceback (most recent call last):
File "D:\MyGithubClone\pyvideotrans\videotrans\process\_overall.py", line 128, in run

segments, info = model.transcribe(

File "D:\MyGithubClone\pyvideotrans.venv\lib\site-packages\faster_whisper\transcribe.py", line 876, in transcribe

audio = decode_audio(audio, sampling_rate=sampling_rate)

File "D:\MyGithubClone\pyvideotrans.venv\lib\site-packages\faster_whisper\audio.py", line 46, in decode_audio

with av.open(input_file, mode="r", metadata_errors="ignore") as container:

File "av/container/core.pyx", line 482, in av.container.core.open
File "av/container/core.pyx", line 298, in av.container.core.Container.__cinit__
File "av/container/core.pyx", line 318, in av.container.core.Container.err_check
File "av/error.pyx", line 424, in av.error.err_check
av.error.FileNotFoundError: [Errno 2] No such file or directory: 'D:/MyGithubClone/pyvideotrans/tmp/20712/speech2text/04 - Fluid Simulations made easy - 03 Moving Fluid Particles-1765859867.5125902.wav'

TaskCfg(cache_folder='D:/MyGithubClone/pyvideotrans/tmp/20712/speech2text', target_dir='D:/MyGithubClone/pyvideotrans/output/recogn', remove_noise=False, is_separate=False, detect_language='auto', subtitle_language=None, source_language=None, target_language=None, source_language_code=None, target_language_code=None, source_sub=None, target_sub='D:/MyGithubClone/pyvideotrans/output/recogn/04 - Fluid Simulations made easy - 03 Moving Fluid Particles.srt', source_wav=None, source_wav_output=None, target_wav=None, target_wav_output=None, subtitles=None, novoice_mp4=None, noextname='04 - Fluid Simulations made easy - 03 Moving Fluid Particles', shibie_audio='D:/MyGithubClone/pyvideotrans/tmp/20712/speech2text/04 - Fluid Simulations made easy - 03 Moving Fluid Particles-1765859867.5125902.wav', targetdir_mp4=None, instrument=None, vocal=None, back_audio=None, background_music=None, app_mode='biaozhun', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role=None, copysrt_rawvideo=False, clear_cache=False, translate_type=None, tts_type=None, recogn_type=0, model_name='large-v3-turbo', split_type=0, voice_autorate=False, video_autorate=False, cuda=True, name='D:/YouTubeDownloads/2D Fluid Simulations for beginners/04 - Fluid Simulations made easy - 03 Moving Fluid Particles.mkv', basename='04 - Fluid Simulations made easy - 03 Moving Fluid Particles.mkv', ext='mkv', dirname='D:/YouTubeDownloads/2D Fluid Simulations for beginners', shound_del_name=None, uuid='8f7bd93300', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=0, only_out_mp4=False)


=
system:Windows-10-10.0.26100-SP0
version:v3.90
frozen:False
language:zh
root_dir:D:/MyGithubClone/pyvideotrans
Python: 3.10.4 (main, May 28 2022, 20:04:37) [MSC v.1929 64 bit (AMD64)]

1 Replies

错误原因是软件在语音识别阶段无法找到临时生成的音频文件 D:/MyGithubClone/pyvideotrans/tmp/20712/speech2text/04 - Fluid Simulations made easy - 03 Moving Fluid Particles-1765859867.5125902.wav。这通常由以下原因导致:

  1. 文件路径过长或包含特殊字符:从YouTube下载的视频文件名可能包含Windows系统禁止用于文件名的特殊符号(如 :?*"<>| 等),导致ffmpeg在处理时无法正确生成临时文件。
  2. 临时文件被清理或权限问题:杀毒软件或系统清理工具可能在处理过程中删除了临时文件。

解决方案:

  1. 重命名源视频文件(最有效):

    • 前往视频所在目录 D:/YouTubeDownloads/2D Fluid Simulations for beginners/
    • 将文件 04 - Fluid Simulations made easy - 03 Moving Fluid Particles.mkv 重命名为一个简短的纯英文名称,例如 fluid.mkv确保新名称不包含任何空格、括号、连字符以外的特殊符号
    • 在pyVideoTrans中重新选择这个重命名后的文件进行处理。
  2. 检查并关闭可能干扰的软件

    • 临时禁用杀毒软件或电脑管家等安全软件,然后重试。
    • 确保软件不是运行在 C:/Program Files 等需要管理员权限的目录下。
  3. 使用工具箱功能单独处理音频(备用方案):

    • 在pyVideoTrans主界面,点击菜单栏的 “工具箱”
    • 选择 “音视频合并/分离” 功能。
    • 将你的 .mkv 视频文件拖入,选择“从视频中分离出音频”,生成一个 .wav.mp3 文件。
    • 然后回到主界面,使用这个分离出的音频文件作为输入源进行处理。

根本预防措施:根据核心知识库,软件解压和视频存放路径严禁包含特殊符号。建议将所有待处理的视频文件先统一重命名为简短英文名,并放在一个纯英文路径的文件夹中(如 D:/videotrans/videos/)。

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.

Donate: https://ko-fi.com/jianchang512

Trending Questions