Showing
2 changed files
with
11 additions
and
11 deletions
... | @@ -53,12 +53,12 @@ class AdminMakeImmerse implements ShouldQueue | ... | @@ -53,12 +53,12 @@ class AdminMakeImmerse implements ShouldQueue |
53 | $adminMakeVideo = $this->adminMakeVideo; | 53 | $adminMakeVideo = $this->adminMakeVideo; |
54 | 54 | ||
55 | // 模板 | 55 | // 模板 |
56 | - $template = $adminMakeVideo->temp->first(); | 56 | + $template = $adminMakeVideo->temp()->first(); |
57 | 57 | ||
58 | // 素材准备 | 58 | // 素材准备 |
59 | $drawtext = $this->getTextContentString(); | 59 | $drawtext = $this->getTextContentString(); |
60 | $watermark = $this->getAbsolutePath('images/LOGO_eng.png'); | 60 | $watermark = $this->getAbsolutePath('images/LOGO_eng.png'); |
61 | - $is_bgm = $template->bg_music; | 61 | + $is_bgm = $template->bg_music == 1; |
62 | $bgm = $this->getAbsolutePath($template->bgm_url); | 62 | $bgm = $this->getAbsolutePath($template->bgm_url); |
63 | 63 | ||
64 | // 区分类型 | 64 | // 区分类型 | ... | ... |
... | @@ -51,7 +51,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -51,7 +51,7 @@ class UserMakeImmerse implements ShouldQueue |
51 | public function handle() | 51 | public function handle() |
52 | { | 52 | { |
53 | // 分情况 1.用户视频,2.用户录音 | 53 | // 分情况 1.用户视频,2.用户录音 |
54 | - // 注意事项:1.考虑用户是否会员;非会员分辨率 720x1280,会员分辨率1440x2560 | 54 | + // 注意事项:1.考虑用户是否会员;非会员分辨率540x960 ,会员分辨率720x1280 |
55 | // 2.同时字体大小也很方便确定。 | 55 | // 2.同时字体大小也很方便确定。 |
56 | 56 | ||
57 | $profile = UserProfile::query()->find($this->immerse->user_id); | 57 | $profile = UserProfile::query()->find($this->immerse->user_id); |
... | @@ -70,7 +70,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -70,7 +70,7 @@ class UserMakeImmerse implements ShouldQueue |
70 | // 记录媒体信息时长 | 70 | // 记录媒体信息时长 |
71 | $duration = $mediainfo['format']['duration'] ?: 0; | 71 | $duration = $mediainfo['format']['duration'] ?: 0; |
72 | 72 | ||
73 | - $font = Storage::disk('public')->path('ffmpeg/arialuni.ttf'); | 73 | +// $font = Storage::disk('public')->path('ffmpeg/arialuni.ttf'); |
74 | 74 | ||
75 | // 音频还取之前的封面。 | 75 | // 音频还取之前的封面。 |
76 | $thumbnail = Storage::disk('public')->path($this->immerse->thumbnail); | 76 | $thumbnail = Storage::disk('public')->path($this->immerse->thumbnail); |
... | @@ -94,8 +94,8 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -94,8 +94,8 @@ class UserMakeImmerse implements ShouldQueue |
94 | if (!$this->execmd($cmd)) return ; | 94 | if (!$this->execmd($cmd)) return ; |
95 | } | 95 | } |
96 | 96 | ||
97 | - $drawtext = $this->getTextContentString($font); | 97 | + $drawtext = $this->getTextContentString(); |
98 | - $watermark = Storage::disk('public')->path('ffmpeg/LOGO_eng.png'); | 98 | + $watermark = Storage::disk('public')->path('images/LOGO_eng.png'); |
99 | 99 | ||
100 | //直接将音频替换 | 100 | //直接将音频替换 |
101 | $cmd = $this->ffmpeg . ' -y ' . | 101 | $cmd = $this->ffmpeg . ' -y ' . |
... | @@ -153,8 +153,8 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -153,8 +153,8 @@ class UserMakeImmerse implements ShouldQueue |
153 | } | 153 | } |
154 | } | 154 | } |
155 | 155 | ||
156 | - $drawtext = $this->getTextContentString($font); | 156 | + $drawtext = $this->getTextContentString(); |
157 | - $watermark = Storage::disk('public')->path('ffmpeg/LOGO_eng.png'); | 157 | + $watermark = Storage::disk('public')->path('images/LOGO_eng.png'); |
158 | 158 | ||
159 | //直接将音频替换 | 159 | //直接将音频替换 |
160 | $cmd = $this->ffmpeg . ' -y ' . | 160 | $cmd = $this->ffmpeg . ' -y ' . |
... | @@ -181,7 +181,7 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -181,7 +181,7 @@ class UserMakeImmerse implements ShouldQueue |
181 | // | 181 | // |
182 | // $end_wallpaper = Storage::disk('public')->path('uploads/201/71/end_wallpaper.png'); | 182 | // $end_wallpaper = Storage::disk('public')->path('uploads/201/71/end_wallpaper.png'); |
183 | // $avatar = Storage::disk('public')->path('uploads/201/71/thumbnail.png'); | 183 | // $avatar = Storage::disk('public')->path('uploads/201/71/thumbnail.png'); |
184 | - $font = Storage::disk('public')->path('ffmpeg/arialuni.ttf'); | 184 | +// $font = Storage::disk('public')->path('ffmpeg/arialuni.ttf'); |
185 | // | 185 | // |
186 | // $user = User::query()->find($this->immerse->user_id); | 186 | // $user = User::query()->find($this->immerse->user_id); |
187 | // $signature = $user->nickname ?? $user->email ?? '2@qq.com'; | 187 | // $signature = $user->nickname ?? $user->email ?? '2@qq.com'; |
... | @@ -204,8 +204,8 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -204,8 +204,8 @@ class UserMakeImmerse implements ShouldQueue |
204 | // if (!$this->execmd($cmd)) return 0; | 204 | // if (!$this->execmd($cmd)) return 0; |
205 | // | 205 | // |
206 | 206 | ||
207 | - $drawtext = $this->getTextContentString($font); | 207 | + $drawtext = $this->getTextContentString(); |
208 | - $watermark = Storage::disk('public')->path('ffmpeg/LOGO_eng.png'); | 208 | + $watermark = Storage::disk('public')->path('images/LOGO_eng.png'); |
209 | 209 | ||
210 | // 截取中间帧作为视频封面 | 210 | // 截取中间帧作为视频封面 |
211 | $frame = ceil($mediainfo['streams'][0]['nb_frames'] / 2); | 211 | $frame = ceil($mediainfo['streams'][0]['nb_frames'] / 2); | ... | ... |
-
Please register or login to post a comment