Showing
2 changed files
with
11 additions
and
11 deletions
... | @@ -198,7 +198,7 @@ class MakeVideo implements ShouldQueue | ... | @@ -198,7 +198,7 @@ class MakeVideo implements ShouldQueue |
198 | 'origin_image_url' => '', | 198 | 'origin_image_url' => '', |
199 | 'poem_id' => $this->adminMakeVideo->poem_id, | 199 | 'poem_id' => $this->adminMakeVideo->poem_id, |
200 | 'temp_id' => $this->adminMakeVideo->temp_id, | 200 | 'temp_id' => $this->adminMakeVideo->temp_id, |
201 | - 'thumbnail' => $thumbnail, | 201 | + 'thumbnail' => str_replace(Storage::disk('public')->path(''), '', $thumbnail), |
202 | 'state' => 1, | 202 | 'state' => 1, |
203 | 'bgm' => $this->adminMakeVideo->bgm_url ?? '', | 203 | 'bgm' => $this->adminMakeVideo->bgm_url ?? '', |
204 | ]); | 204 | ]); | ... | ... |
... | @@ -69,7 +69,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -69,7 +69,7 @@ class UserMakeImmerse implements ShouldQueue |
69 | // 记录媒体信息时长 | 69 | // 记录媒体信息时长 |
70 | $duration = $mediainfo['format']['duration'] ?: 0; | 70 | $duration = $mediainfo['format']['duration'] ?: 0; |
71 | 71 | ||
72 | - $font = Storage::disk('public')->path('uploads/201/71/arialuni.ttf'); | 72 | + $font = Storage::disk('public')->path('ffmpeg/arialuni.ttf'); |
73 | 73 | ||
74 | // 音频还取之前的封面。 | 74 | // 音频还取之前的封面。 |
75 | $thumbnail = Storage::disk('public')->path($this->immerse->thumbnail); | 75 | $thumbnail = Storage::disk('public')->path($this->immerse->thumbnail); |
... | @@ -94,7 +94,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -94,7 +94,7 @@ class UserMakeImmerse implements ShouldQueue |
94 | } | 94 | } |
95 | 95 | ||
96 | $drawtext = $this->getTextContentString($font); | 96 | $drawtext = $this->getTextContentString($font); |
97 | - $watermark = Storage::disk('public')->path('uploads/201/71/LOGO_eng.png'); | 97 | + $watermark = Storage::disk('public')->path('ffmpeg/LOGO_eng.png'); |
98 | 98 | ||
99 | //直接将音频替换 | 99 | //直接将音频替换 |
100 | $cmd = $this->ffmpeg . ' -y ' . | 100 | $cmd = $this->ffmpeg . ' -y ' . |
... | @@ -124,7 +124,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -124,7 +124,7 @@ class UserMakeImmerse implements ShouldQueue |
124 | ' -i ' . escapeshellarg($upload_file) . | 124 | ' -i ' . escapeshellarg($upload_file) . |
125 | ' -ss 0 -t ' . escapeshellarg($origin_mediainfo['format']['duration']) . | 125 | ' -ss 0 -t ' . escapeshellarg($origin_mediainfo['format']['duration']) . |
126 | ' -ar 48000 -ab 64k '.escapeshellarg($audio); | 126 | ' -ar 48000 -ab 64k '.escapeshellarg($audio); |
127 | - if (!$this->execmd($cmd)) return 0; | 127 | + if (!$this->execmd($cmd)) return ; |
128 | }else{ | 128 | }else{ |
129 | $bgm = Storage::disk('public')->path($this->immerse->bgm); | 129 | $bgm = Storage::disk('public')->path($this->immerse->bgm); |
130 | $audio = Storage::disk('public')->path($this->getTempPath('.mp3')); | 130 | $audio = Storage::disk('public')->path($this->getTempPath('.mp3')); |
... | @@ -134,7 +134,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -134,7 +134,7 @@ class UserMakeImmerse implements ShouldQueue |
134 | ' -filter_complex "amix=inputs=2:duration=first" ' . | 134 | ' -filter_complex "amix=inputs=2:duration=first" ' . |
135 | ' -ss 0 -t ' . escapeshellarg($origin_mediainfo['format']['duration']) . | 135 | ' -ss 0 -t ' . escapeshellarg($origin_mediainfo['format']['duration']) . |
136 | ' -ar 48000 -ab 64k '.escapeshellarg($audio); | 136 | ' -ar 48000 -ab 64k '.escapeshellarg($audio); |
137 | - if (!$this->execmd($cmd)) return 0; | 137 | + if (!$this->execmd($cmd)) return ; |
138 | } | 138 | } |
139 | }else{ | 139 | }else{ |
140 | if ($this->immerse->bgm == '' || $this->immerse->bgm == null) { | 140 | if ($this->immerse->bgm == '' || $this->immerse->bgm == null) { |
... | @@ -153,7 +153,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -153,7 +153,7 @@ class UserMakeImmerse implements ShouldQueue |
153 | } | 153 | } |
154 | 154 | ||
155 | $drawtext = $this->getTextContentString($font); | 155 | $drawtext = $this->getTextContentString($font); |
156 | - $watermark = Storage::disk('public')->path('uploads/201/71/LOGO_eng.png'); | 156 | + $watermark = Storage::disk('public')->path('ffmpeg/LOGO_eng.png'); |
157 | 157 | ||
158 | //直接将音频替换 | 158 | //直接将音频替换 |
159 | $cmd = $this->ffmpeg . ' -y ' . | 159 | $cmd = $this->ffmpeg . ' -y ' . |
... | @@ -175,12 +175,12 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -175,12 +175,12 @@ class UserMakeImmerse implements ShouldQueue |
175 | $mediainfo = $this->mediainfo($upload_file); | 175 | $mediainfo = $this->mediainfo($upload_file); |
176 | 176 | ||
177 | // 记录媒体信息时长 | 177 | // 记录媒体信息时长 |
178 | - $duration = $mediainfo['format']['duration'] ?: 0; | 178 | +// $duration = $mediainfo['format']['duration'] ?: 0; |
179 | 179 | ||
180 | // | 180 | // |
181 | - $end_wallpaper = Storage::disk('public')->path('uploads/201/71/end_wallpaper.png'); | 181 | +// $end_wallpaper = Storage::disk('public')->path('uploads/201/71/end_wallpaper.png'); |
182 | - $avatar = Storage::disk('public')->path('uploads/201/71/thumbnail.png'); | 182 | +// $avatar = Storage::disk('public')->path('uploads/201/71/thumbnail.png'); |
183 | - $font = Storage::disk('public')->path('uploads/201/71/arialuni.ttf'); | 183 | + $font = Storage::disk('public')->path('ffmpeg/arialuni.ttf'); |
184 | // | 184 | // |
185 | // $user = User::query()->find($this->immerse->user_id); | 185 | // $user = User::query()->find($this->immerse->user_id); |
186 | // $signature = $user->nickname ?? $user->email ?? '2@qq.com'; | 186 | // $signature = $user->nickname ?? $user->email ?? '2@qq.com'; |
... | @@ -204,7 +204,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -204,7 +204,7 @@ class UserMakeImmerse implements ShouldQueue |
204 | // | 204 | // |
205 | 205 | ||
206 | $drawtext = $this->getTextContentString($font); | 206 | $drawtext = $this->getTextContentString($font); |
207 | - $watermark = Storage::disk('public')->path('uploads/201/71/LOGO_eng.png'); | 207 | + $watermark = Storage::disk('public')->path('ffmpeg/LOGO_eng.png'); |
208 | 208 | ||
209 | // 截取中间帧作为视频封面 | 209 | // 截取中间帧作为视频封面 |
210 | $frame = ceil($mediainfo['streams'][0]['nb_frames'] / 2); | 210 | $frame = ceil($mediainfo['streams'][0]['nb_frames'] / 2); | ... | ... |
-
Please register or login to post a comment