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
李帅
2023-05-18 20:53:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
627d90582bd63b9d9a20dece6407028428dd53f8
627d9058
1 parent
e8860918
1.修复一些bug
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
app/Jobs/AdminMakeImmerse.php
app/Jobs/AdminMakeImmerse.php
View file @
627d905
...
...
@@ -219,9 +219,8 @@ class AdminMakeImmerse implements ShouldQueue
$contents
=
[];
//
switch
(
$component
->
name
){
case
'one_poem'
:
$default
=
$this
->
adminMakeVideo
->
poem2
->
title
.
"
\n
"
.
$this
->
adminMakeVideo
->
poem2
->
author
;
$contents
[]
=
[
"text"
=>
$this
->
a
utoCenter
(
$default
,
$font_size
,
$this
->
output_width
)
,
"text"
=>
$this
->
a
dminMakeVideo
->
poem2
->
title
.
"
\n
"
.
$this
->
adminMakeVideo
->
poem2
->
author
,
"tag"
=>
"title"
];
...
...
@@ -299,7 +298,8 @@ class AdminMakeImmerse implements ShouldQueue
'textfile='
.
escapeshellarg
(
$text_file
)
.
':'
.
'fontsize='
.
$font_size
.
':'
.
'fontcolor_expr='
.
escapeshellarg
(
$text_color
.
'%{eif\\\\: clip(255*(1*between(t\\, '
.
$DS
.
' + '
.
$FID
.
'\\, '
.
$DE
.
' - '
.
$FOD
.
') + ((t - '
.
$DS
.
')/'
.
$FID
.
')*between(t\\, '
.
$DS
.
'\\, '
.
$DS
.
' + '
.
$FID
.
') + (-(t - '
.
$DE
.
')/'
.
$FOD
.
')*between(t\\, '
.
$DE
.
' - '
.
$FOD
.
'\\, '
.
$DE
.
'))\\, 0\\, 255) \\\\: x\\\\: 2 }'
)
.
':'
.
'x=(w-text_w)/2:y=(h-text_h)/2'
.
':'
.
'x='
.
escapeshellarg
(
VideoTemp
::
POSITION_FFMPEG
[
'midMiddle'
][
0
])
.
':'
.
'y='
.
escapeshellarg
(
VideoTemp
::
POSITION_FFMPEG
[
'midMiddle'
][
1
])
.
':'
.
'", '
;
// 作者
$text_file
=
$this
->
getAbsolutePath
(
$this
->
getTempPath
(
'.txt'
,
'text'
));
...
...
@@ -309,7 +309,8 @@ class AdminMakeImmerse implements ShouldQueue
'textfile='
.
escapeshellarg
(
$text_file
)
.
':'
.
'fontsize='
.
$font_size
/
2
.
':'
.
'fontcolor_expr='
.
escapeshellarg
(
$text_color
.
'%{eif\\\\: clip(255*(1*between(t\\, '
.
$DS
.
' + '
.
$FID
.
'\\, '
.
$DE
.
' - '
.
$FOD
.
') + ((t - '
.
$DS
.
')/'
.
$FID
.
')*between(t\\, '
.
$DS
.
'\\, '
.
$DS
.
' + '
.
$FID
.
') + (-(t - '
.
$DE
.
')/'
.
$FOD
.
')*between(t\\, '
.
$DE
.
' - '
.
$FOD
.
'\\, '
.
$DE
.
'))\\, 0\\, 255) \\\\: x\\\\: 2 }'
)
.
':'
.
'x=(w-text_w)/2:y=(h-text_h)/2'
.
':'
.
'x='
.
escapeshellarg
(
VideoTemp
::
POSITION_FFMPEG
[
'midMiddle'
][
0
])
.
':'
.
'y='
.
escapeshellarg
(
VideoTemp
::
POSITION_FFMPEG
[
'midMiddle'
][
1
]
+
$font_size
)
.
':'
.
'", '
;
}
elseif
(
$content
[
'tag'
]
==
'source'
){
$arr
=
explode
(
"
\n
"
,
$content
[
'text'
]);
...
...
@@ -479,3 +480,16 @@ class AdminMakeImmerse implements ShouldQueue
return
$dir
.
$filename
.
$ext
;
}
}
///usr/local/ffmpeg-amd64-static/ffmpeg -y
// -i '/www/wwwroot/api.parlando.ink/storage/app/public/files/663d081e3044c0d898bc9eb5d0fbf295.mp4'
// -i '/www/wwwroot/api.parlando.ink/storage/app/public/images/logo.png'
// -i '/www/wwwroot/api.parlando.ink/storage/app/public/audio/163/318/output_16844141095724.mp3'
// -filter_complex "[0:v]scale=720:1280,drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF'
//:textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/6/444/output_16844141093118.txt'
//:fontsize=48:fontcolor_expr='#F5F5F5%{eif\\: clip(255*(1*between(t\, 0 + 1.5\, 2.5 - 1.5) + ((t - 0)/1.5)*between(t\, 0\, 0 + 1.5) + (-(t - 2.5)/1.5)*between(t\, 2.5 - 1.5\, 2.5))\, 0\, 255) \\: x\\: 2 }':x=(w-text_w)/2:y=(h-text_h)/2:", drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF':textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/137/91/output_16844141093024.txt':fontsize=24:fontcolor_expr='#F5F5F5%{eif\\: clip(255*(1*between(t\, 0 + 1.5\, 2.5 - 1.5) + ((t - 0)/1.5)*between(t\, 0\, 0 + 1.5) + (-(t - 2.5)/1.5)*between(t\, 2.5 - 1.5\, 2.5))\, 0\, 255) \\: x\\: 2 }':x=(w-text_w)/2:y=(h-text_h)/2:", drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF':textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/38/32/output_16844141099313.txt':fontsize=48:fontcolor_expr='#F5F5F5%{eif\\: clip(255*(1*between(t\, 2.5 + 1.5\, 5 - 1.5) + ((t - 2.5)/1.5)*between(t\, 2.5\, 2.5 + 1.5) + (-(t - 5)/1.5)*between(t\, 5 - 1.5\, 5))\, 0\, 255) \\: x\\: 2 }':x='(w-text_w)/2':y='h-text_h*2-68':", drawtext="fontfile='/www/wwwroot/api.parlando.ink/storage/app/public/files/f756b152d774a107d5ad08b972764551.TTF':textfile='/www/wwwroot/api.parlando.ink/storage/app/public/text/244/134/output_16844141096908.txt':fontsize=48:fontcolor_expr='#F5F5F5%{eif\\: clip(255*(1*between(t\, 5 + 1.5\, 7.5 - 1.5) + ((t - 5)/1.5)*between(t\, 5\, 5 + 1.5) + (-(t - 7.5)/1.5)*between(t\, 7.5 - 1.5\, 7.5))\, 0\, 255) \\: x\\: 2 }':x='(w-text_w)/2':y='h-text_h*2-68':" [text];[text] [1:v]overlay=20:20[v]" -map [v] -map 2:a -c:v libx264 -bt 256k -r 25 -ar 44100 -ac 2 -qmin 30 -qmax 60 -profile:v baseline -preset fast '/www/wwwroot/api.parlando.ink/storage/app/public/video/93/183/output_16844141105696.mp4'
...
...
Please
register
or
login
to post a comment