李帅

1.继续调试ffmpeg命令

......@@ -46,6 +46,48 @@ class DevFFmpeg extends Command
*/
public function handle()
{
$content = '题破山寺后禅院' . "\t" . ' -- 常建' . PHP_EOL .
'清晨入古寺,初日照高林。' . PHP_EOL .
'曲径通幽处,禅房花木深。' . PHP_EOL .
'山光悦鸟性,潭影空人心。' . PHP_EOL .
'万籁此都寂,但余钟磬音。' . PHP_EOL ;
$path = '/Users/lishuai/Desktop/test/';
$cmd = $this->ffmpeg . ' -y '.
' -i ' . escapeshellarg($path . 'qinghuaci.mp4').
' -i ' . escapeshellarg($path . 'suffiix.mp4').
' -i ' . escapeshellarg($path . 'logo.png').
' -filter_complex "[0:0] ' .
'drawtext="'.
'fontfile=' . escapeshellarg($path . 'arialuni.ttf') . ':' .
'text=' . escapeshellarg($content) . ':'.
'fontsize=43:'.
'fontcolor=white@1.0:'.
'x=main_w/2' . '-260' . ':'.
'y=main_h/2' . '-20' . ':'.
'box=1:boxcolor=0xd0cdcc@0.5'.
'" [text];'.
'[text] [2:v]overlay=20:20[water];[water][0:1][1:0][1:1] concat=n=2:v=1:a=1[v][a]" '.
' -map [v] -map [a]'.
' -c:v libx264 -bt 256k -r 25' .
// ' -c:v:thumb png -disposition:v:thumb attached_pic' .
' -ar 44100 -ac 2 -qmin 30 -qmax 60 -profile:v baseline -preset fast ' .
escapeshellarg($path . 'out.mp4');
$this->execmd($cmd);
$cmd = $this->ffmpeg. ' -y'.
' -i ' . escapeshellarg($path . 'out.mp4').
' -i ' . escapeshellarg($path . 'thumbnail.png').
' -map 1 -map 0 -c copy -disposition:0 attached_pic '.
escapeshellarg($path . 'out2.mp4');
$this->execmd($cmd);
return 0;
$adminMakeVideo = AdminMakeVideo::query()->first();
$adminMakeVideo->video_url = Storage::disk('public')->path($adminMakeVideo->video_url);
// $adminMakeVideo->thumbnail_url = Storage::disk('public')->path($adminMakeVideo->thumbnail_url);
......