egg-szjcomo-ffmpeg
v1.0.1
Published
Readme
egg-szjcomo-ffmpeg
Install
$ npm i egg-szjcomo-ffmpeg --saveUsage
// {app_root}/config/plugin.js
exports.ffmpeg = {
enable: true,
package: 'egg-szjcomo-ffmpeg',
};Configuration
// {app_root}/config/config.default.js
//不需要配置项
exports.ffmpeg = {
};Example
获取视频信息
app.ffmpeg.input(filename).info().then(data =>{console.log(data)})生成视频缩略图
//options = count:1,timestamps:[0.1],size:'400x?'}
// count 生成数量 timestamps 时间段 必须为一个数组 size 缩略图大小
app.ffmpeg.input(filename).thumb(save_name,options).then(data => {})获取ffmpeg实例
app.ffmpeg.ffmpeg()视频转码
//options = {codec:'libx264',size:'720x?',autopad:'#000000'}
//codec 编码格式 size 输出大小 autopad 填充颜色
app.ffmpeg.input(filename).toMp4(save_name,options).then(data => {})Questions & Suggestions
Please open an issue here.
