Showing
1 changed file
with
37 additions
and
35 deletions
... | @@ -95,41 +95,43 @@ class MakeVideo implements ShouldQueue | ... | @@ -95,41 +95,43 @@ class MakeVideo implements ShouldQueue |
95 | escapeshellarg($video); | 95 | escapeshellarg($video); |
96 | 96 | ||
97 | // 执行合成 | 97 | // 执行合成 |
98 | - $this->execmd($cmd); | 98 | + if ($this->execmd($cmd)){ |
99 | - | 99 | + $video2 = $this->getTempPath(); |
100 | - $video2 = $this->getTempPath(); | 100 | + $cmd = $this->ffmpeg . ' -y -i ' . escapeshellarg($video) . |
101 | - $cmd = $this->ffmpeg . ' -y -i ' . escapeshellarg($video) . | 101 | + ' -vf '. |
102 | - ' -vf '. | 102 | + 'drawtext="'. |
103 | - 'drawtext="'. | 103 | + 'fontfile=' . escapeshellarg($font) . ':'. |
104 | - 'fontfile=' . escapeshellarg($font) . ':'. | 104 | + 'text=' . escapeshellarg($content) . ':'. |
105 | - 'text=' . escapeshellarg($content) . ':'. | 105 | + 'fontsize=43:'. |
106 | - 'fontsize=43:'. | 106 | + 'fontcolor=white@1.0:'. |
107 | - 'fontcolor=white@1.0:'. | 107 | + 'x=main_w/2' . '-260' . ':'. |
108 | - 'x=main_w/2' . '-260' . ':'. | 108 | + 'y=main_h/2' . '-20' . ':'. |
109 | - 'y=main_h/2' . '-20' . ':'. | 109 | + 'box=1:boxcolor=0xd0cdcc@0.5'. |
110 | - 'box=1:boxcolor=0xd0cdcc@0.5'. | 110 | + '" ' . escapeshellarg($video2); |
111 | - '" ' . escapeshellarg($video2); | 111 | + |
112 | - | 112 | + if ($this->execmd($cmd)) { |
113 | - if ($this->execmd($cmd)) { | 113 | + // 全部合成以后创建 临境 |
114 | - // 全部合成以后创建 临境 | 114 | + $video_info = $this->mediainfo($video2); |
115 | - $video_info = $this->mediainfo($video2); | 115 | + |
116 | - | 116 | + Immerse::query()->create([ |
117 | - Immerse::query()->create([ | 117 | + 'user_id' => 1, |
118 | - 'user_id' => 1, | 118 | + 'title' => '', |
119 | - 'title' => '', | 119 | + 'content' => $this->adminMakeVideo->feel ?? '', |
120 | - 'content' => $this->adminMakeVideo->feel, | 120 | + 'url' => $video2, |
121 | - 'url' => $video2, | 121 | + 'type' => $this->adminMakeVideo->type == 1 ? 2 : 1, |
122 | - 'type' => $this->adminMakeVideo->type == 1 ? 2 : 1, | 122 | + 'duration' => $video_info['format']['duration'], |
123 | - 'duration' => $video_info['format']['duration'], | 123 | + 'size' => $video_info['format']['size'], |
124 | - 'size' => $video_info['format']['size'], | 124 | + 'poem_id' => $this->adminMakeVideo->poem_id, |
125 | - 'poem_id' => $this->adminMakeVideo->poem_id, | 125 | + 'temp_id' => $this->adminMakeVideo->temp_id, |
126 | - 'temp_id' => $this->adminMakeVideo->temp_id, | 126 | + 'thumbnail' => $this->adminMakeVideo->thumbnail_url, |
127 | - 'thumbnail' => $this->adminMakeVideo->thumbnail_url, | 127 | + 'bgm' => $this->adminMakeVideo->bgm_url, |
128 | - 'bgm' => $this->adminMakeVideo->bgm_url, | 128 | + ]); |
129 | - ]); | 129 | + } else { |
130 | - } else { | 130 | + Log::info('退出1'); |
131 | - Log::info(''); | 131 | + return; |
132 | - return; | 132 | + } |
133 | + }else{ | ||
134 | + Log::info('退出2'); | ||
133 | } | 135 | } |
134 | 136 | ||
135 | } | 137 | } | ... | ... |
-
Please register or login to post a comment