gpt4 book ai didi

laravel - 将 ffmpeg 命令输出存储到 aws s3

转载 作者:行者123 更新时间:2023-12-04 23:25:32 28 4
gpt4 key购买 nike

我在下面运行的命令在本地文件系统中运行良好。

命令:

exec('ffmpeg -i '.config('medialibrary.s3.domain').'/listing_video/intro.mp4'.' -vf "drawtext=fontfile=' . storage_path('assets/video/FutuMd.ttf') . ': text=' . $request->get('intro_text') . ': x=300: y=450: fontsize=65: fontcolor=white: enable=\'between(t,2,5)\'" introfinal.mp4');

但我必须将文件直接存储到s3,所以我将存储文件的命令更改为s3,但文件大小为0B。
exec('ffmpeg -i '.config('medialibrary.s3.domain').'/listing_video/intro.mp4'.' -vf "drawtext=fontfile=' . storage_path('assets/video/FutuMd.ttf') . ': text=' . $request->get('intro_text') . ': x=300: y=450: fontsize=65: fontcolor=white: enable=\'between(t,2,5)\'" '.Storage::put('introfinal.mp4', '').'');

提前致谢!

最佳答案

这个例子并不完美,但会为您指明正确的方向:

exec('ffmpeg -i '.config('medialibrary.s3.domain').'/listing_video/intro.mp4'.' -vf "drawtext=fontfile=' . storage_path('assets/video/FutuMd.ttf') . ': text=' . $request->get('intro_text') . ': x=300: y=450: fontsize=65: fontcolor=white: enable=\'between(t,2,5)\'" introfinal.mp4');

$contents = file_get_contents('introfinal.mp4');

$success = Storage::put('introfinal.mp4', $contents);

关于laravel - 将 ffmpeg 命令输出存储到 aws s3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50406491/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com