style: Pint 포맷팅 적용

This commit is contained in:
김보곤
2026-02-25 11:45:01 +09:00
parent 68b1622a4e
commit 9a7c548246
199 changed files with 1420 additions and 1083 deletions

View File

@@ -16,12 +16,12 @@ public function __construct(VideoAssemblyService $videoAssembly)
/**
* 어노테이션 이미지들 → MP4 영상 합성
*
* @param array $slidePaths 슬라이드 이미지 경로 배열
* @param array $durations 각 슬라이드 표시 시간(초) 배열
* @param string|null $narrationPath 나레이션 오디오 경로
* @param string|null $bgmPath BGM 오디오 경로
* @param string $subtitlePath ASS 자막 파일 경로
* @param string $outputPath 최종 MP4 출력 경로
* @param array $slidePaths 슬라이드 이미지 경로 배열
* @param array $durations 각 슬라이드 표시 시간(초) 배열
* @param string|null $narrationPath 나레이션 오디오 경로
* @param string|null $bgmPath BGM 오디오 경로
* @param string $subtitlePath ASS 자막 파일 경로
* @param string $outputPath 최종 MP4 출력 경로
* @return string|null 성공 시 출력 경로
*/
public function assembleFromImages(
@@ -34,6 +34,7 @@ public function assembleFromImages(
): ?string {
if (empty($slidePaths)) {
Log::error('TutorialAssembly: 슬라이드가 없습니다');
return null;
}
@@ -48,6 +49,7 @@ public function assembleFromImages(
if (! $silentVideo) {
Log::error('TutorialAssembly: 이미지→영상 변환 실패');
return null;
}
@@ -93,6 +95,7 @@ private function imagesToVideo(array $slidePaths, array $durations, string $outp
Log::error('TutorialAssembly: 단일 이미지 변환 실패', [
'output' => implode("\n", array_slice($output, -10)),
]);
return null;
}
@@ -122,6 +125,7 @@ private function imagesToVideo(array $slidePaths, array $durations, string $outp
Log::error("TutorialAssembly: 클립 {$i} 변환 실패", [
'output' => implode("\n", array_slice($output, -10)),
]);
// 실패 시 crossfade 없이 fallback
return $this->imagesToVideoSimple($slidePaths, $durations, $outputPath);
}
@@ -169,6 +173,7 @@ private function xfadeConcat(array $clipPaths, array $durations, float $fadeDura
Log::warning('TutorialAssembly: xfade 실패, concat fallback', [
'output' => implode("\n", array_slice($output, -10)),
]);
return $this->simpleConcatClips($clipPaths, $outputPath);
}
@@ -178,7 +183,7 @@ private function xfadeConcat(array $clipPaths, array $durations, float $fadeDura
// 3개 이상: 체인 xfade
$inputs = '';
foreach ($clipPaths as $path) {
$inputs .= '-i ' . escapeshellarg($path) . ' ';
$inputs .= '-i '.escapeshellarg($path).' ';
}
$filter = '';
@@ -188,8 +193,8 @@ private function xfadeConcat(array $clipPaths, array $durations, float $fadeDura
$cumulativeOffset += ($durations[$i] ?? 8) - $fadeDuration;
$inputA = ($i === 0) ? '[0:v]' : "[v{$i}]";
$inputB = '[' . ($i + 1) . ':v]';
$outputLabel = ($i === $count - 2) ? '[v]' : "[v" . ($i + 1) . "]";
$inputB = '['.($i + 1).':v]';
$outputLabel = ($i === $count - 2) ? '[v]' : '[v'.($i + 1).']';
$filter .= "{$inputA}{$inputB}xfade=transition=fade:duration={$fadeDuration}:offset={$cumulativeOffset}{$outputLabel}";
@@ -211,6 +216,7 @@ private function xfadeConcat(array $clipPaths, array $durations, float $fadeDura
Log::warning('TutorialAssembly: 체인 xfade 실패, concat fallback', [
'output' => implode("\n", array_slice($output, -10)),
]);
return $this->simpleConcatClips($clipPaths, $outputPath);
}
@@ -227,7 +233,7 @@ private function simpleConcatClips(array $clipPaths, string $outputPath): ?strin
$listContent = '';
foreach ($clipPaths as $path) {
$listContent .= "file " . escapeshellarg($path) . "\n";
$listContent .= 'file '.escapeshellarg($path)."\n";
}
file_put_contents($listFile, $listContent);
@@ -245,6 +251,7 @@ private function simpleConcatClips(array $clipPaths, string $outputPath): ?strin
Log::error('TutorialAssembly: concat fallback도 실패', [
'output' => implode("\n", array_slice($output, -10)),
]);
return null;
}