fix(ai-avatar): 修复三个bug——封面重影/标题字号缩放/对口型音频截断 #1876
Reference in New Issue
Block a user
Delete Branch "fix/ai-avatar-three-bugs-0913"
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?
修复内容
Bug1:封面展示区重复叠加标题(重影)
PanelCoverAndGenerate.tsx封面展示区重复叠加的标题 div(成片帧已经通过 Canvas PNG overlay 带标题,CSS 叠字造成重影)FONT_FAMILY_MAP/getFontFamily/titleOverlayStyle/showTitleOverlay/titleConfigpropAiAvatarPage.tsx同步移除titleConfigprop 传参Bug2:标题字号没有按视频分辨率缩放(预览与成片字号不一致)
titleCanvas.ts:约定titleConfig.size语义为「720p 基准宽度下的字号(px)」,新增scale = videoWidth / 720,字号/lineGap/PAD/shadowBlur/shadowOffsetY/strokeWidth 等所有长度参数统一 Math.round 乘 scalePanelLipsyncPreview.tsx:使用 useRef + ResizeObserver 动态测量预览容器实际 clientWidth,算出previewScale = containerWidth / 720,字号/padding/WebkitTextStroke 宽度/textShadow 模糊半径与偏移都按 previewScale 缩放;拖拽定位 pos_x/pos_y 已是百分比,无需改动Bug3:对口型视频时长截断(enable_video_loop 默认 false)
AiAvatarPage.tsx:enable_video_loop: false→trueschemas/lipsync.py:CreateLipsyncJobRequest 默认值改为 Trueservices/lipsync_service.pycreate_job 默认值改为 Trueservices/mediakit_client.pysubmit_lipsync 默认值改为 True,且始终显式传enable_video_loop(之前只在 True 时传,显式 False 会丢失)测试
tests/unit/test_video_filter_builder.py tests/unit/test_lipsync_tts_preview.py tests/unit/test_sentence_timings.py tests/unit/test_lipsync_tts.py tests/unit/test_lipsync_routes.py tests/unit/test_mediakit_client.py共 210 个用例全部通过🚀 预览环境已部署
🗑️ 预览环境已清理
PR #1876 已关闭或合并,对应的预览环境已被清理。