feat(unified-render): Phase 3 - 音频统一混音 + 灰度观测埋点 #232
Reference in New Issue
Block a user
Delete Branch "feat/unified-render-phase3"
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?
变更内容
音频后处理混音架构
-c:v copy合并,对齐链路B灰度观测埋点
其他
_resolve_layer_role新增config.role == "audio"支持单测
复审结论 ✅ 通过
变更概览
P1 修复验证 ✅
问题:
_mix_audio主音频源按 layer 顺序遍历,background 排在 main/broll 前导致主音频丢失修复确认:
main > broll精确查找(layer_map + role 匹配)overlay > corner_voiceP2 修复验证 ✅
final_duration = min(effective_duration, video_duration),带防御性判断新增单测验证 ✅
4 个新增单测全部覆盖到位:
test_mix_audio_background_not_used_as_main— background 排除验证test_mix_audio_main_priority_over_broll— main > broll 优先级验证test_mix_audio_broll_used_when_no_main— broll 兜底验证test_mix_audio_single_clip_truncated_to_video_duration— 单 clip 截断验证灰度埋点完整性 ✅
UnifiedRenderService 层(4 个阶段):
start render— clip_count / layers / clip_countsvideo render done— duration_ms / pass_throughaudio mix done— duration_msrender done— total_ms / video_ms / audio_ms / output_duration / output_size / resolution / has_audioRenderAdapter 层(2 个结果):
render success— engine=unified + duration + file_size + resolution + clip_countrender failed— engine=unified + error埋点维度完整,可支撑灰度期间新旧引擎对比分析。
其他确认项
_resolve_layer_role支持audiorole(通过config.role=audio)volume配置)-an),音频统一在混音阶段处理,架构一致后续建议(P3,非阻塞)
_clip_effective_duration与_resolve_clips/_estimate_total_duration中时长计算逻辑有重复,可统一工具函数结论:复审通过,可合并。 建议按顺序合并:#230 → #231 → #232。
225cd07d75toca86240c06无音轨视频bug修复 - 复审通过 ✅
验证项
1. probe_has_audio 工具函数 ✅
-select_streams a:0探测第一条音频流,输出codec_type=audio表示有音轨2. _mix_audio 入口过滤 ✅
_clip_has_audio过滤3. 缓存机制 ✅
_audio_cache字典按 local_path 缓存,同一 clip 多次引用只探测一次4. 6 个新增单测覆盖到位 ✅
5. 其他格式修复 ✅
l歧义变量名改为layer/label,flake8 E741 修复单测结果
52 passed in 2.37s ✅(全绿)
结论
可以合并。