#8819 Error during TTS dubbing stage [Edge-TTS (Free)] 保存字幕前格式化srt失败:file='C:/Users/PCGamer/Videos/_video_out/A Zombie Who Doe

191.6**4 Posted at: 9 hours ago

Error during TTS dubbing stage [Edge-TTS (Free)] 保存字幕前格式化srt失败:file='C:/Users/PCGamer/Videos/_video_out/A Zombie Who Doesn’t Eat Humans… Only Vegetables… Is He Vegan? | Kdrama Recap [9qwrxGMBG9Q]-mp4/pt-br.srt'
Traceback (most recent call last):

File "videotrans\task\_base.py", line 91, in _save_srt_target

OSError: [Errno 9] Bad file descriptor

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

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

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

File "videotrans\task\_stage_dubbing.py", line 24, in dubbing

File "videotrans\task\_stage_dubbing.py", line 124, in _tts

File "videotrans\task\_base.py", line 94, in _save_srt_target

videotrans.configure.excepts.VideoTransError: 保存字幕前格式化srt失败:file='C:/Users/PCGamer/Videos/_video_out/A Zombie Who Doesn’t Eat Humans… Only Vegetables… Is He Vegan? | Kdrama Recap [9qwrxGMBG9Q]-mp4/pt-br.srt'
trk=[TransCreate]: uuid='f77b7db9f6', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式 每批1个
原始输入文件名: C:/Users/PCGamer/Videos/A Zombie Who Doesn’t Eat Humans… Only Vegetables… Is He Vegan? | Kdrama Recap [9qwrxGMBG9Q].mp4,
输出结果保存到文件夹: C:/Users/PCGamer/Videos/_video_out/A Zombie Who Doesn’t Eat Humans… Only Vegetables… Is He Vegan? | Kdrama Recap [9qwrxGMBG9Q]-mp4,
临时文件夹: C:/win-pyvideotrans-v4.16-1/tmp/9320/f77b7db9f6
未选 清理已存在
未启用CUDA加速
未选 降噪
STT Service:Deepgram.com, nova-2, 发音语言: English,
TranslateSrt:Google Translate (Free),原始语言:English,目标语言:Portuguese (Brazilian), 已选 SendSRT
TTS Service:Edge-TTS (Free), 角色:Antonio(Male/BR), 配音语言:Portuguese (Brazilian), 未选 二次语音识别
音量:+0%, 语速:+3%, 未选 音频加速, 已选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: No Subtitles , precent=15, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=False, video_codec_num=265, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=False, do_diarize=False


=
system:Windows-10-10.0.26300-SP0
version:v4.16
frozen:True
language:en_US
root_dir:C:/win-pyvideotrans-v4.16-1

1 Replies

#1 DeepSeek reply at 9 hours ago

The direct cause is that the original video file name contains full-width special symbols (? … |) and multiple spaces. The output directory and pt-br.srt are generated from that name. When the program writes to this path, it triggers OSError: [Errno 9] Bad file descriptor. Windows file systems and the underlying C library have poor compatibility with full-width characters and special symbols, so the file handle becomes invalid and the subtitle cannot be saved.

Handling steps:

  1. Rename the original video to a short name containing only English letters, digits, or underscores, for example zombie1.mp4, and remove all full-width symbols, emoji, and spaces.
  2. Move the renamed video to a shallow directory, for example D:/videos/, to avoid long paths (the Windows command line limit is 260 characters).
  3. Delete the old output directory C:/Users/PCGamer/Videos/_video_out/A Zombie Who Doesn’t Eat...-mp4 to avoid reusing a broken cache.
  4. Restart the software. Select the renamed video again. Check Clear Output on the main interface, then start the task.

Note: This has nothing to do with Edge-TTS itself. The error occurred in the step that saves the target-language subtitle file, so there is no need to change the TTS channel.

Please refer to the related documentation:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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 via ko-fi.com

Related resource