fix:자막-음성 싱크 개선 + 나레이션 밀도 증가 + BGM 볼륨 상향

1. 자막 싱크: ffprobe로 실제 TTS 오디오 길이 측정 → 자막 타이밍 반영
   - 기존: 장면 길이 * 0.75 추정 → 음성과 자막 불일치
   - 변경: 실제 나레이션 오디오 길이 기반 문장별 타이밍 계산
2. 나레이션 밀도: 장면당 40~70자 → 60~100자 (빈 시간 없이 채움)
3. BGM 볼륨: 0.4 → 1.2 (안 들리던 문제 해결)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-15 14:50:52 +09:00
parent 0f162d1df9
commit e4d8dbddb3
3 changed files with 47 additions and 17 deletions

View File

@@ -254,9 +254,17 @@ public function handle(
$narrationConcatPath = "{$workDir}/narration_full.mp3";
$assembly->concatNarrations($activeNarrationPaths, $activeScenes, $narrationConcatPath);
// 5-3. 자막 생성 (성공한 장면만)
// 5-3. 자막 생성 (실제 TTS 오디오 길이 기반 싱크)
$narrationDurations = [];
foreach ($activeNarrationPaths as $sceneNum => $narPath) {
$dur = $assembly->getAudioDuration($narPath);
if ($dur > 0) {
$narrationDurations[$sceneNum] = $dur;
}
}
$subtitlePath = "{$workDir}/subtitles.ass";
$assembly->generateAssSubtitle($activeScenes, $subtitlePath);
$assembly->generateAssSubtitle($activeScenes, $subtitlePath, $narrationDurations);
// 5-4. 최종 합성
$video->updateProgress(VideoGeneration::STATUS_ASSEMBLING, 90, '최종 합성 중...');