李帅

1.优化ffmpeg命令,适配各种类型视频

...@@ -407,15 +407,13 @@ class AdminMakeImmerse implements ShouldQueue ...@@ -407,15 +407,13 @@ class AdminMakeImmerse implements ShouldQueue
407 foreach ($contents as $key => $content){ 407 foreach ($contents as $key => $content){
408 $DS = $key * $round; 408 $DS = $key * $round;
409 $DE = $DS + $round; 409 $DE = $DS + $round;
410 - Log::debug("round:$round, DS:$DS, DE:$DE");
411 $text_file = $this->getAbsolutePath($this->getTempPath('.txt','text')); 410 $text_file = $this->getAbsolutePath($this->getTempPath('.txt','text'));
412 file_put_contents($text_file, $content); 411 file_put_contents($text_file, $content);
413 $sub_text .= 'drawtext="'. 412 $sub_text .= 'drawtext="'.
414 'fontfile=' . escapeshellarg($font_file) . ':' . 413 'fontfile=' . escapeshellarg($font_file) . ':' .
415 'textfile=' . escapeshellarg($text_file) . ':' . 414 'textfile=' . escapeshellarg($text_file) . ':' .
416 'fontsize=' . $this->calcFontSize($component->font_size) . ':' . 415 'fontsize=' . $this->calcFontSize($component->font_size) . ':' .
417 -// 'fontcolor=' . $text_color . '@' . $opacity . ':' . 416 + 'fontcolor_expr=' . escapeshellarg($text_color . '%{eif\\\\: clip(255*(1*between(t\\, ' . $DS . ' + ' . $FID . '\\, ' . $DE . ' - ' . $FOD . ') + ((t - ' . $DS . ')/' . $FID . ')*between(t\\, ' . $DS . '\\, ' . $DS . ' + ' . $FID . ') + (-(t - ' . $DE . ')/' . $FOD . ')*between(t\\, ' . $DE . ' - ' . $FOD . '\\, ' . $DE . '))\\, 0\\, 255) \\\\: x\\\\: 2 }') . ':' .
418 - 'fontcolor_expr=' . escapeshellarg($text_color . '%{eif\\\\: clip(255*(1*between(t\\, ' . $DE . ' + ' . $FID . '\\, ' . $DE . ' - ' . $FOD . ') + ((t - ' . $DS . ')/' . $FID . ')*between(t\\, ' . $DS . '\\, ' . $DS . ' + ' . $FID . ') + (-(t - ' . $DE . ')/' . $FOD . ')*between(t\\, ' . $DE . ' - ' . $FOD . '\\, ' . $DE . '))\\, 0\\, 255) \\\\: x\\\\: 2 }') . ':' .
419 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' . 417 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][0]) . ':' .
420 'y=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][1]) . ':' . 418 'y=' . escapeshellarg(VideoTemp::POSITION_FFMPEG[$component->position][1]) . ':' .
421 'fix_bounds='. $fix_bounds . '", '; 419 'fix_bounds='. $fix_bounds . '", ';
......