Showing
1 changed file
with
18 additions
and
4 deletions
... | @@ -219,9 +219,8 @@ class AdminMakeImmerse implements ShouldQueue | ... | @@ -219,9 +219,8 @@ class AdminMakeImmerse implements ShouldQueue |
219 | $contents = []; // | 219 | $contents = []; // |
220 | switch ($component->name){ | 220 | switch ($component->name){ |
221 | case 'one_poem': | 221 | case 'one_poem': |
222 | - $default = $this->adminMakeVideo->poem2->title . "\n" . $this->adminMakeVideo->poem2->author; | ||
223 | $contents[] = [ | 222 | $contents[] = [ |
224 | - "text" => $this->autoCenter($default, $font_size, $this->output_width), | 223 | + "text" => $this->adminMakeVideo->poem2->title . "\n" . $this->adminMakeVideo->poem2->author, |
225 | "tag" => "title" | 224 | "tag" => "title" |
226 | ]; | 225 | ]; |
227 | 226 | ||
... | @@ -299,7 +298,8 @@ class AdminMakeImmerse implements ShouldQueue | ... | @@ -299,7 +298,8 @@ class AdminMakeImmerse implements ShouldQueue |
299 | 'textfile=' . escapeshellarg($text_file) . ':' . | 298 | 'textfile=' . escapeshellarg($text_file) . ':' . |
300 | 'fontsize=' . $font_size . ':' . | 299 | 'fontsize=' . $font_size . ':' . |
301 | '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 }') . ':' . | 300 | '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 }') . ':' . |
302 | - 'x=(w-text_w)/2:y=(h-text_h)/2' . ':' . | 301 | + 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG['midMiddle'][0]) . ':' . |
302 | + 'y=' . escapeshellarg(VideoTemp::POSITION_FFMPEG['midMiddle'][1]) . ':' . | ||
303 | '", '; | 303 | '", '; |
304 | // 作者 | 304 | // 作者 |
305 | $text_file = $this->getAbsolutePath($this->getTempPath('.txt','text')); | 305 | $text_file = $this->getAbsolutePath($this->getTempPath('.txt','text')); |
... | @@ -309,7 +309,8 @@ class AdminMakeImmerse implements ShouldQueue | ... | @@ -309,7 +309,8 @@ class AdminMakeImmerse implements ShouldQueue |
309 | 'textfile=' . escapeshellarg($text_file) . ':' . | 309 | 'textfile=' . escapeshellarg($text_file) . ':' . |
310 | 'fontsize=' . $font_size / 2 . ':' . | 310 | 'fontsize=' . $font_size / 2 . ':' . |
311 | '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 }') . ':' . | 311 | '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 }') . ':' . |
312 | - 'x=(w-text_w)/2:y=(h-text_h)/2' . ':' . | 312 | + 'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG['midMiddle'][0]) . ':' . |
313 | + 'y=' . escapeshellarg(VideoTemp::POSITION_FFMPEG['midMiddle'][1] + $font_size) . ':' . | ||
313 | '", '; | 314 | '", '; |
314 | }elseif($content['tag'] == 'source'){ | 315 | }elseif($content['tag'] == 'source'){ |
315 | $arr = explode("\n", $content['text']); | 316 | $arr = explode("\n", $content['text']); |
... | @@ -479,3 +480,16 @@ class AdminMakeImmerse implements ShouldQueue | ... | @@ -479,3 +480,16 @@ class AdminMakeImmerse implements ShouldQueue |
479 | return $dir . $filename . $ext; | 480 | return $dir . $filename . $ext; |
480 | } | 481 | } |
481 | } | 482 | } |
483 | + | ||
484 | + | ||
485 | +///usr/local/ffmpeg-amd64-static/ffmpeg -y | ||
486 | +// -i '/www/wwwroot/api.parlando.ink/storage/app/public/files/663d081e3044c0d898bc9eb5d0fbf295.mp4' | ||
487 | +// -i '/www/wwwroot/api.parlando.ink/storage/app/public/images/logo.png' | ||
488 | +// -i '/www/wwwroot/api.parlando.ink/storage/app/public/audio/163/318/output_16844141095724.mp3' | ||
489 | +// -filter_complex "[0:v]scale=720:1280,drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF' | ||
490 | +//:textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/6/444/output_16844141093118.txt' | ||
491 | +//:fontsize=48:fontcolor_expr='#F5F5F5%{eif\\: clip(255*(1*between(t\, 0 + 1.5\, 2.5 - 1.5) + ((t - 0)/1.5)*between(t\, 0\, 0 + 1.5) + (-(t - 2.5)/1.5)*between(t\, 2.5 - 1.5\, 2.5))\, 0\, 255) \\: x\\: 2 }':x=(w-text_w)/2:y=(h-text_h)/2:", drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF':textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/137/91/output_16844141093024.txt':fontsize=24:fontcolor_expr='#F5F5F5%{eif\\: clip(255*(1*between(t\, 0 + 1.5\, 2.5 - 1.5) + ((t - 0)/1.5)*between(t\, 0\, 0 + 1.5) + (-(t - 2.5)/1.5)*between(t\, 2.5 - 1.5\, 2.5))\, 0\, 255) \\: x\\: 2 }':x=(w-text_w)/2:y=(h-text_h)/2:", drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF':textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/38/32/output_16844141099313.txt':fontsize=48:fontcolor_expr='#F5F5F5%{eif\\: clip(255*(1*between(t\, 2.5 + 1.5\, 5 - 1.5) + ((t - 2.5)/1.5)*between(t\, 2.5\, 2.5 + 1.5) + (-(t - 5)/1.5)*between(t\, 5 - 1.5\, 5))\, 0\, 255) \\: x\\: 2 }':x='(w-text_w)/2':y='h-text_h*2-68':", drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF':textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/244/134/output_16844141096908.txt':fontsize=48:fontcolor_expr='#F5F5F5%{eif\\: clip(255*(1*between(t\, 5 + 1.5\, 7.5 - 1.5) + ((t - 5)/1.5)*between(t\, 5\, 5 + 1.5) + (-(t - 7.5)/1.5)*between(t\, 7.5 - 1.5\, 7.5))\, 0\, 255) \\: x\\: 2 }':x='(w-text_w)/2':y='h-text_h*2-68':" [text];[text] [1:v]overlay=20:20[v]" -map [v] -map 2:a -c:v libx264 -bt 256k -r 25 -ar 44100 -ac 2 -qmin 30 -qmax 60 -profile:v baseline -preset fast '/www/wwwroot/api.parlando.ink/storage/app/public/video/93/183/output_16844141105696.mp4' | ||
492 | + | ||
493 | + | ||
494 | + | ||
495 | + | ... | ... |
-
Please register or login to post a comment