Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-Server
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
李帅
2022-05-17 14:43:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b528171ad5e4c55b072622b9b841433ffd578ffd
b528171a
1 parent
62e3c55f
1.后台可上传图文内容。
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
app/Jobs/MakeVideo.php
app/Jobs/MakeVideo.php
View file @
b528171
...
...
@@ -9,6 +9,7 @@ use Carbon\Carbon;
use
Illuminate\Bus\Queueable
;
use
Illuminate\Contracts\Queue\ShouldBeUnique
;
use
Illuminate\Contracts\Queue\ShouldQueue
;
use
Illuminate\Contracts\Support\Arrayable
;
use
Illuminate\Foundation\Bus\Dispatchable
;
use
Illuminate\Queue\InteractsWithQueue
;
use
Illuminate\Queue\SerializesModels
;
...
...
@@ -159,7 +160,11 @@ class MakeVideo implements ShouldQueue
' -ar 44100 -ac 2 -qmin 30 -qmax 60 -profile:v baseline -preset fast '
.
escapeshellarg
(
$video
);
if
(
!
$this
->
execmd
(
$cmd
))
return
;
$exec
=
$this
->
execmd
(
$cmd
);
if
(
is_array
(
$exec
)){
print_r
(
$exec
,
1
);
return
;
}
try
{
// 全部合成以后创建 临境
...
...
@@ -408,7 +413,7 @@ class MakeVideo implements ShouldQueue
* 执行命令
* @param $cmd
* @param bool $update_progress
* @return
string
* @return
mixed
*/
public
function
execmd
(
$cmd
,
$update_progress
=
false
)
{
echo
$cmd
.
"
\n
"
.
"
\n
"
.
"
\n
"
;
...
...
@@ -452,11 +457,11 @@ class MakeVideo implements ShouldQueue
return
$stdout
;
}
else
{
$error
=
trim
(
$error0
,
"
\n
"
)
.
' '
.
trim
(
$error1
,
"
\n
"
);
// LogUtil::write(array("cmd:{$cmd}", "errno:{$exitedcode}", "stdout:{$stdout}"), __CLASS__
);
// ErrorUtil::triggerErrorMsg($error, $exitedcode)
;
Log
::
channel
(
'daily'
)
->
error
(
print_r
(
array
(
"cmd:
{
$cmd
}
"
,
"errno:
{
$exitedcode
}
"
,
"stdout:
{
$stdout
}
"
),
1
)
);
return
[
$error
,
$exitedcode
]
;
}
}
else
{
// return ErrorUtil::triggerErrorMsg
('proc_open error');
Log
::
channel
(
'daily'
)
->
error
(
'proc_open error'
);
}
}
...
...
Please
register
or
login
to post a comment