李帅

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

......@@ -110,7 +110,7 @@ class AdminMakeImmerse implements ShouldQueue
$audio_filter = '2:a';
} else {
/** 音频视频轨都没有 */
Log::channel('daily')->error('视频没有video track');
Log::channel('daily')->error('视频没有video track, url:' . $file);
return;
}
......@@ -155,7 +155,12 @@ class AdminMakeImmerse implements ShouldQueue
Immerse::query()->create([
'user_id' => 1,
'title' => '',
'weather' => $adminMakeVideo->weather,
'huangli' => $adminMakeVideo->huangli,
'content' => $adminMakeVideo->feel,
'location' => $adminMakeVideo->location,
'longitude' => $adminMakeVideo->longitude,
'latitude' => $adminMakeVideo->latitude,
'url' => $output,
'type' => $adminMakeVideo->type == 1 ? 2 : 1,
'upload_file' => '',
......@@ -232,7 +237,12 @@ class AdminMakeImmerse implements ShouldQueue
Immerse::query()->create([
'user_id' => 1,
'title' => '',
'content' => $this->adminMakeVideo->feel,
'weather' => $adminMakeVideo->weather,
'huangli' => $adminMakeVideo->huangli,
'content' => $adminMakeVideo->feel,
'location' => $adminMakeVideo->location,
'longitude' => $adminMakeVideo->longitude,
'latitude' => $adminMakeVideo->latitude,
'url' => $output,
'type' => $this->adminMakeVideo->type == 1 ? 2 : 1,
'upload_file' => '',
......@@ -355,7 +365,7 @@ class AdminMakeImmerse implements ShouldQueue
$text_color = $component->text_color ?? 'white';
$text_bg_color = $component->text_bg_color ?? '0xd0cdcc';
$opacity = $component->opacity ? $component->opacity / 100 : 0.5;
$font_file = $this->getAbsolutePath($component->font_file ?? 'ffmpeg/arialuni.ttf');
$font_file = $this->getAbsolutePath($component->font_file);
$text_bg_box = $component->text_bg_box ?? 0;
$fix_bounds = $component->fix_bounds == 1;
......@@ -379,11 +389,9 @@ class AdminMakeImmerse implements ShouldQueue
break;
case 'weather':
$content = $this->adminMakeVideo->weather;
$text_file = $this->getAbsolutePath($this->getTempPath('.txt'));
file_put_contents($text_file, $content);
$drawtext .= 'drawtext="'.
'fontfile=' . escapeshellarg($font_file) . ':' .
'textfile=' . escapeshellarg($text_file) . ':' .
'text=' . escapeshellarg($content) . ':' .
'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
'fontcolor=' . $text_color . '@' . $opacity . ':' .
'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
......@@ -395,11 +403,9 @@ class AdminMakeImmerse implements ShouldQueue
break;
case 'date':
$content = Carbon::now()->format('Y年m月d日H时');
$text_file = $this->getAbsolutePath($this->getTempPath('.txt'));
file_put_contents($text_file, $content);
$drawtext .= 'drawtext="'.
'fontfile=' . escapeshellarg($font_file) . ':' .
'textfile=' . escapeshellarg($text_file) . ':' .
'text=' . escapeshellarg($content) . ':' .
'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
'fontcolor=' . $text_color . '@' . $opacity . ':' .
'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
......@@ -410,11 +416,9 @@ class AdminMakeImmerse implements ShouldQueue
break;
case 'feel':
$content = $this->adminMakeVideo->feel ?: '读此一言,仿佛身临其境。';
$text_file = $this->getAbsolutePath($this->getTempPath('.txt'));
file_put_contents($text_file, $content);
$drawtext .= 'drawtext="'.
'fontfile=' . escapeshellarg($font_file) . ':' .
'textfile=' . escapeshellarg($text_file) . ':' .
'text=' . escapeshellarg($content) . ':' .
'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
'fontcolor=' . $text_color . '@' . $opacity . ':' .
'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
......
......@@ -523,7 +523,7 @@ class UserMakeImmerse implements ShouldQueue
'boxcolor=' . $text_bg_color . '@' . $opacity . '", ';
break;
case 'weather':
$content = $this->immerse->weather ?? '';
$content = $this->immerse->weather;
$text_file = Storage::disk('public')->path($this->getTempPath('.txt'));
file_put_contents($text_file, $content);
$drawtext .= 'drawtext="'.
......@@ -540,11 +540,9 @@ class UserMakeImmerse implements ShouldQueue
break;
case 'date':
$content = Carbon::now()->format('Y年m月d日H时');
$text_file = Storage::disk('public')->path($this->getTempPath('.txt'));
file_put_contents($text_file, $content);
$drawtext .= 'drawtext="'.
'fontfile=' . escapeshellarg($font_file) . ':' .
'textfile=' . escapeshellarg($text_file) . ':' .
'text=' . escapeshellarg($content) . ':' .
'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
'fontcolor=' . $text_color . '@' . $opacity . ':' .
'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
......@@ -554,12 +552,10 @@ class UserMakeImmerse implements ShouldQueue
'boxcolor=' . $text_bg_color . '@' . $opacity . '", ';
break;
case 'feel':
$content = $this->immerse->content ?? '读此一言,仿佛身临其境。';
$text_file = Storage::disk('public')->path($this->getTempPath('.txt'));
file_put_contents($text_file, $content);
$content = $this->immerse->content;
$drawtext .= 'drawtext="'.
'fontfile=' . escapeshellarg($font_file) . ':' .
'textfile=' . escapeshellarg($text_file) . ':' .
'text=' . escapeshellarg($content) . ':' .
'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
'fontcolor=' . $text_color . '@' . $opacity . ':' .
'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
......