fix(ai-avatar, P0): 数字人成片入库兜底project_id + 封面抽帧加速 + cv2依赖 #1864
Reference in New Issue
Block a user
Delete Branch "fix/ai-avatar-generated-video-and-cover-speed"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
P0 Bug:AI数字人视频渲染成功但成片库看不到
根因:数字人独立页面无project概念,前端传空字符串,GeneratedVideo.create() 校验 if not project_id.strip(): raise ValueError 直接抛异常,被外层 except 吞掉只打 warning。
修复:
packages/domain/generated_video.py:去掉 project_id / generation_task_id 非空必填校验(name/file_url仍强制非空)ai_avatar_render_service.py:第7步保存成片时 project_id 空兜底为 "ai_avatar",generation_task_id 空兜底为 job.id;except 日志升级为 logger.error + exc_info=True优化:封面抽帧加速(解决60s超时)
ai_avatar_cover_service.py:COVER_POLL_INTERVAL 3s→1s,COVER_MAX_POLL_ATTEMPTS 20→15(最长15s);max_frames 默认已是5requirements.txt:加 numpy==1.26.4 + opencv-python-headless==4.10.0.84(cover_frame_scorer 用cv2做清晰度/亮度/色彩评分,API镜像之前缺cv2只能回退默认分50.0)测试
🚀 预览环境已部署
🗑️ 预览环境已清理
PR #1864 已关闭或合并,对应的预览环境已被清理。