#5352 TaskCfgVTT(uuid='a1f77eb0e1', name='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/video/2-2D Character Movement & Animatio

183.14* Posted at: 2 days ago

语音识别阶段出错[faster-whisper(本地)] non-negative timestamp expected:Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 239, in faster_whisper
File "faster_whisper\transcribe.py", line 460, in transcribe
File "faster_whisper\utils.py", line 123, in format_timestamp
AssertionError: non-negative timestamp expected

Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 100, in process_task

File "videotrans\task\trans_create.py", line 322, in recogn

File "videotrans\recognition\__init__.py", line 190, in run

File "videotrans\recognition\_base.py", line 94, in run

File "videotrans\recognition\_whisper.py", line 36, in _exec

File "videotrans\recognition\_whisper.py", line 109, in _faster

File "videotrans\configure\base.py", line 253, in _new_process

videotrans.configure.excepts.VideoTransError: non-negative timestamp expected:Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 239, in faster_whisper
File "faster_whisper\transcribe.py", line 460, in transcribe
File "faster_whisper\utils.py", line 123, in format_timestamp
AssertionError: non-negative timestamp expected
TaskCfgVTT(uuid='a1f77eb0e1', name='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/video/2-2D Character Movement & Animation/1-Create FlipBook.mp4', dirname='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/video/2-2D Character Movement & Animation', noextname='1-Create FlipBook', basename='1-Create FlipBook.mp4', ext='mp4', target_dir='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/_video_out/video/1-Create FlipBook-mp4', cache_folder='K:/MACHI/win-pyvideotrans-v4.01-0602/tmp/40224/a1f77eb0e1', is_cuda=True, source_language='英语', source_language_code='en', source_sub='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/_video_out/video/1-Create FlipBook-mp4/en.srt', source_wav='K:/MACHI/win-pyvideotrans-v4.01-0602/tmp/40224/a1f77eb0e1/en.wav', source_wav_output='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/_video_out/video/1-Create FlipBook-mp4/en.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/_video_out/video/1-Create FlipBook-mp4/zh-cn.srt', target_wav='K:/MACHI/win-pyvideotrans-v4.01-0602/tmp/40224/a1f77eb0e1/target.wav', target_wav_output='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/_video_out/video/1-Create FlipBook-mp4/zh-cn.m4a', translate_type=4, tts_type=9, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='Sound_005_90.m4a', voice_autorate=True, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='en', recogn_type=0, model_name='large-v3-turbo', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=1, fix_punc=True, subtitle_language=None, app_mode='biaozhun', subtitles='', targetdir_mp4='K:/MACHI/# 0DayDown/教程_Tutorials/Unreal/023/_video_out/video/1-Create FlipBook-mp4/1-Create FlipBook.mp4', novoice_mp4='K:/MACHI/win-pyvideotrans-v4.01-0602/tmp/40224/a1f77eb0e1/novoice.mp4', is_separate=False, embed_bgm=False, instrument=None, vocal='K:/MACHI/win-pyvideotrans-v4.01-0602/tmp/40224/a1f77eb0e1/vocal.wav', clear_cache=False, background_music='', subtitle_type=3, only_out_mp4=False, recogn2pass=False, output_srt=2, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8)


=
system:Windows-10-10.0.19045-SP0
version:v4.01
frozen:True
language:zh
root_dir:K:/MACHI/win-pyvideotrans-v4.01-0602

1 Replies

non-negative timestamp expected 错误是因为 faster-whisper 在处理音频片段时,遇到了起始时间戳为负值或无效的情况。这通常由音频预分割参数(VAD)设置不当导致,尤其当“最短语音持续毫秒”过小或音频首尾存在异常静音信号时易触发。

解决方案:

  1. 打开 菜单 -> 工具 -> 高级选项 -> 语音识别参数,将 最短语音持续毫秒 调高至 3000ms(3秒) 以上,同时确保 最长语音持续(秒)6~10 秒之间。
  2. 勾选 Whisper预分割音频合并过短字幕到邻近,这能强制过滤过短或异常的音频片段。
  3. 检查原视频音频是否包含极短的爆破音或噪音,建议先对音频进行降噪处理(在主界面“设置更多参数”中勾选 降噪)。
  4. 如果以上无效,尝试将 faster-whisper 模型切换为 large-v3(而非 turbo 版),某些旧版本 turbo 模型可能对异常时间戳容错性差。

请查阅相关文档:

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. Dondate: ko-fi.com/jianchang512

Related resource

Similar issues already exist