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-02 17:01:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3bc45e82ded0c9022b912f59b9523412909f0b99
3bc45e82
1 parent
bc57cfad
1.继续调试ffmpeg命令
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
app/Console/Commands/DevFFmpeg.php
app/Console/Commands/DevFFmpeg.php
View file @
3bc45e8
...
...
@@ -46,6 +46,48 @@ class DevFFmpeg extends Command
*/
public
function
handle
()
{
$content
=
'题破山寺后禅院'
.
"
\t
"
.
' -- 常建'
.
PHP_EOL
.
'清晨入古寺,初日照高林。'
.
PHP_EOL
.
'曲径通幽处,禅房花木深。'
.
PHP_EOL
.
'山光悦鸟性,潭影空人心。'
.
PHP_EOL
.
'万籁此都寂,但余钟磬音。'
.
PHP_EOL
;
$path
=
'/Users/lishuai/Desktop/test/'
;
$cmd
=
$this
->
ffmpeg
.
' -y '
.
' -i '
.
escapeshellarg
(
$path
.
'qinghuaci.mp4'
)
.
' -i '
.
escapeshellarg
(
$path
.
'suffiix.mp4'
)
.
' -i '
.
escapeshellarg
(
$path
.
'logo.png'
)
.
' -filter_complex "[0:0] '
.
'drawtext="'
.
'fontfile='
.
escapeshellarg
(
$path
.
'arialuni.ttf'
)
.
':'
.
'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=20:20[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'
.
// ' -c:v:thumb png -disposition:v:thumb attached_pic' .
' -ar 44100 -ac 2 -qmin 30 -qmax 60 -profile:v baseline -preset fast '
.
escapeshellarg
(
$path
.
'out.mp4'
);
$this
->
execmd
(
$cmd
);
$cmd
=
$this
->
ffmpeg
.
' -y'
.
' -i '
.
escapeshellarg
(
$path
.
'out.mp4'
)
.
' -i '
.
escapeshellarg
(
$path
.
'thumbnail.png'
)
.
' -map 1 -map 0 -c copy -disposition:0 attached_pic '
.
escapeshellarg
(
$path
.
'out2.mp4'
);
$this
->
execmd
(
$cmd
);
return
0
;
$adminMakeVideo
=
AdminMakeVideo
::
query
()
->
first
();
$adminMakeVideo
->
video_url
=
Storage
::
disk
(
'public'
)
->
path
(
$adminMakeVideo
->
video_url
);
// $adminMakeVideo->thumbnail_url = Storage::disk('public')->path($adminMakeVideo->thumbnail_url);
...
...
Please
register
or
login
to post a comment