李帅

1.修复一些bug

......@@ -219,9 +219,8 @@ class AdminMakeImmerse implements ShouldQueue
$contents = []; //
switch ($component->name){
case 'one_poem':
$default = $this->adminMakeVideo->poem2->title . "\n" . $this->adminMakeVideo->poem2->author;
$contents[] = [
"text" => $this->autoCenter($default, $font_size, $this->output_width),
"text" => $this->adminMakeVideo->poem2->title . "\n" . $this->adminMakeVideo->poem2->author,
"tag" => "title"
];
......@@ -299,7 +298,8 @@ class AdminMakeImmerse implements ShouldQueue
'textfile=' . escapeshellarg($text_file) . ':' .
'fontsize=' . $font_size . ':' .
'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 }') . ':' .
'x=(w-text_w)/2:y=(h-text_h)/2' . ':' .
'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG['midMiddle'][0]) . ':' .
'y=' . escapeshellarg(VideoTemp::POSITION_FFMPEG['midMiddle'][1]) . ':' .
'", ';
// 作者
$text_file = $this->getAbsolutePath($this->getTempPath('.txt','text'));
......@@ -309,7 +309,8 @@ class AdminMakeImmerse implements ShouldQueue
'textfile=' . escapeshellarg($text_file) . ':' .
'fontsize=' . $font_size / 2 . ':' .
'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 }') . ':' .
'x=(w-text_w)/2:y=(h-text_h)/2' . ':' .
'x=' . escapeshellarg(VideoTemp::POSITION_FFMPEG['midMiddle'][0]) . ':' .
'y=' . escapeshellarg(VideoTemp::POSITION_FFMPEG['midMiddle'][1] + $font_size) . ':' .
'", ';
}elseif($content['tag'] == 'source'){
$arr = explode("\n", $content['text']);
......@@ -479,3 +480,16 @@ class AdminMakeImmerse implements ShouldQueue
return $dir . $filename . $ext;
}
}
///usr/local/ffmpeg-amd64-static/ffmpeg -y
// -i '/www/wwwroot/api.parlando.ink/storage/app/public/files/663d081e3044c0d898bc9eb5d0fbf295.mp4'
// -i '/www/wwwroot/api.parlando.ink/storage/app/public/images/logo.png'
// -i '/www/wwwroot/api.parlando.ink/storage/app/public/audio/163/318/output_16844141095724.mp3'
// -filter_complex "[0:v]scale=720:1280,drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF'
//:textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/6/444/output_16844141093118.txt'
//: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'
......