ffmpeg - Node fluent ffmpeg:如何添加填充和背景图像?
问题描述
我目前正在使用 npm 包 fluent-ffmpeg:
https://github.com/fluent-ffmpeg/node-fluent-ffmpeg
我想得到这个结果:
但我不知道该怎么做。
更准确地说,我想调整视频大小和居中,然后添加背景图像。
这是我当前的代码(但不好):
const command = ffmpeg(video_path)
.size('640x480')
.autopad(true, 'pink')
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('Processing finished !');
const command2 = ffmpeg(destination_path1)
.size('1920x1080')
.applyAutoPadding(true, 'pink')
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('Processing finished !');
})
.save(destination_path2);
})
.save(destination_path1);
你能帮助我吗?
太感谢了
解决方案
推荐阅读
- java - 不支持 Docker-Compose 版本
- ibm-watson - 下载适用于 Microsoft Windows 64 位的 IBM Watson Studio 桌面试用版时出现问题
- php - 使用 PHP 在浏览器上运行 composer
- python - Python Selenium 脚本...使用 XPATH 获取文本
- google-apps-script - Google 表单上的动态相关下拉菜单
- javascript - 我想用 POST Data 打开一个新窗口/选项卡,但它不起作用
- swift - 静态 UITableViewCell 的自动高度调整不起作用
- pyspark - 在 pyspark 数据帧的 dtypes 中计数不同
- angular - 更改检测后角度子组件未更新
- multithreading - 如何避免多个for循环并减少时间?