李帅

1.更改ffmpeg 地址

......@@ -95,41 +95,43 @@ class MakeVideo implements ShouldQueue
escapeshellarg($video);
// 执行合成
$this->execmd($cmd);
$video2 = $this->getTempPath();
$cmd = $this->ffmpeg . ' -y -i ' . escapeshellarg($video) .
' -vf '.
'drawtext="'.
'fontfile=' . escapeshellarg($font) . ':'.
'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'.
'" ' . escapeshellarg($video2);
if ($this->execmd($cmd)) {
// 全部合成以后创建 临境
$video_info = $this->mediainfo($video2);
Immerse::query()->create([
'user_id' => 1,
'title' => '',
'content' => $this->adminMakeVideo->feel,
'url' => $video2,
'type' => $this->adminMakeVideo->type == 1 ? 2 : 1,
'duration' => $video_info['format']['duration'],
'size' => $video_info['format']['size'],
'poem_id' => $this->adminMakeVideo->poem_id,
'temp_id' => $this->adminMakeVideo->temp_id,
'thumbnail' => $this->adminMakeVideo->thumbnail_url,
'bgm' => $this->adminMakeVideo->bgm_url,
]);
} else {
Log::info('');
return;
if ($this->execmd($cmd)){
$video2 = $this->getTempPath();
$cmd = $this->ffmpeg . ' -y -i ' . escapeshellarg($video) .
' -vf '.
'drawtext="'.
'fontfile=' . escapeshellarg($font) . ':'.
'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'.
'" ' . escapeshellarg($video2);
if ($this->execmd($cmd)) {
// 全部合成以后创建 临境
$video_info = $this->mediainfo($video2);
Immerse::query()->create([
'user_id' => 1,
'title' => '',
'content' => $this->adminMakeVideo->feel ?? '',
'url' => $video2,
'type' => $this->adminMakeVideo->type == 1 ? 2 : 1,
'duration' => $video_info['format']['duration'],
'size' => $video_info['format']['size'],
'poem_id' => $this->adminMakeVideo->poem_id,
'temp_id' => $this->adminMakeVideo->temp_id,
'thumbnail' => $this->adminMakeVideo->thumbnail_url,
'bgm' => $this->adminMakeVideo->bgm_url,
]);
} else {
Log::info('退出1');
return;
}
}else{
Log::info('退出2');
}
}
......