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-04-06 15:27:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6af08eee8fcd6d29e69e1e061566f0df259fd64c
6af08eee
1 parent
11fc1f34
1.继续调试ffmpeg命令
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
29 deletions
app/Jobs/MakeVideo.php
config/horizon.php
app/Jobs/MakeVideo.php
View file @
6af08ee
...
...
@@ -77,50 +77,51 @@ class MakeVideo implements ShouldQueue
$animate
=
$this
->
makeAnimate
(
$last_frame_video
,
$end_wallpaper
,
''
,
$signature_x
,
$signature_y
,
$font
);
}
$video
=
$this
->
getTempPath
();
$watermark_x
=
$watermark_x
?
$watermark_x
:
0
;
$watermark_y
=
$watermark_y
?
$watermark_y
:
0
;
$am_inp
=
' -i '
.
escapeshellarg
(
$watermark
);
$am_filter
=
"[2:v]overlay=
{
$watermark_x
}
:
{
$watermark_y
}
[water];[water]"
;
$cmd
=
$this
->
ffmpeg
.
' -y'
.
$cmd
=
$this
->
ffmpeg
.
' -y '
.
' -i '
.
escapeshellarg
(
$file
)
.
' -i '
.
escapeshellarg
(
$animate
)
.
$am_inp
.
' -filter_complex "[0:0]'
.
''
.
$am_filter
.
'[0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]"'
.
' -map [v] -map [a]'
;
$cmd
.=
' -c:v libx264 -s 800x450 -bt 256k -r 25'
.
' -i '
.
escapeshellarg
(
$watermark
)
.
' -filter_complex "[0:0] '
.
'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'
.
'" [text];'
.
'[text] [2:v]overlay='
.
$watermark_x
.
':'
.
$watermark_y
.
'[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'
.
' -ar 44100 -ac 2 -qmin 30 -qmax 60 -profile:v baseline -preset fast '
.
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
(
$adminMakeVideo
->
thumbnail
==
1
&&
$adminMakeVideo
->
thumbnail_url
){
$video_temp
=
$video
;
$video
=
$this
->
getTempPath
();
$this
->
execmd
(
$cmd
);
$cmd
=
$this
->
ffmpeg
.
' -y'
.
' -i '
.
escapeshellarg
(
$video_temp
)
.
' -i '
.
escapeshellarg
(
Storage
::
disk
(
'public'
)
->
path
(
$adminMakeVideo
->
thumbnail_url
))
.
' -map 1 -map 0 -c copy -disposition:0 attached_pic '
.
escapeshellarg
(
$video
);
$this
->
execmd
(
$cmd
);
}
// 全部合成以后创建 临境
$video_info
=
$this
->
mediainfo
(
$video
2
);
$video_info
=
$this
->
mediainfo
(
$video
);
Immerse
::
query
()
->
create
([
'user_id'
=>
1
,
'title'
=>
''
,
'content'
=>
$this
->
adminMakeVideo
->
feel
,
'url'
=>
$video
2
,
'url'
=>
$video
,
'type'
=>
$this
->
adminMakeVideo
->
type
==
1
?
2
:
1
,
'duration'
=>
$video_info
[
'format'
][
'duration'
],
'size'
=>
$video_info
[
'format'
][
'size'
],
...
...
config/horizon.php
View file @
6af08ee
...
...
@@ -174,7 +174,7 @@ return [
'maxJobs'
=>
0
,
'memory'
=>
128
,
'tries'
=>
1
,
'timeout'
=>
6
0
,
'timeout'
=>
18
0
,
'nice'
=>
0
,
],
],
...
...
Please
register
or
login
to post a comment