李帅

1.微调一下接口,打印参数

...@@ -110,7 +110,7 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -110,7 +110,7 @@ class AdminMakeImmerse implements ShouldQueue
110 $audio_filter = '2:a'; 110 $audio_filter = '2:a';
111 } else { 111 } else {
112 /** 音频视频轨都没有 */ 112 /** 音频视频轨都没有 */
113 - Log::channel('daily')->error('视频没有video track'); 113 + Log::channel('daily')->error('视频没有video track, url:' . $file);
114 return; 114 return;
115 } 115 }
116 116
...@@ -155,7 +155,12 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -155,7 +155,12 @@ class AdminMakeImmerse implements ShouldQueue
155 Immerse::query()->create([ 155 Immerse::query()->create([
156 'user_id' => 1, 156 'user_id' => 1,
157 'title' => '', 157 'title' => '',
158 + 'weather' => $adminMakeVideo->weather,
159 + 'huangli' => $adminMakeVideo->huangli,
158 'content' => $adminMakeVideo->feel, 160 'content' => $adminMakeVideo->feel,
161 + 'location' => $adminMakeVideo->location,
162 + 'longitude' => $adminMakeVideo->longitude,
163 + 'latitude' => $adminMakeVideo->latitude,
159 'url' => $output, 164 'url' => $output,
160 'type' => $adminMakeVideo->type == 1 ? 2 : 1, 165 'type' => $adminMakeVideo->type == 1 ? 2 : 1,
161 'upload_file' => '', 166 'upload_file' => '',
...@@ -232,7 +237,12 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -232,7 +237,12 @@ class AdminMakeImmerse implements ShouldQueue
232 Immerse::query()->create([ 237 Immerse::query()->create([
233 'user_id' => 1, 238 'user_id' => 1,
234 'title' => '', 239 'title' => '',
235 - 'content' => $this->adminMakeVideo->feel, 240 + 'weather' => $adminMakeVideo->weather,
241 + 'huangli' => $adminMakeVideo->huangli,
242 + 'content' => $adminMakeVideo->feel,
243 + 'location' => $adminMakeVideo->location,
244 + 'longitude' => $adminMakeVideo->longitude,
245 + 'latitude' => $adminMakeVideo->latitude,
236 'url' => $output, 246 'url' => $output,
237 'type' => $this->adminMakeVideo->type == 1 ? 2 : 1, 247 'type' => $this->adminMakeVideo->type == 1 ? 2 : 1,
238 'upload_file' => '', 248 'upload_file' => '',
...@@ -355,7 +365,7 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -355,7 +365,7 @@ class AdminMakeImmerse implements ShouldQueue
355 $text_color = $component->text_color ?? 'white'; 365 $text_color = $component->text_color ?? 'white';
356 $text_bg_color = $component->text_bg_color ?? '0xd0cdcc'; 366 $text_bg_color = $component->text_bg_color ?? '0xd0cdcc';
357 $opacity = $component->opacity ? $component->opacity / 100 : 0.5; 367 $opacity = $component->opacity ? $component->opacity / 100 : 0.5;
358 - $font_file = $this->getAbsolutePath($component->font_file ?? 'ffmpeg/arialuni.ttf'); 368 + $font_file = $this->getAbsolutePath($component->font_file);
359 $text_bg_box = $component->text_bg_box ?? 0; 369 $text_bg_box = $component->text_bg_box ?? 0;
360 $fix_bounds = $component->fix_bounds == 1; 370 $fix_bounds = $component->fix_bounds == 1;
361 371
...@@ -379,11 +389,9 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -379,11 +389,9 @@ class AdminMakeImmerse implements ShouldQueue
379 break; 389 break;
380 case 'weather': 390 case 'weather':
381 $content = $this->adminMakeVideo->weather; 391 $content = $this->adminMakeVideo->weather;
382 - $text_file = $this->getAbsolutePath($this->getTempPath('.txt'));
383 - file_put_contents($text_file, $content);
384 $drawtext .= 'drawtext="'. 392 $drawtext .= 'drawtext="'.
385 'fontfile=' . escapeshellarg($font_file) . ':' . 393 'fontfile=' . escapeshellarg($font_file) . ':' .
386 - 'textfile=' . escapeshellarg($text_file) . ':' . 394 + 'text=' . escapeshellarg($content) . ':' .
387 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . 395 'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
388 'fontcolor=' . $text_color . '@' . $opacity . ':' . 396 'fontcolor=' . $text_color . '@' . $opacity . ':' .
389 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . 397 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
...@@ -395,11 +403,9 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -395,11 +403,9 @@ class AdminMakeImmerse implements ShouldQueue
395 break; 403 break;
396 case 'date': 404 case 'date':
397 $content = Carbon::now()->format('Y年m月d日H时'); 405 $content = Carbon::now()->format('Y年m月d日H时');
398 - $text_file = $this->getAbsolutePath($this->getTempPath('.txt'));
399 - file_put_contents($text_file, $content);
400 $drawtext .= 'drawtext="'. 406 $drawtext .= 'drawtext="'.
401 'fontfile=' . escapeshellarg($font_file) . ':' . 407 'fontfile=' . escapeshellarg($font_file) . ':' .
402 - 'textfile=' . escapeshellarg($text_file) . ':' . 408 + 'text=' . escapeshellarg($content) . ':' .
403 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . 409 'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
404 'fontcolor=' . $text_color . '@' . $opacity . ':' . 410 'fontcolor=' . $text_color . '@' . $opacity . ':' .
405 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . 411 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
...@@ -410,11 +416,9 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -410,11 +416,9 @@ class AdminMakeImmerse implements ShouldQueue
410 break; 416 break;
411 case 'feel': 417 case 'feel':
412 $content = $this->adminMakeVideo->feel ?: '读此一言,仿佛身临其境。'; 418 $content = $this->adminMakeVideo->feel ?: '读此一言,仿佛身临其境。';
413 - $text_file = $this->getAbsolutePath($this->getTempPath('.txt'));
414 - file_put_contents($text_file, $content);
415 $drawtext .= 'drawtext="'. 419 $drawtext .= 'drawtext="'.
416 'fontfile=' . escapeshellarg($font_file) . ':' . 420 'fontfile=' . escapeshellarg($font_file) . ':' .
417 - 'textfile=' . escapeshellarg($text_file) . ':' . 421 + 'text=' . escapeshellarg($content) . ':' .
418 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . 422 'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
419 'fontcolor=' . $text_color . '@' . $opacity . ':' . 423 'fontcolor=' . $text_color . '@' . $opacity . ':' .
420 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . 424 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
......
...@@ -523,7 +523,7 @@ class UserMakeImmerse implements ShouldQueue ...@@ -523,7 +523,7 @@ class UserMakeImmerse implements ShouldQueue
523 'boxcolor=' . $text_bg_color . '@' . $opacity . '", '; 523 'boxcolor=' . $text_bg_color . '@' . $opacity . '", ';
524 break; 524 break;
525 case 'weather': 525 case 'weather':
526 - $content = $this->immerse->weather ?? ''; 526 + $content = $this->immerse->weather;
527 $text_file = Storage::disk('public')->path($this->getTempPath('.txt')); 527 $text_file = Storage::disk('public')->path($this->getTempPath('.txt'));
528 file_put_contents($text_file, $content); 528 file_put_contents($text_file, $content);
529 $drawtext .= 'drawtext="'. 529 $drawtext .= 'drawtext="'.
...@@ -540,11 +540,9 @@ class UserMakeImmerse implements ShouldQueue ...@@ -540,11 +540,9 @@ class UserMakeImmerse implements ShouldQueue
540 break; 540 break;
541 case 'date': 541 case 'date':
542 $content = Carbon::now()->format('Y年m月d日H时'); 542 $content = Carbon::now()->format('Y年m月d日H时');
543 - $text_file = Storage::disk('public')->path($this->getTempPath('.txt'));
544 - file_put_contents($text_file, $content);
545 $drawtext .= 'drawtext="'. 543 $drawtext .= 'drawtext="'.
546 'fontfile=' . escapeshellarg($font_file) . ':' . 544 'fontfile=' . escapeshellarg($font_file) . ':' .
547 - 'textfile=' . escapeshellarg($text_file) . ':' . 545 + 'text=' . escapeshellarg($content) . ':' .
548 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . 546 'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
549 'fontcolor=' . $text_color . '@' . $opacity . ':' . 547 'fontcolor=' . $text_color . '@' . $opacity . ':' .
550 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . 548 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
...@@ -554,12 +552,10 @@ class UserMakeImmerse implements ShouldQueue ...@@ -554,12 +552,10 @@ class UserMakeImmerse implements ShouldQueue
554 'boxcolor=' . $text_bg_color . '@' . $opacity . '", '; 552 'boxcolor=' . $text_bg_color . '@' . $opacity . '", ';
555 break; 553 break;
556 case 'feel': 554 case 'feel':
557 - $content = $this->immerse->content ?? '读此一言,仿佛身临其境。'; 555 + $content = $this->immerse->content;
558 - $text_file = Storage::disk('public')->path($this->getTempPath('.txt'));
559 - file_put_contents($text_file, $content);
560 $drawtext .= 'drawtext="'. 556 $drawtext .= 'drawtext="'.
561 'fontfile=' . escapeshellarg($font_file) . ':' . 557 'fontfile=' . escapeshellarg($font_file) . ':' .
562 - 'textfile=' . escapeshellarg($text_file) . ':' . 558 + 'text=' . escapeshellarg($content) . ':' .
563 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . 559 'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
564 'fontcolor=' . $text_color . '@' . $opacity . ':' . 560 'fontcolor=' . $text_color . '@' . $opacity . ':' .
565 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . 561 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
......