fix(P0): 修复视频标题不生效 + 成片库名称硬编码 #553

Merged
auto-approve-bot merged 1 commits from fix/p0-title-not-working into develop 2026-07-19 01:01:28 +08:00
Owner

修复内容

根因

  1. legacy引擎完全没有标题/字幕叠加:默认渲染引擎是legacy,_render_with_legacy 只做画面拼接,完全没有处理 plan.config.titleplan.config.subtitle,导致用户设置的标题在视频中不显示
  2. 成片库视频名称硬编码create_video_record_and_dedup 中 name 写死为 generated-{task_id}.mp4,没有使用用户设置的标题

修复方案

  1. legacy路径加标题/字幕叠加:FFmpeg渲染完成后、上传OSS前,检查title/subtitle配置,生成ASS字幕文件并用subtitles滤镜叠加。失败降级不阻断主流程
  2. 成片库名称使用标题create_video_record_and_dedup 新增name参数,_finalize_render_successplan.config.title.text 读取,空则fallback到默认命名

改动文件

  • apps/worker/worker_app/tasks/edit_plan_generation.py — legacy标题字幕叠加 + name透传
  • apps/worker/video_processing/dedup_helpers.py — 支持自定义name参数
  • tests/unit/test_generated_video_creation_logic.py — 新增3个测试
## 修复内容 ### 根因 1. **legacy引擎完全没有标题/字幕叠加**:默认渲染引擎是legacy,`_render_with_legacy` 只做画面拼接,完全没有处理 `plan.config.title` 和 `plan.config.subtitle`,导致用户设置的标题在视频中不显示 2. **成片库视频名称硬编码**:`create_video_record_and_dedup` 中 name 写死为 `generated-{task_id}.mp4`,没有使用用户设置的标题 ### 修复方案 1. **legacy路径加标题/字幕叠加**:FFmpeg渲染完成后、上传OSS前,检查title/subtitle配置,生成ASS字幕文件并用subtitles滤镜叠加。失败降级不阻断主流程 2. **成片库名称使用标题**:`create_video_record_and_dedup` 新增name参数,`_finalize_render_success` 从 `plan.config.title.text` 读取,空则fallback到默认命名 ### 改动文件 - `apps/worker/worker_app/tasks/edit_plan_generation.py` — legacy标题字幕叠加 + name透传 - `apps/worker/video_processing/dedup_helpers.py` — 支持自定义name参数 - `tests/unit/test_generated_video_creation_logic.py` — 新增3个测试
xiaoxia added the bugbackendP0 labels 2026-07-19 00:55:45 +08:00
xiaoxia added 1 commit 2026-07-19 00:55:45 +08:00
fix(P0): 修复视频标题不生效 + 成片库名称硬编码
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Production (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 14s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 15s
AI Code Review / AI Code Review (pull_request) Failing after 32s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 33s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 49s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 2m30s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 2m55s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m56s
Auto Merge CI PRs / Auto Merge on CI Green + Approved (pull_request) Successful in 5m42s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 34s
a540da09bb
- legacy引擎路径新增标题/字幕叠加(渲染完成后用ASS字幕滤镜叠加)
- create_video_record_and_dedup 支持传入自定义name参数
- _finalize_render_success 从plan.config.title.text读取视频名称
- 失败降级不阻断主流程
- 新增3个单元测试验证名称逻辑
auto-approve-bot approved these changes 2026-07-19 00:58:40 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot approved these changes 2026-07-19 00:58:41 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot merged commit 6418924842 into develop 2026-07-19 01:01:28 +08:00
auto-approve-bot deleted branch fix/p0-title-not-working 2026-07-19 01:01:28 +08:00

🗑️ 预览环境已清理

PR #553 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #553 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.