李帅

1.测试一下音频淡出效果

...@@ -68,11 +68,11 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -68,11 +68,11 @@ class AdminMakeImmerse implements ShouldQueue
68 if ($is_bgm) { 68 if ($is_bgm) {
69 // 有背景音 融合 69 // 有背景音 融合
70 $audio = $this->getAbsolutePath($this->getTempPath('.mp3','audio')); 70 $audio = $this->getAbsolutePath($this->getTempPath('.mp3','audio'));
71 - $cmd = $this->ffmpeg . ' -y '. 71 + $cmd = $this->ffmpeg .
72 - ' -i ' . escapeshellarg($file) . 72 + ' -y -i ' . escapeshellarg($file) .
73 ' -i ' . escapeshellarg($bgm) . 73 ' -i ' . escapeshellarg($bgm) .
74 - ' -filter_complex amix=inputs=2:duration=first:dropout_transition=2[amix];[amix]afade=t=out:st=33:d=5[afade] ' . 74 + ' -filter_complex amix=inputs=2:duration=first:dropout_transition=2' .
75 - ' -map[afade] -ar 48000 -ab 64k ' . escapeshellarg($audio); 75 + ' -ar 48000 -ab 64k ' . escapeshellarg($audio);
76 if (!$this->execCmd($cmd)) return; 76 if (!$this->execCmd($cmd)) return;
77 77
78 $audio_input = ' -i ' . escapeshellarg($audio); 78 $audio_input = ' -i ' . escapeshellarg($audio);
...@@ -96,7 +96,7 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -96,7 +96,7 @@ class AdminMakeImmerse implements ShouldQueue
96 $audio = $this->getAbsolutePath($this->getTempPath('.mp3','audio')); 96 $audio = $this->getAbsolutePath($this->getTempPath('.mp3','audio'));
97 $cmd = $this->ffmpeg . 97 $cmd = $this->ffmpeg .
98 ' -y -i ' . escapeshellarg($audio_empty) . 98 ' -y -i ' . escapeshellarg($audio_empty) .
99 - ' -y -i ' . escapeshellarg($bgm) . 99 + ' -i ' . escapeshellarg($bgm) .
100 ' -filter_complex amix=inputs=2:duration=first:dropout_transition=2 ' . 100 ' -filter_complex amix=inputs=2:duration=first:dropout_transition=2 ' .
101 '-ar 48000 -ab 64k ' . escapeshellarg($audio); 101 '-ar 48000 -ab 64k ' . escapeshellarg($audio);
102 if (!$this->execCmd($cmd)) return; 102 if (!$this->execCmd($cmd)) return;
......