#2262 预处理阶段出错:处理数据时缺少必需的键:'duration':Traceback (most recent call last): File "videotrans\task\job.py", line 67, in run File

23.132* Posted at: 1 day ago 👁17

预处理阶段出错:处理数据时缺少必需的键:'duration':
Traceback (most recent call last):
File "videotrans\task\job.py", line 67, in run
File "videotrans\task\trans_create.py", line 198, in prepare
File "videotrans\util\help_ffmpeg.py", line 541, in get_video_info
KeyError: 'duration'

TaskCfg(cache_folder='D:/Portable/pyvideotrans/tmp/5900/a7bd435134', target_dir="D:/Download/What's New for ZBrush 2026/_video_out/Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings-mkv", remove_noise=False, is_separate=False, detect_language='en', subtitle_language=None, source_language='英语', target_language='简体中文', source_language_code='en', target_language_code='zh-cn', source_sub="D:/Download/What's New for ZBrush 2026/_video_out/Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings-mkv/en.srt", target_sub="D:/Download/What's New for ZBrush 2026/_video_out/Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings-mkv/zh-cn.srt", source_wav='D:/Portable/pyvideotrans/tmp/5900/a7bd435134/en.wav', source_wav_output="D:/Download/What's New for ZBrush 2026/_video_out/Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings-mkv/en.m4a", target_wav='D:/Portable/pyvideotrans/tmp/5900/a7bd435134/target.wav', target_wav_output="D:/Download/What's New for ZBrush 2026/_video_out/Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings-mkv/zh-cn.m4a", subtitles='', novoice_mp4='D:/Portable/pyvideotrans/tmp/5900/a7bd435134/novoice.mp4', noextname='Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings', shibie_audio=None, targetdir_mp4="D:/Download/What's New for ZBrush 2026/_video_out/Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings-mkv/Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings.mp4", instrument=None, vocal=None, back_audio='', background_music=None, app_mode='biaozhun', subtitle_type=1, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='晓辰 多语言(Female/CN)', copysrt_rawvideo=False, clear_cache=False, translate_type=3, tts_type=0, recogn_type=0, model_name='large-v3-turbo', split_type=0, voice_autorate=True, video_autorate=True, cuda=True, name="D:/Download/What's New for ZBrush 2026/Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings.mkv", basename='Getting Started with ZBrush Desktop - Retopology brush - Advanced functionality and settings.mkv', ext='mkv', dirname="D:/Download/What's New for ZBrush 2026", shound_del_name=None, uuid='a7bd435134', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=1)


=
system:Windows-10-10.0.26100-SP0
version:v3.87
frozen:True
language:zh
root_dir:D:/Portable/pyvideotrans

1 Replies

这个错误表明软件在尝试获取视频信息时,无法从视频文件中提取到“duration”(时长)这个关键信息。这通常是由于视频文件本身存在问题,或者文件路径/名称过于复杂导致的。

请按以下步骤解决:

  1. 简化文件路径和名称(首要步骤)

    • 从错误信息看,您的视频文件路径和名称非常长且包含特殊符号(如 ' 和空格)。这是最常见的原因。
    • 立即操作:将视频文件复制到一个简单的路径下,例如 D:\tmp
    • 将视频文件重命名为一个简短的英文名,例如 video.mkv
    • 在软件中重新选择这个简化后的文件(D:\tmp\video.mkv)进行处理。
  2. 检查视频文件完整性

    • 尝试用其他播放器(如 VLC、PotPlayer)打开这个视频,确认其可以正常播放,并且有声音。
    • 如果视频本身损坏或编码异常,也会导致此错误。请尝试重新下载或获取一个完好的视频文件。
  3. 确保已正确安装 FFmpeg

    • 预打包版已内置 FFmpeg,通常无需额外安装。
    • 如果问题依旧,可以尝试在命令行中运行 ffprobe -i “你的视频文件路径”,查看是否能正常输出包含 Duration 字段的信息。如果命令也失败,则问题出在视频文件本身。

按照上述步骤操作后,问题应该可以解决。如果仍然报错,请提供简化路径后视频文件的完整名称和路径,以及 ffprobe 命令的输出结果。

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