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-06-05 18:48:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
64cc952133dabe84ea90f0c37881f07ea2d08292
64cc9521
1 parent
80c13923
1.重构合成脚本。
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
app/Jobs/MakeVideo.php
app/Jobs/UserMakeImmerse.php
app/Jobs/MakeVideo.php
View file @
64cc952
...
...
@@ -198,7 +198,7 @@ class MakeVideo implements ShouldQueue
'origin_image_url'
=>
''
,
'poem_id'
=>
$this
->
adminMakeVideo
->
poem_id
,
'temp_id'
=>
$this
->
adminMakeVideo
->
temp_id
,
'thumbnail'
=>
$thumbnail
,
'thumbnail'
=>
str_replace
(
Storage
::
disk
(
'public'
)
->
path
(
''
),
''
,
$thumbnail
)
,
'state'
=>
1
,
'bgm'
=>
$this
->
adminMakeVideo
->
bgm_url
??
''
,
]);
...
...
app/Jobs/UserMakeImmerse.php
View file @
64cc952
...
...
@@ -69,7 +69,7 @@ class UserMakeImmerse implements ShouldQueue
// 记录媒体信息时长
$duration
=
$mediainfo
[
'format'
][
'duration'
]
?:
0
;
$font
=
Storage
::
disk
(
'public'
)
->
path
(
'
uploads/201/71
/arialuni.ttf'
);
$font
=
Storage
::
disk
(
'public'
)
->
path
(
'
ffmpeg
/arialuni.ttf'
);
// 音频还取之前的封面。
$thumbnail
=
Storage
::
disk
(
'public'
)
->
path
(
$this
->
immerse
->
thumbnail
);
...
...
@@ -94,7 +94,7 @@ class UserMakeImmerse implements ShouldQueue
}
$drawtext
=
$this
->
getTextContentString
(
$font
);
$watermark
=
Storage
::
disk
(
'public'
)
->
path
(
'
uploads/201/71
/LOGO_eng.png'
);
$watermark
=
Storage
::
disk
(
'public'
)
->
path
(
'
ffmpeg
/LOGO_eng.png'
);
//直接将音频替换
$cmd
=
$this
->
ffmpeg
.
' -y '
.
...
...
@@ -124,7 +124,7 @@ class UserMakeImmerse implements ShouldQueue
' -i '
.
escapeshellarg
(
$upload_file
)
.
' -ss 0 -t '
.
escapeshellarg
(
$origin_mediainfo
[
'format'
][
'duration'
])
.
' -ar 48000 -ab 64k '
.
escapeshellarg
(
$audio
);
if
(
!
$this
->
execmd
(
$cmd
))
return
0
;
if
(
!
$this
->
execmd
(
$cmd
))
return
;
}
else
{
$bgm
=
Storage
::
disk
(
'public'
)
->
path
(
$this
->
immerse
->
bgm
);
$audio
=
Storage
::
disk
(
'public'
)
->
path
(
$this
->
getTempPath
(
'.mp3'
));
...
...
@@ -134,7 +134,7 @@ class UserMakeImmerse implements ShouldQueue
' -filter_complex "amix=inputs=2:duration=first" '
.
' -ss 0 -t '
.
escapeshellarg
(
$origin_mediainfo
[
'format'
][
'duration'
])
.
' -ar 48000 -ab 64k '
.
escapeshellarg
(
$audio
);
if
(
!
$this
->
execmd
(
$cmd
))
return
0
;
if
(
!
$this
->
execmd
(
$cmd
))
return
;
}
}
else
{
if
(
$this
->
immerse
->
bgm
==
''
||
$this
->
immerse
->
bgm
==
null
)
{
...
...
@@ -153,7 +153,7 @@ class UserMakeImmerse implements ShouldQueue
}
$drawtext
=
$this
->
getTextContentString
(
$font
);
$watermark
=
Storage
::
disk
(
'public'
)
->
path
(
'
uploads/201/71
/LOGO_eng.png'
);
$watermark
=
Storage
::
disk
(
'public'
)
->
path
(
'
ffmpeg
/LOGO_eng.png'
);
//直接将音频替换
$cmd
=
$this
->
ffmpeg
.
' -y '
.
...
...
@@ -175,12 +175,12 @@ class UserMakeImmerse implements ShouldQueue
$mediainfo
=
$this
->
mediainfo
(
$upload_file
);
// 记录媒体信息时长
$duration
=
$mediainfo
[
'format'
][
'duration'
]
?:
0
;
//
$duration = $mediainfo['format']['duration'] ?: 0;
//
$end_wallpaper
=
Storage
::
disk
(
'public'
)
->
path
(
'uploads/201/71/end_wallpaper.png'
);
$avatar
=
Storage
::
disk
(
'public'
)
->
path
(
'uploads/201/71/thumbnail.png'
);
$font
=
Storage
::
disk
(
'public'
)
->
path
(
'
uploads/201/71
/arialuni.ttf'
);
//
$end_wallpaper = Storage::disk('public')->path('uploads/201/71/end_wallpaper.png');
//
$avatar = Storage::disk('public')->path('uploads/201/71/thumbnail.png');
$font
=
Storage
::
disk
(
'public'
)
->
path
(
'
ffmpeg
/arialuni.ttf'
);
//
// $user = User::query()->find($this->immerse->user_id);
// $signature = $user->nickname ?? $user->email ?? '2@qq.com';
...
...
@@ -204,7 +204,7 @@ class UserMakeImmerse implements ShouldQueue
//
$drawtext
=
$this
->
getTextContentString
(
$font
);
$watermark
=
Storage
::
disk
(
'public'
)
->
path
(
'
uploads/201/71
/LOGO_eng.png'
);
$watermark
=
Storage
::
disk
(
'public'
)
->
path
(
'
ffmpeg
/LOGO_eng.png'
);
// 截取中间帧作为视频封面
$frame
=
ceil
(
$mediainfo
[
'streams'
][
0
][
'nb_frames'
]
/
2
);
...
...
Please
register
or
login
to post a comment