当前位置:网站首页>contos install php-ffmpeg and tp5.1 using plugin
contos install php-ffmpeg and tp5.1 using plugin
2022-08-03 06:32:00 【dd00bb】
Centos 安装 ffmpeg
1.安装EPEL Release,因为安装需要使用其他的repo源,所以需要EPEL支持:
yum install -y epel-release
2.如果出现缺少Code提示,可以:
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
3.安装完成之后,可以查看是否安装成功
yum repolist
4.安装Nux-Dextop源
#导入一个Code
sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
#安装nux-dextop 源
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
5.查看repo源是否安装成功
yum repolist
6.yum安装ffmpeg:
yum install -y ffmpeg
7.安装完成后检查ffmpeg 版本:
ffmpeg -version
ThinkPHP 5.1 安装php-ffmpeg
1.进入TP5.1Execute in the project directory directory
composer require php-ffmpeg/php-ffmpeg
2.控制器中引入
<?php
namespace app\index\controller;
use FFMpeg;
class Index
{
public function index()
{
$configuration = array(
// windows调用插件
'ffmpeg.binaries' => env('root_path').'ffmpeg/bin/ffmpeg.exe',
'ffprobe.binaries' => env('root_path').'ffmpeg/bin/ffprobe.exe', //This is where it is installed on the computer or server
// linuxHow to call the plugin to report an error,在项目根目录下创建ffmpeg目录,Then create a hard link file in the directoryffmpeg
//'ffmpeg.binaries' => '/usr/bin/ffmpeg.exe',
//'ffprobe.binaries' => 'usr/bin/ffprobe.exe',
//'ffmpeg.binaries' => env('root_path').'ffmpeg/ffmpeg',
//'ffprobe.binaries' => env('root_path').'ffmpeg/ffprobe',
//'timeout' => 3600, // The timeout for the underlying process
//'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
);
$ffmpeg = FFMpeg\FFMpeg::create($configuration);
// New file after synthesis
$outfile_path = env('root_path')."public/audio/new_file.wav";
// audio source file
$audio_path = env('root_path')."audio/";
$audio = $ffmpeg->open($audio_path.'0.wav');
// List of audio files to be synthesized
$file_arr[] = $audio_path.'0.wav';
$file_arr[] = $audio_path.'1.wav';
$file_arr[] = $audio_path.'2.wav';
// The new file after synthesis exists,则先删除掉,重新合成
if(file_exists($outfile_path)){
unlink($outfile_path);
}
// Perform synthesis of audio files
$audio->concat($file_arr)->saveFromSameCodecs($outfile_path, TRUE);
return true;
}
}
边栏推荐
- 二层交换机,三层交换机,路由器内容总结记录
- 使用Blender和ZBrush制作武器模型
- NIO知识汇总 收藏这一篇就够了!!!
- VS2022 encapsulation under Windows dynamic library and dynamic library calls
- 3. What is the difference between final, finally, and finalize?
- ZEMAX | 在OpticStudio中建立扩增实境(VR)头戴式显示器
- 【面筋1】一些没什么标准答案的问题
- window下VS2022封装动态库以及调用动态库
- 各种cms getshell技巧
- 大学毕业后,零基础想转行成为一名3D建模师,现在该做什么?
猜你喜欢
随机推荐
数组与字符串8-最长回文子串
3d建模师为什么不建议入行
2021-06-15
次世代建模到底需要哪些美术基础
Automatic ticket issuance based on direct reduction of China Southern Airlines app
g++ parameter description
Prometheus监控容器、pod、邮件告警
权限管理 UGO 、 ACL 、特殊权限
VI和VIM编辑指令
mib browser无法接收snmp trap消息解决
MySql【后面附有练习题】
ZEMAX | 如何围绕空间中的任何点旋转任何元素
【C语言】斐波那契数列
嘿!selenium自动下载driver版本,得知道一下
9. Please introduce the class loading process, what is the parent delegation model?
ZEMAX | 探究 OpticStudio 偏振分析功能
【七夕特效】 -- 满屏爱心
申请公网ip后,配置光猫,路由器使用公网ip步骤
什么是次世代建模,为什么这么多建模人在学习次世代建模流程
交换机access口,hybrid口,trunk口的区别









