fix:자막 중앙배치+크기2배, TTS 볼륨 증가, BGM 앰비언트 자동생성
- 자막: 하단→중앙(Alignment=5), 48→96pt, 외곽선 5px, 줄바꿈 12자 - TTS: 나레이션 볼륨 1.0→2.0 (2배 증가) - BGM: 무음 대신 분위기별 앰비언트 화음 자동생성 (FFmpeg aevalsrc) - BGM 볼륨: 0.15→0.4 (나레이션 방해 안 하는 수준) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -202,7 +202,8 @@ public function generateAssSubtitle(array $scenes, string $outputPath): string
|
||||
|
||||
$ass .= "[V4+ Styles]\n";
|
||||
$ass .= "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding\n";
|
||||
$ass .= "Style: Default,NanumGothic,48,&H00FFFFFF,&H000000FF,&H00000000,&H80000000,-1,0,0,0,100,100,0,0,1,3,1,2,40,40,200,1\n\n";
|
||||
// Fontsize=96(2배), 흰색 글자+검정 외곽선(5px)+검정 그림자(2px), Alignment=5(화면 중앙)
|
||||
$ass .= "Style: Default,NanumGothic,96,&H00FFFFFF,&H000000FF,&H00000000,&H80000000,-1,0,0,0,100,100,0,0,1,5,2,5,40,40,0,1\n\n";
|
||||
|
||||
$ass .= "[Events]\n";
|
||||
$ass .= "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n";
|
||||
@@ -223,7 +224,7 @@ public function generateAssSubtitle(array $scenes, string $outputPath): string
|
||||
$endTime = $this->formatAssTime($currentTime + $duration);
|
||||
|
||||
// 긴 텍스트는 줄바꿈
|
||||
$text = $this->wrapText($narration, 18);
|
||||
$text = $this->wrapText($narration, 12);
|
||||
$text = str_replace("\n", "\\N", $text);
|
||||
|
||||
$ass .= "Dialogue: 0,{$startTime},{$endTime},Default,,0,0,0,,{$text}\n";
|
||||
@@ -259,14 +260,14 @@ public function assemble(
|
||||
// 나레이션 추가
|
||||
if ($narrationPath && file_exists($narrationPath)) {
|
||||
$inputs[] = '-i ' . escapeshellarg($narrationPath);
|
||||
$filterParts[] = "[{$audioIndex}:a]volume=1.0[nar]";
|
||||
$filterParts[] = "[{$audioIndex}:a]volume=2.0[nar]";
|
||||
$audioIndex++;
|
||||
}
|
||||
|
||||
// BGM 추가
|
||||
if ($bgmPath && file_exists($bgmPath)) {
|
||||
$inputs[] = '-i ' . escapeshellarg($bgmPath);
|
||||
$filterParts[] = "[{$audioIndex}:a]volume=0.15[bgm]";
|
||||
$filterParts[] = "[{$audioIndex}:a]volume=0.4[bgm]";
|
||||
$audioIndex++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user