ATH-MaaS/Pixelle-Video · error · FileNotFoundError
驱动音频不存在: {audio_path}
Error message
驱动音频不存在: {audio_path} What it means
generate_video() checks that the driving audio file audio_path (the audio that the generated video/lip-sync will be driven by) exists on disk. If not, FileNotFoundError is raised with the path before any API call. None/empty values are allowed (feature disabled).
Source
Thrown at pixelle_video/services/api_services/video_dashscope.py:196
if image_path and not os.path.exists(image_path):
raise FileNotFoundError(f"输入图片不存在: {image_path}")
if last_image_path and not os.path.exists(last_image_path):
raise FileNotFoundError(f"尾帧图片不存在: {last_image_path}")
if first_clip_path and not os.path.exists(first_clip_path):
raise FileNotFoundError(f"输入视频片段不存在: {first_clip_path}")
if reference_image_path and not os.path.exists(reference_image_path):
raise FileNotFoundError(f"参考图片不存在: {reference_image_path}")
for ref_image_path in reference_image_paths or []:
if ref_image_path and not os.path.exists(ref_image_path):
raise FileNotFoundError(f"参考图片不存在: {ref_image_path}")
for ref_video_path in reference_video_paths or []:
if ref_video_path and not os.path.exists(ref_video_path):
raise FileNotFoundError(f"参考视频不存在: {ref_video_path}")
if reference_audio_path and not os.path.exists(reference_audio_path):
raise FileNotFoundError(f"参考音频不存在: {reference_audio_path}")
if audio_path and not os.path.exists(audio_path):
raise FileNotFoundError(f"驱动音频不存在: {audio_path}")
logger.info(f"DashscopeVideoClient: model={model}, prompt={prompt[:60]}...")
if self._is_text_to_video_model(model):
call_kwargs = {
"api_key": self.api_key,
"model": model,
"prompt": prompt,
"duration": duration,
"watermark": watermark,
}
if negative_prompt:
call_kwargs["negative_prompt"] = negative_prompt
if resolution:
call_kwargs["resolution"] = resolution
if video_ratio:
call_kwargs["ratio"] = video_ratio
if prompt_extend is not None:View on GitHub (pinned to 848b054e4f)
Solutions
- Check os.path.isfile(audio_path) from the same process before calling generate_video.
- Use absolute paths anchored to the service's base directory.
- Fix the upstream audio rendering step to write/flush the file before generate_video is invoked.
- Ensure the path is accessible inside the container/VM running the service.
Example fix
// before
client.generate_video(prompt=p, audio_path=clip_audio)
// after
if clip_audio and not os.path.isfile(clip_audio):
raise FileNotFoundError(f"drive audio missing: {clip_audio}")
client.generate_video(prompt=p, audio_path=os.path.abspath(clip_audio)) Defensive patterns
Strategy: validation
Validate before calling
if audio_path and not os.path.isfile(audio_path):
raise FileNotFoundError(f"drive audio missing: {audio_path}") Type guard
def has_drive_audio(p: str | None) -> bool:
return p is None or os.path.isfile(p) Try / catch
try:
client.generate_video(prompt=p, audio_path=audio)
except FileNotFoundError as e:
logger.error("drive audio missing: %s", e)
raise Prevention
- Check the audio file exists immediately after producing it.
- Use os.path.abspath / normpath before storing paths in config.
- Avoid temp dirs with aggressive cleanup; use a durable workspace dir.
- Validate all input paths once at pipeline start, not at API-call time.
When it happens
Trigger: generate_video() called with audio_path set to a non-empty string whose file does not exist.
Common situations: Audio pipeline wrote to a different directory; temp file cleanup raced the call; absolute path from another host baked into config; running in container without the mount; renamed or moved asset.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- 参考音频不存在: {reference_audio_path}
- 参考视频不存在: {ref_video_path}
- str(e)
- Image file not found: {image_path}
- Video file not found: {video_path}
AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30).
Data as JSON: /api/errors/75f095e7c9058af3.
Report an issue: GitHub.