#7884 expected str, bytes or os.PathLike object, not NoneTypeTraceback (most recent call last):

109.226**0 Posted at: 1 hour ago

expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 139, in run
File "videotrans\task\_stage_align.py", line 44, in align
File "videotrans\task\_rate.py", line 336, in run
File "videotrans\task\_rate.py", line 648, in _concat_audio_aligned
File "videotrans\task\_rate.py", line 662, in _video_extend
File "ntpath.py", line 243, in basename
File "ntpath.py", line 212, in split
TypeError: expected str, bytes or os.PathLike object, not NoneType

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: D:/For Cap Cut current work/Roshd-5/Roshd-5.MP3,
输出结果保存到文件夹: D:/For Cap Cut current work/Roshd-5/_video_out/Roshd-5-mp3,
临时文件夹: D:/Downloads/win-pyvideotrans-v4.14/tmp/17336/4e6a7d2c5e
未选 清理已存在
未启用CUDA加速
未选 降噪
STT Service:faster-whisper(Built-in), large-v3-turbo, 发音语言: English, 断句方式:默认断句
发音语言和目标语言相同,不翻译字幕
TTS Service:Edge-TTS (Free), 角色:Brian(Male/US), 配音语言:English, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: Hard Subtitles
video_duration_ms=801097


=
system:Windows-10-10.0.19045-SP0
version:v4.14
frozen:True
language:en_US
root_dir:D:/Downloads/win-pyvideotrans-v4.14

1 Replies

#1 DeepSeek reply at 1 hour ago

The error occurs because your input file is an audio-only file (.MP3) but the alignment engine (_rate.py) is trying to run its video-extension/slow-down routine, which requires a video stream. With no video file present, an internal video path variable is None, causing ntpath.basename() to fail with expected str, bytes or os.PathLike object, not NoneType.

This is a known conflict: the align / _video_extend step assumes a video track exists, but for pure audio input there is none.

Solution (choose one):

  1. Use the "Speech-to-Text" (语音转录) panel instead of "Translation V/A" for audio-only files.

    • The left-side panel Speech-to-Text is designed for audio-only inputs and does not run the video-alignment/video-extend routine.
  2. If you want dubbing output for the audio, use the "Text-to-Speech" (文字配音) panel.

    • First transcribe the MP3 via Speech-to-Text to get an SRT, then feed that SRT into Text-to-Speech to produce dubbed audio.
  3. If you must use the video translation flow, convert the audio to a video container first (add a blank/static video track), then translate it:

    • e.g. in a terminal with ffmpeg: create a black video of the same duration and merge with the MP3, then load the resulting MP4 into "Translation V/A".

Also note your input path contains spaces (For Cap Cut current work, and a double space). Rename files/folders to simple English letters/numbers with no spaces or special characters, and move to a shallow directory (e.g. D:/Roshd-5.MP3) to avoid other ffmpeg path failures.

If the problem persists after switching to the audio-only panels, please provide the latest log file from the logs/ folder (copy the last ~30 lines) for further analysis.

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