Showing
2 changed files
with
20 additions
and
8 deletions
| ... | @@ -379,9 +379,11 @@ class AdminMakeImmerse implements ShouldQueue | ... | @@ -379,9 +379,11 @@ class AdminMakeImmerse implements ShouldQueue |
| 379 | break; | 379 | break; |
| 380 | case 'weather': | 380 | case 'weather': |
| 381 | $content = $this->adminMakeVideo->weather; | 381 | $content = $this->adminMakeVideo->weather; |
| 382 | + $text_file = $this->getAbsolutePath($this->getTempPath('.txt')); | ||
| 383 | + file_put_contents($text_file, $content); | ||
| 382 | $drawtext .= 'drawtext="'. | 384 | $drawtext .= 'drawtext="'. |
| 383 | 'fontfile=' . escapeshellarg($font_file) . ':' . | 385 | 'fontfile=' . escapeshellarg($font_file) . ':' . |
| 384 | - 'text=' . escapeshellarg($content) . ':' . | 386 | + 'textfile=' . escapeshellarg($text_file) . ':' . |
| 385 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . | 387 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . |
| 386 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . | 388 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . |
| 387 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . | 389 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . |
| ... | @@ -393,9 +395,11 @@ class AdminMakeImmerse implements ShouldQueue | ... | @@ -393,9 +395,11 @@ class AdminMakeImmerse implements ShouldQueue |
| 393 | break; | 395 | break; |
| 394 | case 'date': | 396 | case 'date': |
| 395 | $content = Carbon::now()->format('Y年m月d日H时'); | 397 | $content = Carbon::now()->format('Y年m月d日H时'); |
| 398 | + $text_file = $this->getAbsolutePath($this->getTempPath('.txt')); | ||
| 399 | + file_put_contents($text_file, $content); | ||
| 396 | $drawtext .= 'drawtext="'. | 400 | $drawtext .= 'drawtext="'. |
| 397 | 'fontfile=' . escapeshellarg($font_file) . ':' . | 401 | 'fontfile=' . escapeshellarg($font_file) . ':' . |
| 398 | - 'text=' . escapeshellarg($content) . ':' . | 402 | + 'textfile=' . escapeshellarg($text_file) . ':' . |
| 399 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . | 403 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . |
| 400 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . | 404 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . |
| 401 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . | 405 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . |
| ... | @@ -406,9 +410,11 @@ class AdminMakeImmerse implements ShouldQueue | ... | @@ -406,9 +410,11 @@ class AdminMakeImmerse implements ShouldQueue |
| 406 | break; | 410 | break; |
| 407 | case 'feel': | 411 | case 'feel': |
| 408 | $content = $this->adminMakeVideo->feel ?: '读此一言,仿佛身临其境。'; | 412 | $content = $this->adminMakeVideo->feel ?: '读此一言,仿佛身临其境。'; |
| 413 | + $text_file = $this->getAbsolutePath($this->getTempPath('.txt')); | ||
| 414 | + file_put_contents($text_file, $content); | ||
| 409 | $drawtext .= 'drawtext="'. | 415 | $drawtext .= 'drawtext="'. |
| 410 | 'fontfile=' . escapeshellarg($font_file) . ':' . | 416 | 'fontfile=' . escapeshellarg($font_file) . ':' . |
| 411 | - 'text=' . escapeshellarg($content) . ':' . | 417 | + 'textfile=' . escapeshellarg($text_file) . ':' . |
| 412 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . | 418 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . |
| 413 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . | 419 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . |
| 414 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . | 420 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . | ... | ... |
| ... | @@ -523,10 +523,12 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -523,10 +523,12 @@ 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 = '多云'; | 526 | + $content = $this->immerse->weather ?? ''; |
| 527 | + $text_file = Storage::disk('public')->path($this->getTempPath('.txt')); | ||
| 528 | + file_put_contents($text_file, $content); | ||
| 527 | $drawtext .= 'drawtext="'. | 529 | $drawtext .= 'drawtext="'. |
| 528 | 'fontfile=' . escapeshellarg($font_file) . ':' . | 530 | 'fontfile=' . escapeshellarg($font_file) . ':' . |
| 529 | - 'text=' . escapeshellarg($content) . ':' . | 531 | + 'textfile=' . escapeshellarg($text_file) . ':' . |
| 530 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . | 532 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . |
| 531 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . | 533 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . |
| 532 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . | 534 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . |
| ... | @@ -538,9 +540,11 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -538,9 +540,11 @@ class UserMakeImmerse implements ShouldQueue |
| 538 | break; | 540 | break; |
| 539 | case 'date': | 541 | case 'date': |
| 540 | $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); | ||
| 541 | $drawtext .= 'drawtext="'. | 545 | $drawtext .= 'drawtext="'. |
| 542 | 'fontfile=' . escapeshellarg($font_file) . ':' . | 546 | 'fontfile=' . escapeshellarg($font_file) . ':' . |
| 543 | - 'text=' . escapeshellarg($content) . ':' . | 547 | + 'textfile=' . escapeshellarg($text_file) . ':' . |
| 544 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . | 548 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . |
| 545 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . | 549 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . |
| 546 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . | 550 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . |
| ... | @@ -550,10 +554,12 @@ class UserMakeImmerse implements ShouldQueue | ... | @@ -550,10 +554,12 @@ class UserMakeImmerse implements ShouldQueue |
| 550 | 'boxcolor=' . $text_bg_color . '@' . $opacity . '", '; | 554 | 'boxcolor=' . $text_bg_color . '@' . $opacity . '", '; |
| 551 | break; | 555 | break; |
| 552 | case 'feel': | 556 | case 'feel': |
| 553 | - $content = $this->immerse->content ?: '读此一言,仿佛身临其境。'; | 557 | + $content = $this->immerse->content ?? '读此一言,仿佛身临其境。'; |
| 558 | + $text_file = Storage::disk('public')->path($this->getTempPath('.txt')); | ||
| 559 | + file_put_contents($text_file, $content); | ||
| 554 | $drawtext .= 'drawtext="'. | 560 | $drawtext .= 'drawtext="'. |
| 555 | 'fontfile=' . escapeshellarg($font_file) . ':' . | 561 | 'fontfile=' . escapeshellarg($font_file) . ':' . |
| 556 | - 'text=' . escapeshellarg($content) . ':' . | 562 | + 'textfile=' . escapeshellarg($text_file) . ':' . |
| 557 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . | 563 | 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . |
| 558 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . | 564 | 'fontcolor=' . $text_color . '@' . $opacity . ':' . |
| 559 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . | 565 | 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . | ... | ... |
-
Please register or login to post a comment