feat(unified-render): Phase 1 内核增强 - scale策略/直通优化/ASS字幕/转场扩充/链路C删除 #230
Reference in New Issue
Block a user
Delete Branch "feat/unified-render-phase1"
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?
统一渲染引擎 Phase 1 内核增强
P0 完成
1. scale/crop 策略统一(铺满裁剪)
scale increase + center crop2. 单图层直通优化
-vf直通路径,跳过 filter_complex 开销_can_use_pass_through()自动判断是否满足直通条件3. title/subtitle ASS 字幕渲染
generate_ass_subtitles()函数,生成标准 ASS 字幕文件P1 完成
4. 转场效果扩充
5. faststart 统一
-movflags +faststart链路C删除
apps/worker/video_processing/editing_modes.py(657行)apps/worker/video_processing/video_compose_service.py(821行)tests/unit/test_video_compose_security.py(链路C安全测试)测试
审查结论:✅ 通过(可合并)
审查范围
apps/worker/video_processing/unified_render_service.py:scale策略统一 + 直通优化 + ASS字幕apps/worker/video_processing/ffmpeg_utils.py:转场扩充 slideup/slidedownapps/worker/video_processing/editing_modes.py:链路C删除 ✅apps/worker/video_processing/video_compose_service.py:链路C删除 ✅tests/unit/test_unified_render_service.py:52个测试全绿tests/unit/test_video_compose_security.py:随链路C一起删除 ✅P0/P1 问题
无。
各模块审查详情
1. scale/crop 策略统一 ✅
force_original_aspect_ratio=increase + crop(铺满裁剪)2. 单图层直通优化 ✅
_can_use_pass_through()判断:只有1个图层 + 是视频图层 + 只有1个clip-vf而非-filter_complex,跳过解析开销-an),留到后续混音阶段,正确3. ASS字幕渲染 ✅
generate_ass_subtitles()生成标准 ASS v4.00+ 格式_hex_to_ass_color():#RRGGBB → &HBBGGRR,正确_position_to_ass_alignment():top=8/center=5/bottom=2,正确_escape_ass_text():换行转\N、大括号转圆括号,正确4. 转场扩充 ✅
5. 链路C删除 ✅
editing_modes.py(~700行)已删除apps/worker/video_processing/video_compose_service.py(~820行)已删除test_video_compose_security.py(~247行)已删除ffmpeg_utils.py文档字符串已更新__init__.py注释还提了一句 editing_modes,不影响功能(P2可改可不改)P2 小问题(不阻塞合并)
__init__.py里注释还写着「供 editing_modes / generation...」,editing_modes 删了注释也顺手更新下_estimate_total_duration的时长估算在多图层场景下只用主图层,broll/main 同时存在时取 main,逻辑合理但文档可以写得更清楚测试
CI 状态
建议
✅ 审查通过,可合并。合并后建议先在 staging 上跑一下一键生成,确认 scale 策略从黑边改为铺满裁剪后没有业务侧问题。